MCPcopy Index your code
hub / github.com/google-deepmind/dm_control / copy

Method copy

dm_control/mujoco/engine.py:287–304  ·  view source on GitHub ↗

Creates a copy of this `Physics` instance. Args: share_model: If True, the copy and the original will share a common MjModel instance. By default, both model and data will both be copied. Returns: A `Physics` instance.

(self, share_model=False)

Source from the content-addressed store, hash-verified

285 )
286
287 def copy(self, share_model=False):
288 """Creates a copy of this `Physics` instance.
289
290 Args:
291 share_model: If True, the copy and the original will share a common
292 MjModel instance. By default, both model and data will both be copied.
293
294 Returns:
295 A `Physics` instance.
296 """
297 new_data = self.data._make_copy(share_model=share_model) # pylint: disable=protected-access
298 cls = self.__class__
299 new_obj = cls.__new__(cls)
300 # pylint: disable=protected-access
301 new_obj._warnings_cause_exception = True
302 new_obj._reload_from_data(new_data)
303 # pylint: enable=protected-access
304 return new_obj
305
306 def reset(self, keyframe_id=None):
307 """Resets internal variables of the simulation, possibly to a keyframe.

Callers 15

runMethod · 0.45
_validate_observationMethod · 0.45
get_observationMethod · 0.45
joint_anglesMethod · 0.45
jointsMethod · 0.45
get_observationMethod · 0.45
get_model_and_assetsFunction · 0.45
torso_com_velocityMethod · 0.45
joint_anglesMethod · 0.45
joint_velocitiesMethod · 0.45

Calls 3

_make_copyMethod · 0.80
__new__Method · 0.45
_reload_from_dataMethod · 0.45