Browse Source

Added screenshot to README, fixed issue with standalone.py

Maxime Chevalier-Boisvert 7 years ago
parent
commit
3e42fe68d3
3 changed files with 19 additions and 4 deletions
  1. 6 2
      README.md
  2. BIN
      figures/door-key-env.png
  3. 13 2
      standalone.py

+ 6 - 2
README.md

@@ -89,6 +89,10 @@ Registered configurations:
 - `MiniGrid-Door-Key-8x8-v0`
 - `MiniGrid-Door-Key-8x8-v0`
 - `MiniGrid-Door-Key-16x16-v0`
 - `MiniGrid-Door-Key-16x16-v0`
 
 
+<p align="center">
+<img src="/figures/door-key-env.png">
+</p>
+
 This environment has a key that the agent must pick up in order to unlock
 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,
 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
 because of the sparse reward, to solve using classical RL algorithms. It is
@@ -99,7 +103,7 @@ useful to experiment with curiosity or curriculum learning.
 Registered configurations:
 Registered configurations:
 - `MiniGrid-Multi-Room-N6-v0`
 - `MiniGrid-Multi-Room-N6-v0`
 
 
-<p align="center"> 
+<p align="center">
 <img src="/figures/multi-room.gif" width=416 height=424>
 <img src="/figures/multi-room.gif" width=416 height=424>
 </p>
 </p>
 
 
@@ -114,7 +118,7 @@ rooms and building a curriculum, the environment can be solved.
 Registered configurations:
 Registered configurations:
 - `MiniGrid-Fetch-8x8-v0`
 - `MiniGrid-Fetch-8x8-v0`
 
 
-<p align="center"> 
+<p align="center">
 <img src="/figures/fetch-env.png" width=392 height=269>
 <img src="/figures/fetch-env.png" width=392 height=269>
 </p>
 </p>
 
 

BIN
figures/door-key-env.png


+ 13 - 2
standalone.py

@@ -5,13 +5,24 @@ from __future__ import division, print_function
 import numpy
 import numpy
 import gym
 import gym
 import time
 import time
+from optparse import OptionParser
 
 
 import gym_minigrid
 import gym_minigrid
 from gym_minigrid.envs import MiniGridEnv
 from gym_minigrid.envs import MiniGridEnv
 
 
 def main():
 def main():
-
-    env = gym.make('MiniGrid-Multi-Room-N6-v0')
+    parser = OptionParser()
+    parser.add_option(
+        "-e",
+        "--env-name",
+        dest="env_name",
+        help="gym environment to load",
+        default='MiniGrid-Multi-Room-N6-v0'
+    )
+    (options, args) = parser.parse_args()
+
+    # Load the gym environment
+    env = gym.make(options.env_name)
     env.reset()
     env.reset()
 
 
     # Create a window to render into
     # Create a window to render into