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

Method _step

dm_control/viewer/runtime.py:238–257  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 5

_step_simulationMethod · 0.95
single_stepMethod · 0.95
test_step_with_policyMethod · 0.80

Calls 1

stepMethod · 0.45

Tested by 3

test_step_with_policyMethod · 0.64