def step(self, action):
self._grid = self.convert_to_grid(self._state, *self._grid.shape)
state = np.argwhere(self._grid == self._symbols['S']).ravel()
new_state, reward, absorbing, info = self._step(state, action)
if info['success']:
self._grid[tuple(state)] = self._symbols['.']
self._grid[tuple(new_state)] = self._symbols['S']
self._state = self.convert_to_pixel(self._grid,
self.window_size[1],
self.window_size[0])
return self._state, reward, absorbing, info
评论列表
文章目录