(self, physics)
return (7*in_target + is_upright) / 8
Returns a smooth reward.
Returns a smooth reward.
Returns a smooth reward .
def get_reward(self, physics):
    """Returns a smooth reward."""
    radii = physics.named.model.geom_size[['mouth', 'target'], 0].sum()
    in_target = rewards.tolerance(np.linalg.norm(physics.mouth_to_target()),
                                  bounds=(0, radii), margin=2*radii)
    is_upright = 0.5 * (physics.upright() + 1)
    return (7*in_target + is_upright) / 8
def get_reward ( self , physics ) : radii = physics . named . model . geom_size [ [ 'mouth' , 'target' ] , 0 ] . sum ( ) in_target = rewards . tolerance ( np . linalg . norm ( physics . mouth_to_target ( ) ) , bounds = ( 0 , radii ) , margin = 2 * radii ) is_upright = 0.5 * ( physics . upright ( ) + 1 ) return ( 7 * in_target + is_upright ) / 8