Browse Source

add env.close method (#100)

as mentioned here: https://github.com/openai/gym/issues/1056#issuecomment-471136134 

close=True was removed a while ago, so this change just adds an 'env.close' method exactly the same as the way you were doing it, without removing the old way, so it's hopefully backwards compatible (let's test it!)
bion howard 4 years ago
parent
commit
d3b1ea8df4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      gym_minigrid/minigrid.py

+ 5 - 0
gym_minigrid/minigrid.py

@@ -1293,3 +1293,8 @@ class MiniGridEnv(gym.Env):
             self.window.set_caption(self.mission)
 
         return img
+
+    def close(self):
+        if self.window:
+            self.window.close()
+        return