Quellcode durchsuchen

Minor bugfix wrt door placement

Maxime Chevalier-Boisvert vor 6 Jahren
Ursprung
Commit
342eeb6cfe
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  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