Farama-Foundation / PettingZoo

An API standard for multi-agent reinforcement learning environments, with popular reference environments and related utilities
https://pettingzoo.farama.org
Other
2.6k stars 410 forks source link

[Question] Using a custom gym environment #1125

Closed shreshth-29 closed 11 months ago

shreshth-29 commented 11 months ago

Question

I have created a custom environment using gymnasium, and I wish to use it with pettingzoo. The existing wrappers are used to convert between AEC and parallel environments, but there isn't any information available on how we can use a gym environment with pettingzoo. What can I do for this?

elliottower commented 11 months ago

I believe I commented in discord but there's no easy way to convert, you would have to adapt it manually and make careful consideration of the environment logic. For example, a single player game played with multiple players could mean each player goes sequentially in the same environment, or each at the same time, etc. If one of them terminates the game could end, or it could keep playing. So it's not really possible to make a general purpose wrapper doing this.