You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many algorithms work in the parallel setting — especially all the algorithms with the CTDE approach (the majority).
Please insert the example of the parallel execution. It was hard to find out how to do it properly.
My suggestion:
# uncomment the required environment# from magent2.environments.adversarial_pursuit import parallel_env# from magent2.environments.battle import parallel_env# from magent2.environments.battlefield import parallel_env# from magent2.environments.combined_arms import parallel_env# from magent2.environments.gather import parallel_env, raw_envfrommagent2.environments.tiger_deerimportparallel_envimporttime# to render or not to renderrender_mode='human'# render_mode=Noneenv=parallel_env(render_mode=render_mode, max_cycles=200)
observations, infos=env.reset()
i_step=0whileenv.agents:
# this is where you would insert your policyactions= {agent: env.action_space(agent).sample() foragentinenv.agents}
observations, rewards, terminations, truncations, infos=env.step(actions)
i_step+=1print(f'{i_step}')
# time.sleep(0.1) # for slower renderingenv.close()
The text was updated successfully, but these errors were encountered:
Many algorithms work in the parallel setting — especially all the algorithms with the CTDE approach (the majority).
Please insert the example of the parallel execution. It was hard to find out how to do it properly.
My suggestion:
The text was updated successfully, but these errors were encountered: