Browse Source

Minor bugfix wrt door placement

Maxime Chevalier-Boisvert 6 years ago
parent
commit
342eeb6cfe
1 changed files with 2 additions and 2 deletions
  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