(self, physics)
Returns a reward applicable to the performed task.
Returns a reward applicable to the performed task.
Returns a reward applicable to the performed task .
def get_reward(self, physics):
    """Returns a reward applicable to the performed task."""
    standing = rewards.tolerance(physics.height(), (_STAND_HEIGHT, 2))
    if self._hopping:
      hopping = rewards.tolerance(physics.speed(),
                                  bounds=(_HOP_SPEED, float('inf')),
                                  margin=_HOP_SPEED/2,
                                  value_at_margin=0.5,
                                  sigmoid='linear')
      return standing * hopping
    else:
      small_control = rewards.tolerance(physics.control(),
                                        margin=1, value_at_margin=0,
                                        sigmoid='quadratic').mean()
      small_control = (small_control + 4) / 5
      return standing * small_control
def get_reward ( self , physics ) : standing = rewards . tolerance ( physics . height ( ) , ( _STAND_HEIGHT , 2 ) ) if self . _hopping : hopping = rewards . tolerance ( physics . speed ( ) , bounds = ( _HOP_SPEED , float ( 'inf' ) ) , margin = _HOP_SPEED / 2 , value_at_margin = 0.5 , sigmoid = 'linear' ) return standing * hopping else : small_control = rewards . tolerance ( physics . control ( ) , margin = 1 , value_at_margin = 0 , sigmoid = 'quadratic' ) . mean ( ) small_control = ( small_control + 4 ) / 5 return standing * small_control