(self, physics)
return max(bringing, grasping/3)
Returns a reward for bringing the peg prop to the target.
Returns a reward for bringing the peg prop to the target.
Returns a reward for bringing the peg prop to the target .
def _peg_reward(self, physics):
    """Returns a reward for bringing the peg prop to the target."""
    grasp = self._is_close(physics.site_distance('peg_grasp', 'grasp'))
    pinch = self._is_close(physics.site_distance('peg_pinch', 'pinch'))
    grasping = (grasp + pinch) / 2
    bring = self._is_close(physics.site_distance('peg', 'target_peg'))
    bring_tip = self._is_close(physics.site_distance('target_peg_tip',
                                                     'peg_tip'))
    bringing = (bring + bring_tip) / 2
    return max(bringing, grasping/3)
def _peg_reward ( self , physics ) : grasp = self . _is_close ( physics . site_distance ( 'peg_grasp' , 'grasp' ) ) pinch = self . _is_close ( physics . site_distance ( 'peg_pinch' , 'pinch' ) ) grasping = ( grasp + pinch ) / 2 bring = self . _is_close ( physics . site_distance ( 'peg' , 'target_peg' ) ) bring_tip = self . _is_close ( physics . site_distance ( 'target_peg_tip' , 'peg_tip' ) ) bringing = ( bring + bring_tip ) / 2 return max ( bringing , grasping / 3 )