Skip to content

Latest commit

 

History

History
73 lines (48 loc) · 2.64 KB

README.md

File metadata and controls

73 lines (48 loc) · 2.64 KB

MultiGrid


Blocked Unlock Pickup: 2 Agents


The MultiGrid library provides contains a collection of fast multi-agent discrete gridworld environments for reinforcement learning in Gymnasium. This is a multi-agent extension of the minigrid library, and the interface is designed to be as similar as possible.

The environments are designed to be fast and easily customizable. Compared to minigrid, the underlying gridworld logic is significantly optimized, with environment simulation 10x to 20x faster by our benchmarks.

Documentation for this library can be found at ini.github.io/docs/multigrid.

Installation

pip install multigrid

Or alternatively, for an editable install:

git clone https://github.com/ini/multigrid
cd multigrid
pip install -e .

This package requires Python 3.9 or later.

Environments

The multigrid.envs package provides implementations of several multi-agent environments. You can find the full list here.

API

MultiGrid follows the same pattern as RLlib's MultiAgentEnv API and PettingZoo's ParallelEnv API.

import gymnasium as gym
import multigrid.envs

env = gym.make('MultiGrid-Empty-8x8-v0', agents=2, render_mode='human')

observations, infos = env.reset()
while not env.is_done():
   # this is where you would insert your policy / policies
   actions = {agent.index: agent.action_space.sample() for agent in env.agents}
   observations, rewards, terminations, truncations, infos = env.step(actions)

env.close()

More information about using MultiGrid directly with other APIs:

Training Agents

See the scripts folder for an example training with RLlib.

Documentation

Documentation for this package can be found at ini.github.io/docs/multigrid.

Citation

To cite this project please use:

@article{oguntola2023theory,
  title={Theory of mind as intrinsic motivation for multi-agent reinforcement learning},
  author={Oguntola, Ini and Campbell, Joseph and Stepputtis, Simon and Sycara, Katia},
  journal={arXiv preprint arXiv:2307.01158},
  year={2023}
}