Bugs in passable check in _is_valid() method of Maze object
It seems that negative or out of edge position will result index error in _is_valid() method, because of the passable check. I think it should be changed to def _is_valid(self, position): nonnegative = position[0] >= 0 and position[1] >= 0 within_edge = position[0] < self.maze.size[0] and position[1] < self.maze.size[1] if (nonnegative and within_edge): passable = not self.maze.to_impassable()[position[0]][position[1]] else: passable = False return nonnegative and within_edge and passable
IndexError Traceback (most recent call last)
//anaconda3/lib/python3.7/site-packages/gym/wrappers/time_limit.py in step(self, action) 14 def step(self, action): 15 assert self._elapsed_steps is not None, "Cannot call env.step() before calling reset()" ---> 16 observation, reward, done, info = self.env.step(action) 17 self._elapsed_steps += 1 18 if self._elapsed_steps >= self._max_episode_steps:
IndexError: index 6 is out of bounds for axis 0 with size 6