/cogrid

Primary LanguagePythonApache License 2.0Apache-2.0

CoGrid

CoGrid Logo

CoGrid is a library for creating grid-based multi-agent environments for multi-agent reinforcement learning research. It is built on top of Minigrid, a minimalistic gridworld library developed originally by Chevalier-Boisvert et al. (2023) (https://arxiv.org/abs/2306.13831). CoGrid has several core differentiating factors from Minigrid:

  1. Multi-agent support. CoGrid supports multiple agents in the same environment, each with their own observation space and action space. Whereas Minigrid's environment logic is centered around a single agent interacting with a Grid of WorldObj objects, CoGrid's environment logic also tracks Agent objects as unique objects, allowing an arbitrary number to exist in the environment.
  2. Reward modularization. CoGrid allows for the creation of custom Reward objects that can be added to the environment. Each Reward is used to calculate the reward for each agent at each step, and can be used to create complex reward functions that depend on the state of the environment, the actions of other agents, etc.
  3. Feature modularization. Similar to rewards, CoGrid allows for the creation of custom Feature objects that can be added to the environment. These Feature classes are used to construct each agent's observation space, such as the location of other agents, an image of the environment, etc.

CoGrid utilizes the parallel PettingZoo API to standardize the multi-agent environment interface.

Example GIF

Installation

Install from the PyPi distribution:

pip install cogrid

Citation

If you use CoGrid in your research, please cite the following paper:

@article{mcdonald2024cogrid,
 author  = {McDonald, Chase and Gonzalez, Cleotilde},
 title   = {CoGrid and Interactive Gym: A Framework for Multi-Agent Experimentation},
 year    = {forthcoming},
 }