A collection of multi agent environments based on OpenAI gym.
cd ma-gym
pip install -e .
import gym
import ma_gym
env = gym.make('Switch2-v0')
done_n = [False for _ in range(env.n_agents)]
ep_reward = 0
obs_n = env.reset()
while not all(done_n):
env.render()
obs_n, reward_n, done_n, info = env.step(env.action_space.sample())
ep_reward += sum(reward_n)
env.close()
Please refer to Wiki for complete usage details
- Checkers
- Combat
- PredatorPrey
- Pong Duel
(two player pong game)
- Switch
Note : openai's environment can be accessed in multi agent form by prefix "ma_".Eg: ma_CartPole-v0
This returns an instance of CartPole-v0 wrapped around multi agent from having a single agent.
These environments are helpful during debugging.
Please refer to Wiki for more details.
Checkers-v0 | Switch2-v0 | Switch4-v0 |
---|---|---|
PongDuel-v0 | Combat-v0 | PredatorPrey7x7-v0 |
PredatorPrey5x5-v0 | ||
- Install:
pip install pytest
- Run:
pytest
This project was developed to complement my research internship @ SAS.