Closed labanca closed 9 months ago
That library is made by one of PettingZoo’s maintainers actually, @jjshoots, so he can probably answer better. The only real way is to modify the underlying environment to make it conform to the API. I imagine jet had some plans or specific details but if you want to do it yourself, I would recommend just changing the base class to ParallelEnv, and making each of the values such as action, observation, reward, termination, truncation, info be dicts indexed by AgentID (from pettingzoo.utils.env import AgentID, just a type that can be used for type hinting to make it more readable). You would then need to change internals about how the step function works to accommodate it, but in concept at least the most straightforward conversation is gymnasium to parallel because they use the same api essentially (returning on step, whereas with AEC envs you have to call env.last() and have an env.observe() method).
In general I’d recommend making an issue on any repo like this which you are trying to modify, as the creators of it will have better knowledge and be able to help you better. Going to close this as this isn’t strictly relevant to pettingzoo as a library. Feel free to reach out and create a question onour discord or continue to use this when it’s closed. Just have to do house keeping to make sure open issues are real issues we need to internally solve.
Also I definitely wouldn’t recommend that tutorial as it is very old, we have more recent ones on our site. https://pettingzoo.farama.org/
@labanca if you can move the issue into the issues section for PyFlyt, I can probably help you better there, let's not clutter PZ with a non-PZ issue. :)
@jjshoots I can't move this issue from here to there, the option to move the issue is not available to me.
So, I'm going to open a new issue on PyFlyt and you can delete this one if you prefer.
Sorry for opening the issue in the wrong place and thanks for the help!
Question
I'm trying to convert the gymnasium environment PyFlyt to multi-agent using pettingzoo and SuperSuit.
Where can I find material to learn how to do it and where to start? I tried following the Multi-Agent Deep Reinforcement Learning in 13 Lines of Code Using PettingZoo but I get stuck on many errors such as:
And after adding the metada
is_parallelizable
to True, the following:I have just started using petting zoo and any help would be greatly appreciated.
Thanks in advance!