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<=23.0.1' pip install 'setuptools<=66' pip install 'wheel<=0.38.4'
- Install package:
-
Using PyPI:
pip install ma-gym
-
Directly 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).
Metadata
Release files for ma-gym 0.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ma_gym-0.0.14.tar.gz | 40.8 kB | Without provenance | Details for ma_gym-0.0.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ma_gym-0.0.14-py3-none-any.whl | Python 3 | none | any | Details for ma_gym-0.0.14-py3-none-any.whl |
Total release size: 96.7 kB
Release files / ma_gym-0.0.14.tar.gz
| Download URL | ma_gym-0.0.14.tar.gz |
|---|---|
| Size | 40.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0896657042a9e5427cd3fe051b9b35c8a6b7e24efff539d4be7eb8e8f624a2f
|
|
BLAKE2b-256 checksum How to use checksums |
ed7df7d3f64e2f5d215c8ac604804bff8331fbc70580ed2da072e3ff04703acf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / ma_gym-0.0.14-py3-none-any.whl
| Download URL | ma_gym-0.0.14-py3-none-any.whl |
|---|---|
| Size | 55.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56e664ce35c41976cf518fb2f0d4278e4c71ae4da9bdda28b32b2abe887fd4ee
|
|
BLAKE2b-256 checksum How to use checksums |
bbde643f458fb0299480a9e0a4277b236fea5e103a571793215b88a2b6217124
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for ma-gym 0.0.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.