فهرست منبع

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