瀏覽代碼

Minor bugfix wrt door placement

Maxime Chevalier-Boisvert 6 年之前
父節點
當前提交
342eeb6cfe
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      gym_minigrid/envs/fourrooms.py

+ 2 - 2
gym_minigrid/envs/fourrooms.py

@@ -42,13 +42,13 @@ class FourRoomsEnv(MiniGridEnv):
                 # Bottom wall and door
                 if i + 1 < 2:
                     self.grid.vert_wall(xR, yT, room_h)
-                    pos = (xR, self._rand_int(yT + 1, yB - 1))
+                    pos = (xR, self._rand_int(yT + 1, yB))
                     self.grid.set(*pos, None)
 
                 # Bottom wall and door
                 if j + 1 < 2:
                     self.grid.horz_wall(xL, yB, room_w)
-                    pos = (self._rand_int(xL + 1, xR - 1), yB)
+                    pos = (self._rand_int(xL + 1, xR), yB)
                     self.grid.set(*pos, None)
 
         # Randomize the player start position and orientation