Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update parallel_test.py to support Ray RLLib MultiAgentEnv #1096

Merged
merged 4 commits into from
Sep 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pettingzoo/test/parallel_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def parallel_api_test(par_env: ParallelEnv, num_cycles=1000):
agent
), "action_space should return the exact same space object (not a copy) for an agent (ensures that action space seeding works as expected). Consider decorating your action_space(self, agent) method with @functools.lru_cache(maxsize=None)"

for agent in live_agents:
# we make a copy of live_agents because live_agents changes during iteration
for agent in set(live_agents):
jjshoots marked this conversation as resolved.
Show resolved Hide resolved
if terminated[agent] or truncated[agent]:
live_agents.remove(agent)

Expand Down