def DoAction(self, a, x):
        self.steps = self.steps + 1
        torque = self.action_list[a]

        # Parameters for simulation
        theta1, theta2, theta1_dot, theta2_dot = x

        for _ in range(4):
            d1 = self.m1 * self.lc1Square + self.m2 * (self.l1Square + self.lc2Square + 2 * self.l1 * self.lc2 * cos(theta2)) + self.I1 + self.I2
            d2 = self.m2 * (self.lc2Square + self.l1 * self.lc2 * cos(theta2)) + self.I2

            phi2 = self.m2 * self.lc2 * self.g * cos(theta1 + theta2 - pi / 2.0)
            phi1 = -self.m2 * self.l1 * self.lc2 * theta2_dot * sin(theta2) * (theta2_dot - 2 * theta1_dot) + (self.m1 * self.lc1 + self.m2 * self.l1) * self.g * cos(theta1 - (pi / 2.0)) + phi2

            accel2 = (torque + phi1 * (d2 / d1) - self.m2 * self.l1 * self.lc2 * theta1_dot * theta1_dot * sin(theta2) - phi2)
            accel2 = accel2 / (self.m2 * self.lc2Square + self.I2 - (d2 * d2 / d1))
            accel1 = -(d2 * accel2 + phi1) / d1

            theta1_dot = theta1_dot + accel1 * self.delta_t

            if theta1_dot < -self.maxSpeed1:
                theta1_dot = -self.maxSpeed1

            if theta1_dot > self.maxSpeed1:
                theta1_dot = self.maxSpeed1

            theta1 = theta1 + theta1_dot * self.delta_t
            theta2_dot = theta2_dot + accel2 * self.delta_t

            if theta2_dot < -self.maxSpeed2:
                theta2_dot = -self.maxSpeed2

            if theta2_dot > self.maxSpeed2:
                theta2_dot = self.maxSpeed2

            theta2 = theta2 + theta2_dot * self.delta_t

        # bounded angles?
        #if theta1 < -pi:
        #    theta1 = -pi
        #elif theta1 > pi:
        #    theta1 = pi
        if -pi < theta1:
            theta1 += 2*pi
        elif theta1 > pi:
            theta1 -= 2*pi
        if theta2 < -pi:
            theta2 += 2*pi
        elif theta2 > pi:
            theta2 -= 2*pi

        xp = [theta1, theta2, theta1_dot, theta2_dot]

        return xp
dataset/ETHPy150Open pybrain/pybrain/pybrain/rl/environments/classic/acrobot.py/AcrobotTask.DoAction/swapped operands of `<`