项目
在 GitHub 查看
koulanurag/ma-gym
关于
基于 OpenAI Gym 的多智能体环境集合。
人工智能与机器学习实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文ma-gym
It's a collection of multi agent environments based on OpenAI gym. Also, you can use minimal-marl to warm-start training of agents.
Installation
- Setup (important):
pip install 'pip<24.1' pip install 'setuptools<=66' pip install 'wheel<=0.38.4' - Install package:
Using PyPI:
pip install ma-gymDirectly from source (recommended):
git clone https://github.com/koulanurag/ma-gym.git cd ma-gym pip install -e .
Reference:
Please use this bibtex if you would like to cite it:
@misc{magym,
author = {Koul, Anurag},
title = {ma-gym: Collection of multi-agent environments based on OpenAI gym.},
year = {2019},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/koulanurag/ma-gym}},
}
Usage:
import gym
env = gym.make('ma_gym: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
Environments:
- Checkers
- Combat
- PredatorPrey
- Pong Duel
(two player pong game) - Switch
- Lumberjacks
- TrafficJunction
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 in "multi agent wrapper" having a single agent.
These environments are helpful during debugging.
Please refer to Wiki for more details.
Zoo!
| Checkers-v0 | Combat-v0 | Lumberjacks-v0 |
|---|---|---|
![]() |
![]() |
![]() |
| PongDuel-v0 | PredatorPrey5x5-v0 | PredatorPrey7x7-v0 |
![]() |
![]() |
![]() |
| Switch2-v0 | Switch4-v0 | TrafficJunction4-v0 |
![]() |
![]() |
![]() |
| TrafficJunction10-v0 | ||
![]() |
Testing:
- Install:
pip install -e ".[test]" - Run:
pytest
Acknowledgement:
- This project was initially developed to complement my research internship @ SAS (Summer - 2019).
探索相关项目
加载中…









