Starts a new episode and returns the first `TimeStep`.
(self)
| 80 | self._reset_next_step = True |
| 81 | |
| 82 | def reset(self): |
| 83 | """Starts a new episode and returns the first `TimeStep`.""" |
| 84 | self._reset_next_step = False |
| 85 | self._step_count = 0 |
| 86 | with self._physics.reset_context(): |
| 87 | self._task.initialize_episode(self._physics) |
| 88 | |
| 89 | observation = self._task.get_observation(self._physics) |
| 90 | if self._flat_observation: |
| 91 | observation = flatten_observation(observation) |
| 92 | |
| 93 | return dm_env.TimeStep( |
| 94 | step_type=dm_env.StepType.FIRST, |
| 95 | reward=None, |
| 96 | discount=None, |
| 97 | observation=observation) |
| 98 | |
| 99 | def step(self, action): |
| 100 | """Updates the environment using the action and returns a `TimeStep`.""" |