entity-neural-network / entity-gym

Standard interface for entity based reinforcement learning environments.
Other
35 stars 5 forks source link

Add self-play/multi-agent support #4

Open cswinter opened 2 years ago

cswinter commented 2 years ago

Ideally, we eventually add support for the full PettingZoo multi-agent API. As a much simpler first step that already covers a lot of interesting environments, we could add support for multi-agent environments with simultaneous moves, and a fixed number of actors. The main new feature this would require is a version of Environment which accepts an entire list of actions, and similarly returns a list of observations. This multi-agent environment can the be simply treated as multiple normal environments by ListEnv or ParallelListEnv.

Bam4d commented 2 years ago

I will need this for the grafter environment so I can do this as part of that integration

cswinter commented 11 months ago

Going through required changes in more detail:

https://github.com/entity-neural-network/entity-gym/blob/7df3dd0d344f2857d756faf2916103402c3e5356/entity_gym/env/environment.py#L199

https://github.com/entity-neural-network/entity-gym/blob/7df3dd0d344f2857d756faf2916103402c3e5356/entity_gym/env/env_list.py#L27 There's probably a few other places that need small fixes to fully support, enn-trainer needs a method that accepts a multi-player environment and code that instantiates environments needs to be modified a bit to account for that fact that each environment instance yields effectively multiple environments.