def step(self, action):
""" Perform an action and observe the resulting state.
Args:
action (int): Selected action ID to perform in envirnoment.
Returns:
reward (float): The change of score after performing the action.
"""
_logger.debug("Getting index of action %s" % (str(action)))
action = np.where(self.avail_actions == action)[0][0]
self.current_frame, reward, self.terminal_state, info = self.gym.step(action)
self.current_frame = cv2.resize(cv2.cvtColor(self.current_frame, cv2.COLOR_RGB2GRAY), self.frame_dims)
if self.counts_lives:
self.just_lost_live = self.has_just_lost_live()
return reward
评论列表
文章目录