Minimalistic Gridworld Environment (MiniGrid)

Overview

Minimalistic Gridworld Environment (MiniGrid)

Build Status

There are other gridworld Gym environments out there, but this one is designed to be particularly simple, lightweight and fast. The code has very few dependencies, making it less likely to break or fail to install. It loads no external sprites/textures, and it can run at up to 5000 FPS on a Core i7 laptop, which means you can run your experiments faster. A known-working RL implementation can be found in this repository.

Requirements:

  • Python 3.5+
  • OpenAI Gym
  • NumPy
  • Matplotlib (optional, only needed for display)

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

@misc{gym_minigrid,
  author = {Chevalier-Boisvert, Maxime and Willems, Lucas and Pal, Suman},
  title = {Minimalistic Gridworld Environment for OpenAI Gym},
  year = {2018},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/maximecb/gym-minigrid}},
}

List of publications & submissions using MiniGrid or BabyAI (please open a pull request to add missing entries):

This environment has been built as part of work done at Mila. The Dynamic obstacles environment has been added as part of work done at IAS in TU Darmstadt and the University of Genoa for mobile robot navigation with dynamic obstacles.

Installation

There is now a pip package available, which is updated periodically:

pip3 install gym-minigrid

Alternatively, to get the latest version of MiniGrid, you can clone this repository and install the dependencies with pip3:

git clone https://github.com/maximecb/gym-minigrid.git
cd gym-minigrid
pip3 install -e .

Basic Usage

There is a UI application which allows you to manually control the agent with the arrow keys:

./manual_control.py

The environment being run can be selected with the --env option, eg:

./manual_control.py --env MiniGrid-Empty-8x8-v0

Reinforcement Learning

If you want to train an agent with reinforcement learning, I recommend using the code found in the torch-rl repository. This code has been tested and is known to work with this environment. The default hyper-parameters are also known to converge.

A sample training command is:

cd torch-rl
python3 -m scripts.train --env MiniGrid-Empty-8x8-v0 --algo ppo

Wrappers

MiniGrid is built to support tasks involving natural language and sparse rewards. The observations are dictionaries, with an 'image' field, partially observable view of the environment, a 'mission' field which is a textual string describing the objective the agent should reach to get a reward, and a 'direction' field which can be used as an optional compass. Using dictionaries makes it easy for you to add additional information to observations if you need to, without having to encode everything into a single tensor.

There are a variery of wrappers to change the observation format available in gym_minigrid/wrappers.py. If your RL code expects one single tensor for observations, take a look at FlatObsWrapper. There is also an ImgObsWrapper that gets rid of the 'mission' field in observations, leaving only the image field tensor.

Please note that the default observation format is a partially observable view of the environment using a compact and efficient encoding, with 3 input values per visible grid cell, 7x7x3 values total. These values are not pixels. If you want to obtain an array of RGB pixels as observations instead, use the RGBImgPartialObsWrapper. You can use it as follows:

from gym_minigrid.wrappers import *
env = gym.make('MiniGrid-Empty-8x8-v0')
env = RGBImgPartialObsWrapper(env) # Get pixel observations
env = ImgObsWrapper(env) # Get rid of the 'mission' field
obs = env.reset() # This now produces an RGB tensor only

Design

Structure of the world:

  • The world is an NxM grid of tiles
  • Each tile in the grid world contains zero or one object
    • Cells that do not contain an object have the value None
  • Each object has an associated discrete color (string)
  • Each object has an associated type (string)
    • Provided object types are: wall, floor, lava, door, key, ball, box and goal
  • The agent can pick up and carry exactly one object (eg: ball or key)
  • To open a locked door, the agent has to be carrying a key matching the door's color

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)

Default tile/observation encoding:

  • Each tile is encoded as a 3 dimensional tuple: (OBJECT_IDX, COLOR_IDX, STATE)
  • OBJECT_TO_IDX and COLOR_TO_IDX mapping can be found in gym_minigrid/minigrid.py
  • e.g. door STATE -> 0: open, 1: closed, 2: locked

By default, sparse rewards are given for reaching a green goal tile. A reward of 1 is given for success, and zero for failure. There is also an environment-specific time step limit for completing the task. You can define your own reward function by creating a class derived from MiniGridEnv. Extending the environment with new object types or new actions should be very easy. If you wish to do this, you should take a look at the gym_minigrid/minigrid.py source file.

Included Environments

The environments listed below are implemented in the gym_minigrid/envs directory. Each environment provides one or more configurations registered with OpenAI gym. Each environment is also programmatically tunable in terms of size/complexity, which is useful for curriculum learning or to fine-tune difficulty.

Empty environment

Registered configurations:

  • MiniGrid-Empty-5x5-v0
  • MiniGrid-Empty-Random-5x5-v0
  • MiniGrid-Empty-6x6-v0
  • MiniGrid-Empty-Random-6x6-v0
  • MiniGrid-Empty-8x8-v0
  • MiniGrid-Empty-16x16-v0

This environment is an empty room, and the goal of the agent is to reach the green goal square, which provides a sparse reward. A small penalty is subtracted for the number of steps to reach the goal. This environment is useful, with small rooms, to validate that your RL algorithm works correctly, and with large rooms to experiment with sparse rewards and exploration. The random variants of the environment have the agent starting at a random position for each episode, while the regular variants have the agent always starting in the corner opposite to the goal.

Four rooms environment

Registered configurations:

  • MiniGrid-FourRooms-v0

Classic four room reinforcement learning environment. The agent must navigate in a maze composed of four rooms interconnected by 4 gaps in the walls. To obtain a reward, the agent must reach the green goal square. Both the agent and the goal square are randomly placed in any of the four rooms.

Door & key environment

Registered configurations:

  • MiniGrid-DoorKey-5x5-v0
  • MiniGrid-DoorKey-6x6-v0
  • MiniGrid-DoorKey-8x8-v0
  • MiniGrid-DoorKey-16x16-v0

This environment has a key that the agent must pick up in order to unlock a goal and then get to the green goal square. This environment is difficult, because of the sparse reward, to solve using classical RL algorithms. It is useful to experiment with curiosity or curriculum learning.

Multi-room environment

Registered configurations:

  • MiniGrid-MultiRoom-N2-S4-v0 (two small rooms)
  • MiniGrid-MultiRoom-N4-S5-v0 (four rooms)
  • MiniGrid-MultiRoom-N6-v0 (six rooms)

This environment has a series of connected rooms with doors that must be opened in order to get to the next room. The final room has the green goal square the agent must get to. This environment is extremely difficult to solve using RL alone. However, by gradually increasing the number of rooms and building a curriculum, the environment can be solved.

Fetch environment

Registered configurations:

  • MiniGrid-Fetch-5x5-N2-v0
  • MiniGrid-Fetch-6x6-N2-v0
  • MiniGrid-Fetch-8x8-N3-v0

This environment has multiple objects of assorted types and colors. The agent receives a textual string as part of its observation telling it which object to pick up. Picking up the wrong object produces a negative reward.

Go-to-door environment

Registered configurations:

  • MiniGrid-GoToDoor-5x5-v0
  • MiniGrid-GoToDoor-6x6-v0
  • MiniGrid-GoToDoor-8x8-v0

This environment is a room with four doors, one on each wall. The agent receives a textual (mission) string as input, telling it which door to go to, (eg: "go to the red door"). It receives a positive reward for performing the done action next to the correct door, as indicated in the mission string.

Put-near environment

Registered configurations:

  • MiniGrid-PutNear-6x6-N2-v0
  • MiniGrid-PutNear-8x8-N3-v0

The agent is instructed through a textual string to pick up an object and place it next to another object. This environment is easy to solve with two objects, but difficult to solve with more, as it involves both textual understanding and spatial reasoning involving multiple objects.

Red and blue doors environment

Registered configurations:

  • MiniGrid-RedBlueDoors-6x6-v0
  • MiniGrid-RedBlueDoors-8x8-v0

The agent is randomly placed within a room with one red and one blue door facing opposite directions. The agent has to open the red door and then open the blue door, in that order. Note that, surprisingly, this environment is solvable without memory.

Memory environment

Registered configurations:

  • MiniGrid-MemoryS17Random-v0
  • MiniGrid-MemoryS13Random-v0
  • MiniGrid-MemoryS13-v0
  • MiniGrid-MemoryS11-v0

This environment is a memory test. The agent starts in a small room where it sees an object. It then has to go through a narrow hallway which ends in a split. At each end of the split there is an object, one of which is the same as the object in the starting room. The agent has to remember the initial object, and go to the matching object at split.

Locked room environment

Registed configurations:

  • MiniGrid-LockedRoom-v0

The environment has six rooms, one of which is locked. The agent receives a textual mission string as input, telling it which room to go to in order to get the key that opens the locked room. It then has to go into the locked room in order to reach the final goal. This environment is extremely difficult to solve with vanilla reinforcement learning alone.

Key corridor environment

Registed configurations:

  • MiniGrid-KeyCorridorS3R1-v0
  • MiniGrid-KeyCorridorS3R2-v0
  • MiniGrid-KeyCorridorS3R3-v0
  • MiniGrid-KeyCorridorS4R3-v0
  • MiniGrid-KeyCorridorS5R3-v0
  • MiniGrid-KeyCorridorS6R3-v0

This environment is similar to the locked room environment, but there are multiple registered environment configurations of increasing size, making it easier to use curriculum learning to train an agent to solve it. The agent has to pick up an object which is behind a locked door. The key is hidden in another room, and the agent has to explore the environment to find it. The mission string does not give the agent any clues as to where the key is placed. This environment can be solved without relying on language.

Unlock environment

Registed configurations:

  • MiniGrid-Unlock-v0

The agent has to open a locked door. This environment can be solved without relying on language.

Unlock pickup environment

Registed configurations:

  • MiniGrid-UnlockPickup-v0

The agent has to pick up a box which is placed in another room, behind a locked door. This environment can be solved without relying on language.

Blocked unlock pickup environment

Registed configurations:

  • MiniGrid-BlockedUnlockPickup-v0

The agent has to pick up a box which is placed in another room, behind a locked door. The door is also blocked by a ball which the agent has to move before it can unlock the door. Hence, the agent has to learn to move the ball, pick up the key, open the door and pick up the object in the other room. This environment can be solved without relying on language.

Obstructed maze environment

Registered configurations:

  • MiniGrid-ObstructedMaze-1Dl-v0
  • MiniGrid-ObstructedMaze-1Dlh-v0
  • MiniGrid-ObstructedMaze-1Dlhb-v0
  • MiniGrid-ObstructedMaze-2Dl-v0
  • MiniGrid-ObstructedMaze-2Dlh-v0
  • MiniGrid-ObstructedMaze-2Dlhb-v0
  • MiniGrid-ObstructedMaze-1Q-v0
  • MiniGrid-ObstructedMaze-2Q-v0
  • MiniGrid-ObstructedMaze-Full-v0

The agent has to pick up a box which is placed in a corner of a 3x3 maze. The doors are locked, the keys are hidden in boxes and doors are obstructed by balls. This environment can be solved without relying on language.

Distributional shift environment

Registered configurations:

  • MiniGrid-DistShift1-v0
  • MiniGrid-DistShift2-v0

This environment is based on one of the DeepMind AI safety gridworlds. The agent starts in the top-left corner and must reach the goal which is in the top-right corner, but has to avoid stepping into lava on its way. The aim of this environment is to test an agent's ability to generalize. There are two slightly different variants of the environment, so that the agent can be trained on one variant and tested on the other.

Lava gap environment

Registered configurations:

  • MiniGrid-LavaGapS5-v0
  • MiniGrid-LavaGapS6-v0
  • MiniGrid-LavaGapS7-v0

The agent has to reach the green goal square at the opposite corner of the room, and must pass through a narrow gap in a vertical strip of deadly lava. Touching the lava terminate the episode with a zero reward. This environment is useful for studying safety and safe exploration.

Lava crossing environment

Registered configurations:

  • MiniGrid-LavaCrossingS9N1-v0
  • MiniGrid-LavaCrossingS9N2-v0
  • MiniGrid-LavaCrossingS9N3-v0
  • MiniGrid-LavaCrossingS11N5-v0

The agent has to reach the green goal square on the other corner of the room while avoiding rivers of deadly lava which terminate the episode in failure. Each lava stream runs across the room either horizontally or vertically, and has a single crossing point which can be safely used; Luckily, a path to the goal is guaranteed to exist. This environment is useful for studying safety and safe exploration.

Simple crossing environment

Registered configurations:

  • MiniGrid-SimpleCrossingS9N1-v0
  • MiniGrid-SimpleCrossingS9N2-v0
  • MiniGrid-SimpleCrossingS9N3-v0
  • MiniGrid-SimpleCrossingS11N5-v0

Similar to the LavaCrossing environment, the agent has to reach the green goal square on the other corner of the room, however lava is replaced by walls. This MDP is therefore much easier and and maybe useful for quickly testing your algorithms.

Dynamic obstacles environment

Registered configurations:

  • MiniGrid-Dynamic-Obstacles-5x5-v0
  • MiniGrid-Dynamic-Obstacles-Random-5x5-v0
  • MiniGrid-Dynamic-Obstacles-6x6-v0
  • MiniGrid-Dynamic-Obstacles-Random-6x6-v0
  • MiniGrid-Dynamic-Obstacles-8x8-v0
  • MiniGrid-Dynamic-Obstacles-16x16-v0

This environment is an empty room with moving obstacles. The goal of the agent is to reach the green goal square without colliding with any obstacle. A large penalty is subtracted if the agent collides with an obstacle and the episode finishes. This environment is useful to test Dynamic Obstacle Avoidance for mobile robots with Reinforcement Learning in Partial Observability.

Comments
  • List of potential improvements

    List of potential improvements

    I'm opening an issue to keep track of potential improvements to a MiniGrid v2.0. These are things I would do differently if I had to do it again. I'm not sure if these will get merged in the current version of MiniGrid because there is a big risk of breaking existing code, and this is particularly sensitive since the people using this code are using it for research purposes, where replicability is important. What may eventually happen is that I create a MiniGrid2 repository.

    1. Separate out the gridworld from the OpenAI Gym interface. As pointed out in #37, it would make sense to have a gridworld class separate from the OpenAI Gym environment class. This would help us support multi-agent type of setups. It might also be slightly cleaner. We are already part of the way there with the current Grid class.

    2. The agent should be treated like any other gridworld object. This again goes in line with multi-agent support. I think it would also be cleaner.

    3. ~~Observations should be encoded using a one-hot scheme rather than integers corresponding to each object type and color. The observations may not actually be any bigger in terms of bytes taken if we use a numpy array of bools (bits). This would likely be easier for a neural network to decode.~~ (Won't be done, results inconclusive)

    4. By default, observations should be tensors, so that the code works out of the box with most RL frameworks. Mission strings should be provided as part of the info dict. The unfortunate truth is that OpenAI Gym has very poor support for any other kind of observation encoding.

    5. ~~Doors and locked doors should probably have the same object type. We could take advantage of a one-hot scheme here and have a "door" bit as well as a "locked" flag bit. Possibly, each object should have a method to produce its own encoding in terms of bits.~~ (Done)

    6. Some people have had difficulty installing PyQT. It might be nice to explore alternative rendering options. We could potentially generate graphics directly using 2D NumPy tensors, but we would still need some library to open display windows. I don't know what is the simplest Python option for that. The goal is for this package to work everywhere without any issues as much as possible.

    7. Render current step, max steps, reward obtained in env.render('human').

    8. Rename max_steps to max_episode_steps, which is more in keeping with OpenAI Gym conventions.

    Other suggestions welcome.

    enhancement 
    opened by maximecb 22
  • Firefighter

    Firefighter

    Hey, very nice job!

    I am wondering if you're planning to release a new environment for the firefighter problem, i.e., a grid world where a cell might have its state updated (burning, protected, none) after each iteration i.

    (in a more simplistic configuration: a firefighter agent, an initial burning cell and a fixed object to protect)

    Cheers!

    enhancement help wanted 
    opened by diegoesteves 13
  • Option for full observability

    Option for full observability

    I think this would be useful for use cases where we want learning to converge to a deterministic policy (which is not optimal in some of the partially-observable settings). It would be nice to have this as an option, simply using the full grid encoding doesn't work because it doesn't represent the agent.

    enhancement help wanted 
    opened by robertmacyiii 12
  • How to use Class FullyObsWrapper in 'wrappers.py'

    How to use Class FullyObsWrapper in 'wrappers.py'

    Hi: It's really a great projet! After reading the realted issues about the FullyObs, i want to try it, but i don't know how to use the Class FullyObsWrapper in the files--'wrappers.py' . Should I import it or change the code of funciton 'gen_obs(self)' in the files--'minigrid.py' ? Thank you!

    question 
    opened by wanghuimu 10
  • Resources providing large datasets of minigrid navigation tasks?

    Resources providing large datasets of minigrid navigation tasks?

    Hello,

    I was wondering if someone could point me towards some publicly available dataset(s) of minigrid navigation environments?

    I am looking for the simplest navigation task specification with walls only (e.g. similar to MiniGrid-FourRooms-v0). Are there some prior works (papers or other format) that provide a dataset with many variations of this environment (e.g. different shapes & number of rooms, mazes, labyriths, rooms + maze-like corridors, ...)? I am looking for a dataset as large and varied as possible, or alternatively several ones that I could combine.

    Thank you!

    question 
    opened by francelico 9
  • [Bug Report] BabyAI not working

    [Bug Report] BabyAI not working

    Hi, I am trying to install BabyAI on Linux 64-bit system. I followed the instructions mentioned in the BabyAI repo for installing the environment. The BabyAI environment file specifies Python 3.6 as the dependency while the latest version of gym-minigrid is incompatible with that. So, I modified it to Python 3.7.3 and then ran the following code.

    git clone https://github.com/mila-iqia/babyai.git cd babyai conda env create -f environment.yaml source activate babyai

    cd .. git clone https://github.com/maximecb/gym-minigrid.git cd gym-minigrid pip install --editable .

    cd ../babyai pip install --editable .

    Although, I was able to successfully run this code and install the dependencies, I am getting this error when I am trying to import babyai.

    `Python 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

    import gym /home/biplab/.local/lib/python3.7/site-packages/matplotlib/init.py:152: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(module.version) < minver: /home/biplab/anaconda3/envs/babyai/lib/python3.7/site-packages/setuptools/_distutils/version.py:351: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. other = LooseVersion(other) import babyai Traceback (most recent call last): File "", line 1, in File "/home/biplab/Valay/babyai/babyai/init.py", line 3, in from . import levels File "/home/biplab/Valay/babyai/babyai/levels/init.py", line 4, in from . import bonus_levels File "/home/biplab/Valay/babyai/babyai/levels/bonus_levels.py", line 2, in from gym_minigrid.envs import Key, Ball, Box ImportError: cannot import name 'Key' from 'gym_minigrid.envs' (/home/biplab/anaconda3/envs/babyai/lib/python3.7/site-packages/gym_minigrid/envs/init.py)

    Can something be done here or can I find the older repo somewhere since the latest version doesn't seem to work with BabyAI?

    Thanks

    opened by Valaybundele 8
  • [Bug Report] README seems out of sync

    [Bug Report] README seems out of sync

    If you are submitting a bug report, please fill in the following details and use the tag [bug].

    Describe the bug

    Not an actual bug, but I believe your current readme is out of sync with the state of the code.

    Screenshot from your readme: Screenshot 2022-08-11 at 11 27 36

    Screenshot from me trying to play with wrappers: Screenshot 2022-08-10 at 23 27 08

    Checklist

    • [x] I have checked that there is no similar issue in the repo (required)
    opened by ArturNiederfahrenhorst 8
  • SIGSEGV on env.step for multiple renderings.

    SIGSEGV on env.step for multiple renderings.

    Hey there, I'm experiencing a segmentation fault after I call env.step when there are multiple renderings open. I saw a closed thread on openai for the same issue, but I'm unsure if the bug still persists across some of their environments.

    bug 
    opened by chasebos91 8
  • NumPy-based renderer (eliminate PyQT dependency)

    NumPy-based renderer (eliminate PyQT dependency)

    Some users have difficulties installing PyQT, on clusters in particular. It would be useful to build a renderer which uses NumPy instead of PyQT. This should not be too complicated to do given that the 2D graphics of MiniGrid are very simple.

    The first step will be to evaluate what the performance impact might be. A caching strategy may need to be used to maximize performance.

    enhancement 
    opened by maximecb 8
  • Why not make a pip package?

    Why not make a pip package?

    Hi Maxime,

    MiniGrid is growing fast!

    I was wondering: why you don't create a pip package for MiniGrid? It would be easier to install your package. And why you don't create releases of your code? This way, you can do changes that are not backward compatible without breaking people's code. You can also detail the changes you did.

    Best, Lucas

    enhancement help wanted 
    opened by lcswillems 8
  • šŸ”§ Make env picklable

    šŸ”§ Make env picklable

    Description

    I needed envs to be picklable for using them in multiple process. Thus I fixed the issue that happens to be lambda functions used for missions generation.

    Fixes to fact that envs were not picklable.

    Type of change

    Please delete options that are not relevant.

    • [X] Bug fix (non-breaking change which fixes an issue)
    • [X] New feature (non-breaking change which adds functionality)

    Checklist:

    • [X] I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
    • [X] I have commented my code, particularly in hard-to-understand areas
    • [X] I have made corresponding changes to the documentation (None?)
    • [X] My changes generate no new warnings
    • [X] I have added tests that prove my fix is effective or that my feature works
    • [X] New and existing unit tests pass locally with my changes
    opened by MathisFederico 7
  • [Proposal] ANSI color support

    [Proposal] ANSI color support

    Proposal

    Currently when print(env) is used, it already prints an ASCII representation whereby each cell is printed as two letters AB, A being the cell type, and B being the cell color. Most terminal nowadays or at least for a few decades) support ANSI colors, so it would be good to have ANSI color support (using the second letter as color code instead of printing it), ideally as an optional flag.

    Motivation

    Personally I don't like Matplotlib visualization except for paper output, as it's overkill to render to an image to then open a window and display a grid compared to just printing it to the shell, hence this proposal. But there is another aspect: in the long-run it might also be good to make optional the dependencies which have nothing to do with the environment simulation itself (especially matplotlib, pillow, which are behemoths with native components which are known to cause portability issues on regular basis). Having a good ASCII renderer with ANSI colors could be a first step in this direction.

    Pitch

    I have implemented a POC, please let me know if I should create a PR of the following: https://gist.github.com/patham9/2d2c0c125bc683ba600778123bed4b0a This is how it looks like in Termux on Android: minigrid2

    Alternatives

    Alternatively rendering could also be done with a different library, but separating rendering from Minigrid will make using the library less convenient and might cause potential version conflicts in the future, so I don't recommend it. In any case the grid logic should be clearly separated from the rendering code and libraries needed for rendering should be optional.

    opened by patham9 2
  • [Bug Report] Cannot create any env, TypeError: 'NoneType' object is not subscriptable

    [Bug Report] Cannot create any env, TypeError: 'NoneType' object is not subscriptable

    Just installed this repo with pip install minigrid. Using python 3.10.9 on Win 11.

    import gymnasium
    gymnasium.make('MiniGrid-Unlock-v0')
    
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gymnasium\core.py", line 383, in __repr__
        return str(self)
      File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gymnasium\core.py", line 379, in __str__
        return f"<{type(self).__name__}{self.env}>"
      File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gymnasium\core.py", line 379, in __str__
        return f"<{type(self).__name__}{self.env}>"
      File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\minigrid\minigrid_env.py", line 207, in __str__
        if i == self.agent_pos[0] and j == self.agent_pos[1]:
    TypeError: 'NoneType' object is not subscriptable
    

    This happens with any env I tried except the empty minigrid.

    I have checked that there is no similar issue in the repo.

    opened by sparisi 2
  • Paper for Minigrid List of Publications

    Paper for Minigrid List of Publications

    opened by DrGlennn 1
  • Fix a typo in MissionSpace __eq__

    Fix a typo in MissionSpace __eq__

    Description

    Was that a typo?

    Type of change

    Please delete options that are not relevant.

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] This change requires a documentation update
    opened by manuel-delverme 0
  • [Proposal] Add support for multi-agent environments

    [Proposal] Add support for multi-agent environments

    It would be nice to add gridworld based multi-agent environments. These are could be used for reserach into RL safety, explainability, emergent communication, etc

    If there is anyone who has already create MA environments or is interested in working on this problem then please respond

    enhancement 
    opened by pseudo-rnd-thoughts 0
  • [Proposal] Add wind attribute for stochastic environments

    [Proposal] Add wind attribute for stochastic environments

    In Distributional Reinforcement Learning with Quantile Regression, they propose a testing environment where wind is added to the environment to make a gridworld problem stochastic.

    I propose a new environment or minigrid environment argument to add this wind to any environment I favour the new environment approach as I think this is a feature that other environment would not want or need

    enhancement 
    opened by pseudo-rnd-thoughts 0
Releases(v2.1.0)
  • v2.1.0(Nov 13, 2022)

    What's Changed

    • Added new BabyAI level environments. @saleml
    • New documentation website at https://minigrid.farama.org/ @SiddarGu @mgoulao. @jjshoots
    • Update security permissions for GitHub workflows. #252 @andrewtanJS
    • Refactor manual_control.py. @MathisFederico
    • Fix issue with making all environments pickable #269. @MathisFederico
    • Include max_steps argument in all of the environments. Fix https://github.com/Farama-Foundation/Minigrid/issues/264. @rodrigodelazcano
    • Include agent's position in the SymbolicObsWrapper observation. Fix #278. @rodrigodelazcano

    Type Hinting

    • Add type hint to core API. @arjun-kg
    • Improve type hint in MinigridEnv @micimize
    • Add py.typed marker to use minigrid's type annotations in external tooling such as mypy

    New Publications

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Sep 28, 2022)

    This release transitions the repository dependency from gym to gymnasium. gymnasium is a fork of OpenAI's Gym library by the maintainers, and is where future maintenance will occur going forward. gymnasium.farama.org

    What's Changed

    • Migration from gym to gymnasium v0.26. @rodrigodelazcano
    • Package name change from gym_minigrid to minigrid. @rodrigodelazcano
    • Change file structure for better comprehension. @pseudo-rnd-thoughts . The new file structure looks as follows:
      • Divide minigrid.py into sub-files for easier comprehension and keep them under core directory:
        • actions.py: class structure with the actions encodings
        • constants.py: constants in the environments such as object colors
        • grid.py: the grid class
        • mission.py: the mission space implementation
        • roomgrid.py: class for environments with rooms
        • world_object: object classes (Wall, Ball, Goal, Floor, ...)
      • New utils directory for rendering files rendering.py and window.py
    • Add automatic doc generation for website, available at https://farama-foundation.github.io/MiniGrid/. @SiddarGu

    Minor Changes

    • Change file name minigrid.py to minigrid_env.py. Fixes issue #243 @rodrigodelazcano
    Source code(tar.gz)
    Source code(zip)
  • V1.2.2(Sep 15, 2022)

    Deprecated package naming (gym_minigrid -> minigrid)

    The PyPi package name for this repository will be changed in future releases and integration with Gymnasium. The new name will be minigrid and installation will be done with pip install minigrid instead of pip install gym_minigrid.

    This release adds a deprecation warning when importing or installing gym_minigrid.

    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Sep 11, 2022)

    Bug Fix

    • Fix #232. Removed new_step_api=True argument in manual_control.py. Latest 1.2.0 MiniGrid release is not backward compatible with gym releases previous to v0.26. Thus every minigrid environment has a hard constraint on using new step API and the option to set the argument new_step_api=True in the environments was removed. @rodrigodelazcano
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Sep 9, 2022)

    Release notes for v1.2.0

    The changes in this release allow for compatibility with the latest Gym release v0.26. For more information on the API changes in Gym v0.26 see the release notes in https://github.com/openai/gym/releases.

    Previous Gym versions such as v0.22, v0.23, v0.24, and v0.25 are no longer compatible.

    The aim of this version is primarily bug fixing, if you find that this does not work, please make an issue or put a message on the Gym discord server in the gym-minigrid channel (https://discord.gg/nHg2JRN489).

    If you are interested in working on gym-minigrid then message PseudoRnd or Rodridelaz on discord.

    Major Changes

    • Support of new step API. The Env.step function returns 5 values instead of 4 previously (observations, reward, termination, truncation, info). . @saleml
    • Support of new reset API. The Env.reset function returns two values (obs and info). @rodrigodelazcano
    • Support of new rendering API. More information about the rendering API can be found in this blog post @rodrigodelazcano
    • Add new test files for window.py, benchmark.py and manual_control.py under test_scripts.py.@saleml

    Minor Changes

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Aug 10, 2022)

    This release is compatible with Gym versions, v0.22, v0.23, v0.24 and v0.25. Incompatible Gym version with v0.21 due to Env.reset(seed)

    The aim of this version is primarily bug fixing, if you find that this does not work, please make an issue or put a message on the Gym discord server in the gym-minigrid channel (https://discord.gg/nHg2JRN489).

    If you are interested in working on gym-minigrid then message me on discord, PseudoRnd

    Changes

    • Removes compatibility with python 3.6 due to python foundation no longer supporting it @rodrigodelazcano
    • Moved benchmark.py and manual_control.py to gym_minigrid folder @rodrigodelazcano
    • Added MissionSpace that is similar to the Gym Text space to specify the space for all environments @rodrigodelazcano
    • Fixed benchmark.py and manual_control.py to work @rodrigodelazcano
    • Updated the metadata keys of environment ā€œrender.modeā€ to ā€œrender_modeā€ and ā€œrender.fpsā€ to ā€œrender_fpsā€ @saleml #194
    • Fixed the wrappers that updated the environment observation space rather than the wrapper observation space @saleml #194
    • Added wrapper DictObservationSpaceWrapper for changing the mission text to an embedding array. @saleml #194
    • Added support for setting a custom max_steps value in door key environment @zeionara #193
    • Removed all cases of from XYZ import * and from .XYZ import ABC in favor of absolute imports. This could cause issues for users that use from gym_minigrid import * @pseudo-rnd-thoughts #201
    • Rename environments and files for consistency and removed unnecessary environment classes in favor of kwargs in gym.make @pseudo-rnd-thoughts #202
      • BlockedUnlockPickupĀ ->Ā BlockedUnlockPickupEnv
      • KeyCorridorĀ ->Ā KeyCorridorEnv
      • LockedRoomĀ ->Ā LockedRoomEnvĀ andĀ RoomĀ ->Ā LockedRoomĀ (this is as multiroom also contains a Room to prevent conflict changed both of their names)
      • RoomĀ ->Ā MultiRoomĀ in multiroom.py
      • playground_v0.pyĀ ->Ā playgroundĀ andĀ PlaygroundV0Ā ->Ā PlaygroundEnv
      • UnlockĀ ->Ā UnlockEnv
      • UnlockPickupĀ ->Ā UnlockPickupEnv
    • Added minimal type checking with pyright @rodrigodelazcano
    • Register environments with entrypoint @rodrigodelazcano
    # Old
    import gym_minigrid
    import gym
    env = gym.make('MiniGrid-PutNear-6x6-N2-v0')
    # or
    import gym
    env = gym.make('gym_minigrid:MiniGrid-PutNear-6x6-N2-v0')
        
    # New
    import gym
    env = gym.make('MiniGrid-PutNear-6x6-N2-v0')
    
    • Fixed FlatObsWrapper to contain ā€œ,ā€ and increase the numCharCodes=28 @saleml #207
    Source code(tar.gz)
    Source code(zip)
Owner
Maxime Chevalier-Boisvert
PhD in compiler design. Also having fun with graphics, machine learning, electronics, music and DIY. All opinions are my own.
Maxime Chevalier-Boisvert
C++ Environment InitiatorVisual Studio Code C / C++ Environment Initiator

Visual Studio Code C / C++ Environment Initiator Latest Version : v 1.0.1(2021/11/08) .exe link here About : Visual Studio Codeģ—ģ„œ C/C++ķ™˜ź²½ģ„ MinGW GCC/G

Junho Yoon 2 Dec 19, 2021
CNKD - Minimalistic Windows ransomware written in Python

CNKD Minimalistic Windows ransomware written in Python (Still a work in progress

Alex 2 May 27, 2022
RELATE is an Environment for Learning And TEaching

RELATE Relate is an Environment for Learning And TEaching RELATE is a web-based courseware package. It is set apart by the following features: Focus o

Andreas Klƶckner 311 Dec 25, 2022
Transparently load variables from environment or JSON/YAML file.

A thin wrapper over Pydantic's settings management. Allows you to define configuration variables and load them from environment or JSON/YAML file. Also generates initial configuration files and documentation for your defined configuration.

Lincoln Loop 90 Dec 14, 2022
AndroidEnv is a Python library that exposes an Android device as a Reinforcement Learning (RL) environment.

AndroidEnv is a Python library that exposes an Android device as a Reinforcement Learning (RL) environment.

DeepMind 814 Dec 26, 2022
My solution for a MARL problem on a Grid Environment with Q-tables.

To run the project, run: conda create --name env python=3.7 pip install -r requirements.txt python run.py To-do: Add direction to the state space Take

Merve Noyan 12 Dec 25, 2021
A step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.

This project has a step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.

Steve Macenski 49 Dec 22, 2022
BridgeWalk is a partially-observed reinforcement learning environment with dynamics of varying stochasticity.

BridgeWalk is a partially-observed reinforcement learning environment with dynamics of varying stochasticity. The player needs to walk along a bridge to reach a goal location. When the player walks off the bridge into the water, the current will move it randomly until it gets washed back on the shore. A good agent in this environment avoids this stochastic trap

Danijar Hafner 6 Jun 13, 2022
pydock - Docker-based environment manager for Python

pydock - Docker-based environment manager for Python āš ļø pydock is still in beta mode, and very unstable. It is not recommended for anything serious. p

Alejandro Piad 16 Sep 18, 2021
A StarkNet project template based on a Pythonic environment

StarkNet Project Template This is an opinionated StarkNet project template. It is based around the Python's ecosystem and best practices. tox to manag

Francesco Ceccon 5 Apr 21, 2022
Exercise to teach a newcomer to the CLSP grid to set up their environment and run jobs

Exercise to teach a newcomer to the CLSP grid to set up their environment and run jobs

Alexandra 2 May 18, 2022
A turtlebot auto controller allows robot to autonomously explore environment.

A turtlebot auto controller allows robot to autonomously explore environment.

Yuliang Zhong 1 Nov 10, 2021
pyToledo is a Python library to interact with the common virtual learning environment for the Association KU Leuven (Toledo).

pyToledo pyToledo is a Python library to interact with the common virtual learning environment for the Association KU Leuven a.k.a Toledo. Motivation

Daan Vervacke 5 Jan 3, 2022
Python implementation of an automatic parallel parking system in a virtual environment, including path planning, path tracking, and parallel parking

Automatic Parallel Parking: Path Planning, Path Tracking & Control This repository contains a python implementation of an automatic parallel parking s

null 134 Jan 9, 2023
Application launcher and environment management

Application launcher and environment management for 21st century games and digital post-production, built with bleeding-rez and Qt.py News Date Releas

null 10 Nov 3, 2022
This simple script generates a backup of a given Python and R environment

Python Environment Backup Itā€™s always good to maintain your Python and R Anaconda environment packages properly listed and well-kept in case you have

Andrew Laganaro 1 Jul 13, 2022
DC619/DC858 Mainframe Environment/Lab

DC619 Training LPAR The file DC619 - Mainframe Overflows Hands On.pdf contains the labs and walks through how to perform them. Use docker You can use

Soldier of FORTRAN 9 Jun 27, 2022
The mock Pokemon Environment I built in 2019 to study Reinforcement Learning + Pokemon

ghetto-pokemon-rl-environment ##NOT MAINTAINED! Fork and maintain yourself. Environment I made back in 2019 to use Pokemon to practice reinforcement l

null 2 Dec 9, 2021
A simple wrapper to analyse and visualise reinforcement learning agents' behaviour in the environment.

Visrl Visrl (pronounced "visceral") is a simple wrapper to analyse and visualise reinforcement learning agents' behaviour in the environment. Reinforc

Jet New 14 Jun 27, 2022