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[email protected]

    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
Christmas tree on the desktop.

new-year-tree Christmas tree on the desktop. [Ссылка на статью habr]

Daniil Gorbenko 10 Dec 29, 2022
Kubernetes-native workflow automation platform for complex, mission-critical data and ML processes at scale. It has been battle-tested at Lyft, Spotify, Freenome, and others and is truly open-source.

Flyte Flyte is a workflow automation platform for complex, mission-critical data, and ML processes at scale Home Page · Quick Start · Documentation ·

Flyte 3k Jan 01, 2023
Convert your Gyrosco.pe travels to GPX files

gyroscope2gpx This little python joint will do you a favor of taking your "Travel" export from Gyroscope (https://gyrosco.pe) and turn it into a bunch

nick g 4 Oct 02, 2022
Aesthetic NFT Generator

A E S T H E T I C Dependencies Pillow numpy OpenCV You can use pip to install any missing dependencies. Basic Usage Vaporwave artwork can be generated

Mentor Elezi 4 Mar 13, 2022
Repls goes to sleep due to inactivity, but to keep it awake, simply host a webserver and ping it.

Repls goes to sleep due to inactivity, but to keep it awake, simply host a webserver and ping it. This repo will help you make a webserver with a bit of console controls.

2 Mar 01, 2022
Learn to code in any language. If

Learn to Code It is an intiiative undertaken by Student Ambassadors Club, Jamshoro for students who are absolute begineers in programming and want to

Student Ambassadors' Club at Mehran UET 15 Oct 19, 2022
Site de gestion de cave à vin utilisant une BDD manipulée avec SQLite3 via Python

cave-vin Site de gestion de cave à vin utilisant une bdd manipulée avec MySQL ACCEDER AU SITE : Pour accéder à votre cave vous aurez besoin de lancer

Elouann Lucas 0 Jul 05, 2022
This is a Fava extension to display a grouped portfolio view in Fava for a set of Beancount accounts.

Fava Portfolio Summary This is a Fava extension to display a grouped portfolio view in Fava for a set of Beancount accounts. It can also calculate MWR

18 Dec 26, 2022
An After Effects render queue for ShotGrid Toolkit.

AEQueue An After Effects render queue for ShotGrid Toolkit. Features Render multiple comps to locations defined by templates in your Toolkit config. C

Brand New School 5 Nov 20, 2022
Python code for YouTube videos.

#This is a open source project. Python 3 These files are mainly intended to accompany my series of YouTube tutorial videos here, https://www.youtube.c

Joe James 1.3k Dec 26, 2022
monster hunter world randomizer project

mhw_randomizer monster hunter world randomizer project Settings are in rando_config.py Current script for attack randomization is n mytest.py There ar

2 Jan 24, 2022
Awesome & interesting talks about programming

Programming Talks I watch a lot of talks that I love to share with my friends, fellows and coworkers. As I consider all GitHubbers my friends (oh yeah

Veit Heller 7k Dec 26, 2022
Parser for air tickets' price

Air-ticket-price-parser Parser for air tickets' price How to Install Firefox If geckodriver.exe is not compatible with your Firefox version, download

Situ Xuannn 1 Dec 13, 2021
a url shortener with fastapi and tortoise-orm

fastapi-tortoise-orm-url-shortener a url shortener with fastapi and tortoise-orm

19 Aug 12, 2022
Team Hash Brown Science4Cast Submission

Team Hash Brown Science4Cast Submission This code reproduces Team Hash Brown's (@princengoc, @Xieyangxinyu) best submission (ee5a) for the competition

3 Feb 02, 2022
SMS-b0mber VANDALIZM developed for VK group

VANDALIZM SMS-b0mber VANDALIZM developed for VK group https://vk.com/dark__code if you come across this code, you can use it for your own purposes) ус

5 Jun 24, 2022
Senator Stock Trading Tester

Senator Stock Trading Tester Program to compare stock performance of Senator's transactions vs when the sale is disclosed. Using to find if tracking S

Cole Cestaro 1 Dec 07, 2021
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
A simple assembly- and brainfuck-inspired stack-based language

asm-stackfuck A simple assembly- and brainfuck-inspired stack-based language. The language has a few goals: Be stack-based Look like assembly Have a s

Nils Trinity 1 Feb 06, 2022
This package tries to emulate the behaviour of syntax proposed in PEP 671 via a decorator

Late-Bound Arguments This package tries to emulate the behaviour of syntax proposed in PEP 671 via a decorator. Usage Mention the names of the argumen

Shakya Majumdar 0 Feb 06, 2022