Code Monkey home page Code Monkey logo

gym-multigrid's Introduction

Multi-Agent Gridworld Environment (MultiGrid)

Lightweight multi-agent gridworld Gym environment built on the MiniGrid environment.

Requirements:

  • Python 3.5+
  • OpenAI Gym
  • NumPy
  • Matplotlib

Please use this bibtex if you want to cite this repository in your publications:

@misc{gym_multigrid,
  author = {Fickinger, Arnaud},
  title = {Multi-Agent Gridworld Environment for OpenAI Gym},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/ArnaudFickinger/gym-multigrid}},
}

Installation

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

Test

python test_env.py

Design

The environment can be either fully or partially observable. Each grid cell is encoded with a tuple containing:

  • The type of the object (can be another agent)
    • Provided object types are: wall, floor, lava, door, key, ball, box, goal, object goal and agent
  • The color of the object or other agent
  • The type of the object that the other agent is carrying
  • The color of the object that the other agent is carrying
  • The direction of the other agent
  • Whether the other agent is actually one-self (useful for fully observable view)

Actions in the basic environment:

  • Turn left
  • Turn right
  • Move forward
  • Pick up an object
  • Drop the object being carried
  • Toggle (open doors, interact with objects)
  • Done (task completed, optional)

Included Environments

Two environments are included.

SoccerGame

Each agent get a positive reward whenever one agent drop the ball in their goal and a negative reward whenever one agent drop the ball in the opposite goal. Each agent can pass the ball to or take it from another agent. The number of teams, number of player in each team, number of goals and number of balls can be easily modified.

CollectGame

Each agent get a positive reward whenever one agent collect a ball of the same color and a negative reward whenever one agent collect a ball of a different color. The number of balls, colors and players can be easily modified.

gym-multigrid's People

Contributors

arnaudfickinger avatar mitulmagu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gym-multigrid's Issues

How to interpret the env.render() return?

Env.render() returns the observation of each agent in the environment. This observation is used to choose the best policy in q-learing. However the env.render() returns an array of arrays containing 2-dim arrays with values I do not understand. Is there anyone who can clarify this to me? How could these observations be used to conduct q-learning?

Training the agent using the torch-rl repository

I am trying to train the agents in the multigrid environment using the torch-rl repository (https://github.com/lcswillems/rl-starter-files) which is compatible with gym-minigrid. After registering the new environment in gym (multigrid-collect-v0) and running the environment using

python3 -m scripts.train --algo ppo --env multigrid-collect-v0

I am receiving the following runtime error: RuntimeError: Expected 4-dimensional input for 4-dimensional weight [16, 3, 2, 2], but got 5-dimensional input of size [16, 3, 5, 3, 6] instead

Is there a way to make it compatible with the torch-rl repository or am I making a mistake somewhere? Any help would be much appreciated, thanks!

Addition of more multi-agent environments

Hey! Thank you for making this extension to minigrid. Do you plan to add more multi-agent environments in the future such as pursuit evasion, warehouse environment or more environments from literature?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.