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 năm trước cách đây
mục cha
commit
d3b1ea8df4
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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