MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / reset

Method reset

dm_control/rl/control.py:82–97  ·  view source on GitHub ↗

Starts a new episode and returns the first `TimeStep`.

(self)

Source from the content-addressed store, hash-verified

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`."""

Callers 15

stepMethod · 0.95
test_timeoutMethod · 0.95
test3DDetectionMethod · 0.95
test2DDetectionMethod · 0.95
testActivationMethod · 0.95
test_observablesMethod · 0.95
test_observablesMethod · 0.95

Calls 4

flatten_observationFunction · 0.85
reset_contextMethod · 0.80
initialize_episodeMethod · 0.45
get_observationMethod · 0.45

Tested by 15

test_timeoutMethod · 0.76
test3DDetectionMethod · 0.76
test2DDetectionMethod · 0.76
testActivationMethod · 0.76
test_observablesMethod · 0.76
test_observablesMethod · 0.76