def step(self, action):
if isinstance(self._env.action_space, Box):
# rescale the action
lb = self._env.action_space.low
ub = self._env.action_space.high
scaled_action = lb + (action + 1.) * 0.5 * (ub - lb)
scaled_action = np.clip(scaled_action, lb, ub)
else:
scaled_action = action
wrapped_step = self._env.step(scaled_action)
_, reward, done, info = wrapped_step
next_frame_raw = self._env.render('rgb_array')
next_frame = self._process_frame42(next_frame_raw)
return next_frame_raw, next_frame, reward, done, info
评论列表
文章目录