(self, physics)
return box_is_close * hand_is_far
Returns a reward to the agent.
Returns a reward to the agent.
Returns a reward to the agent .
def get_reward(self, physics):
    """Returns a reward to the agent."""
    box_size = physics.named.model.geom_size['target', 0]
    min_box_to_target_distance = min(physics.site_distance(name, 'target')
                                     for name in self._box_names)
    box_is_close = rewards.tolerance(min_box_to_target_distance,
                                     margin=2*box_size)
    hand_to_target_distance = physics.site_distance('grasp', 'target')
    hand_is_far = rewards.tolerance(hand_to_target_distance,
                                    bounds=(.1, float('inf')),
                                    margin=_CLOSE)
    return box_is_close * hand_is_far
def get_reward ( self , physics ) : box_size = physics . named . model . geom_size [ 'target' , 0 ] min_box_to_target_distance = min ( physics . site_distance ( name , 'target' ) for name in self . _box_names ) box_is_close = rewards . tolerance ( min_box_to_target_distance , margin = 2 * box_size ) hand_to_target_distance = physics . site_distance ( 'grasp' , 'target' ) hand_is_far = rewards . tolerance ( hand_to_target_distance , bounds = ( .1 , float ( 'inf' ) ) , margin = _CLOSE ) return box_is_close * hand_is_far