Skip to content

LIRA-illinois/gym-multigrid

Repository files navigation

gym-multigrid

This repo is intended to be a lightweight, multi-agent, gridworld environment. It was originally based on this multigrid environment, but has since been heavily modified and developed beyond the scope of the original environment. Please cite this respository as well as the original repository if you use this environment in any of your projects:

@misc{multigrid,
  title = {Tran Research Group Gridworld Environment},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/Tran-Research-Group/trg-multigrid}},
}

Getting started

The library is available on PyPI, so you can simply run pip install gym-multigrid to add the package to your dependency!

Alternatively, if you would like to install specific branch version of the package (for example, dev branch), run:

 pip install git+https://github.com/Tran-Research-Group/gym-multigrid.git@dev    

To modify or contribute to this project, install gym-multigrid from source. This repo uses poetry library dependency management. To install the dependencies for this project run:

git clone https://github.com/Tran-Research-Group/gym-multigrid.git
cd gym-multigrid
poetry install

Included environments

Capture-the-Flag (CtF)

2 v 2 CtF Game

Agents move around to capture enemy's flag. The details are here.

Collect Game

Collect Game Respawn

Attribute Description
Action Space Discrete(4)
Observation Space np.array of shape grid.width x grid.height
Observation Encoding (OBJECT_IDX, COLOR_IDX, STATE)
Reward (0, 1)
Number of Agents 2
Termination Condition None
Truncation Steps 50
Creation gymnasium.make("multigrid-collect-respawn-clustered-v0")

Agents move around the grid to collect objects. The object respawns in a random location after being collected.

Maze

Wildfire

WildfireEnv Example

Attribute Description
Actions Discrete
Agent Action Space Discrete(5)
Observations Discrete
Observability Fully observable
Agent Observation Space Box([0,...],[1,...],(shape depends on number of agents,),float32)
States Discrete
State Space Box([0,...],[1,...],(shape depends on number of agents,),float32)
Agents Cooperative or Non-cooperative or Group
Number of Agents >=1
Termination Condition No trees on fire exist
Truncation Steps >=1
Creation gymnasium.make("wildfire-v0")

Agents move over trees on fire to dump fire retardant. Initial fire is randomly located. Agents can be cooperative (shared reward) or non-cooperative (individual/group rewards). A non-cooperative agent preferentially protects a region of selfish interest within the grid. Above GIF contains two groups of agents with their selfish regions shown in same color.

Extending multigrid

Please see this guide for creating a custom multigrid environment. See CONTRIBUTING.md for our code guidelines if you are interested in adding your environment to this repo.

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages