def _apply_rl_actions(self, actions):
    'See class definition.'
    acceleration = actions[::2]
    direction = actions[1::2]
    for (i, veh_id) in enumerate(self.rl_veh):
        if (self.time_counter <= (self.env_params.additional_params['lane_change_duration'] + self.k.vehicle.get_last_lc(veh_id))):
            direction[i] = 0
        (x, y) = self.k.vehicle.kernel_api.vehicle.getPosition(veh_id)
        print(x, y)
        print('edgeID', self.k.vehicle.get_edge(veh_id))
        print('lane', self.k.vehicle.get_lane(veh_id))
        self.k.vehicle.kernel_api.vehicle.moveToXY(vehID=veh_id, edgeID='highway_1', lane=1, x=(x + acceleration[i]), y=(y + direction[i]), keepRoute=2)
    for x in np.nditer(direction, op_flags=['readwrite']):
        if (x > 0.7):
            x[...] = 1
        elif (x < (- 0.7)):
            x[...] = (- 1)
        else:
            x[...] = 0
See class definition.
def _apply_rl_actions(self, actions):
    
    acceleration = actions[::2]
    direction = actions[1::2]
    for (i, veh_id) in enumerate(self.rl_veh):
        if (self.time_counter <= (self.env_params.additional_params['lane_change_duration'] + self.k.vehicle.get_last_lc(veh_id))):
            direction[i] = 0
        (x, y) = self.k.vehicle.kernel_api.vehicle.getPosition(veh_id)
        print(x, y)
        print('edgeID', self.k.vehicle.get_edge(veh_id))
        print('lane', self.k.vehicle.get_lane(veh_id))
        self.k.vehicle.kernel_api.vehicle.moveToXY(vehID=veh_id, edgeID='highway_1', lane=1, x=(x + acceleration[i]), y=(y + direction[i]), keepRoute=2)
    for x in np.nditer(direction, op_flags=['readwrite']):
        if (x > 0.7):
            x[...] = 1
        elif (x < (- 0.7)):
            x[...] = (- 1)
        else:
            x[...] = 0