Generates an action and applies it to the environment. If a `policy` was provided, this will be invoked to generate an action to feed to the environment, otherwise a default action will be generated. Returns: A boolean value, True if the environment signaled the episode end, Fals
(self)
| 236 | mujoco.mj_forward(self._env.physics.model.ptr, self._env.physics.data.ptr) |
| 237 | |
| 238 | def _step(self): |
| 239 | """Generates an action and applies it to the environment. |
| 240 | |
| 241 | If a `policy` was provided, this will be invoked to generate an action to |
| 242 | feed to the environment, otherwise a default action will be generated. |
| 243 | |
| 244 | Returns: |
| 245 | A boolean value, True if the environment signaled the episode end, False |
| 246 | if the episode is still running. |
| 247 | """ |
| 248 | finished = True |
| 249 | with self._error_logger: |
| 250 | if self._policy: |
| 251 | action = self._policy(self._time_step) |
| 252 | else: |
| 253 | action = self._default_action |
| 254 | self._time_step = self._env.step(action) |
| 255 | self._last_action = action |
| 256 | finished = self._time_step.last() |
| 257 | return finished or self._error_logger.errors_found |