def getReward(self):
        
        r_factor = 0.0001
        x = np.abs(self.env.getTilt())
        PrevTilt = np.abs(self.env.TempTilt)
        if x>LinearFATileCoding3456BalanceTask.max_tilt:
            R = -15.0
        else:
            if x<1.0/3*LinearFATileCoding3456BalanceTask.max_tilt:
                R = 5.0
            elif 1.0/3*LinearFATileCoding3456BalanceTask.max_tilt<=x and x<=2.0/3*LinearFATileCoding3456BalanceTask.max_tilt:
                R = 1.0
            elif 2.0/3*LinearFATileCoding3456BalanceTask.max_tilt<=x and x<=LinearFATileCoding3456BalanceTask.max_tilt:
                R = -5.0
        if PrevTilt>x:
            R += 3000.0*(PrevTilt-x)
            if PrevTilt>2.0/3*LinearFATileCoding3456BalanceTask.max_tilt:
                R *= 2
        if PrevTilt<x:
            R += 3000.0*(PrevTilt-x)
        temp = self.calc_dist_to_goal()
        heading = self.calc_angle_to_goal()
        if (temp < 1e-3):
            R *= 10.0
        else:
            R -= 3000*np.abs(heading)
        return R
dataset/ETHPy150Open chrisdembia/agent-bicycle/randlov1998/tasks_gotorewards.py/LinearFATileCoding3456GoToTaskReward1.getReward/original