瀏覽代碼

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 年之前
父節點
當前提交
d3b1ea8df4
共有 1 個文件被更改,包括 5 次插入0 次删除
  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