(self, physics)
return 1 - (state_cost + control_l2_norm * self._control_cost_coef)
Returns a quadratic state and control reward.
Returns a quadratic state and control reward.
Returns a quadratic state and control reward .
def get_reward(self, physics):
    """Returns a quadratic state and control reward."""
    position = physics.position()
    state_cost = 0.5 * np.dot(position, position)
    control_signal = physics.control()
    control_l2_norm = 0.5 * np.dot(control_signal, control_signal)
    return 1 - (state_cost + control_l2_norm * self._control_cost_coef)
def get_reward ( self , physics ) : position = physics . position ( ) state_cost = 0.5 * np . dot ( position , position ) control_signal = physics . control ( ) control_l2_norm = 0.5 * np . dot ( control_signal , control_signal ) return 1 - ( state_cost + control_l2_norm * self . _control_cost_coef )