(self, physics)
Sets the state of the environment at the start of each episode.
Sets the state of the environment at the start of each episode.
Sets the state of the environment at the start of each episode .
def initialize_episode(self, physics):
    """Sets the state of the environment at the start of each episode."""
    physics.named.model.geom_size['target', 0] = self._target_size
    randomizers.randomize_limited_and_rotational_joints(physics, self.random)

    # Randomize target position
    angle = self.random.uniform(0, 2 * np.pi)
    radius = self.random.uniform(.05, .20)
    physics.named.model.geom_pos['target', 'x'] = radius * np.sin(angle)
    physics.named.model.geom_pos['target', 'y'] = radius * np.cos(angle)

    super().initialize_episode(physics)
def initialize_episode ( self , physics ) : physics . named . model . geom_size [ 'target' , 0 ] = self . _target_size randomizers . randomize_limited_and_rotational_joints ( physics , self . random ) # Randomize target position angle = self . random . uniform ( 0 , 2 * np . pi ) radius = self . random . uniform ( .05 , .20 ) physics . named . model . geom_pos [ 'target' , 'x' ] = radius * np . sin ( angle ) physics . named . model . geom_pos [ 'target' , 'y' ] = radius * np . cos ( angle ) super ( ) . initialize_episode ( physics )