Skip to content

Charging_operation_model

smartfm edited this page Dec 9, 2019 · 1 revision

ChargingParam

There are 3 main charging states, PENDING_CHARGE, CHARGING and NOT_CHARGING within the ChargingParam maintain by the AV drivers. NOT_CHARGING indicates that the driver is currently not waiting for charge nor is charging. PENDING_CHARGE indicates that the driver is waiting for charge. CHARGING indicates the driver already in the charging station, it may be charging or waiting for its turn to charge. Within the ChargingParam, it maintains the variable known as electricLevel which indicates the exact electric level of a AV at any point of time. This electricLevel shall be compared, consumed or charged.

ChargingStationAgent

The main role of the ChargingStationAgent is to charge the individual driver and release them when done. There are 3 main data structures, waitingQueue, fastCharger, normalCharger, are responsible for handling the AV drivers and each AV driver may only be at one of the structures at one time. The waitingQueue maintains the drivers that enter the charging station and waiting for their turn to be assigned for charging. The fastCharger and normalCharger are responsible for maintaining and charging the drivers. There are 2 main operations that will happen in each frame tick for every ChargingStationAgent, updateElectricLevel and updateChargingSlots. In updateElectricLevel operation, it will iterate through all the drivers in the fastCharger and the normalCharger to update their individual energy level. It will also check the individual energy level and if the energy level is greater than the energy capacity * percentDone(defined in the xml file), the driver shall be removed. In updateChargingSlots operation, it will attempt to insert as many driver from the waitingQueue into first the fastCharger before normalCharger. It both the charger are full, it will wait for the next frame tick to try again

SMSVehicleChargingTree

This is a data structure that maintain a collection of the SMSVehicleCharging, which is a derivative of SMSVehicleParking. It also allows searching for the nearest SMSVehicleCharging based on the the x y location provided.

AmodController

AmodController is responsible for assigning drivers with schedules from the requests in every frame tick. It will check if the vehicles contains ChargingParam, which is an indication that they are AV. The charging state will be extracted for comparison. If PENDING_CHARGE or CHARGING, that particular AV will not be able to be assigned with a schedule. When it is NOT_CHARGING, it will then be given the right to be match with requests. Moreover, the electricLevel parameter will be extracted from the ChargingParam to decide if the vehicle has enough charge to complete the schedules. If the electricLevel is found to be below threshold, its charging state will be alter to PENDING_CHARGE, which would allow the Rebalancer to assign them with the nearest charging station in the next frame tick

Rebalancer

The rebalancer main role is to decide if a vehicle is going for parking or cruising. With the addition of Electric Charging Model, now it will have to decide if a vehicle is going for charging as well. It will extract the ChargingParam if they exists with the driver and it will check its chargingState. If PENDING_CHARGE, it will assign them to the nearest charging station, else if NOT_CHARGING, the electricLevel will be checked and if it falls below threshold, it will be change the chargingState to PENDING_CHARGE and it will be send to the nearest charging station. Else it will them attempt to assign them to nearest parking or crusing.

OnCallDriverMovement

OnCallDriverMovement defines the movement of a particular onCallDriver. The movement between the parking and charging are similar except that for charging the driver will be assigned to ChargingStationAgent whereas for parking they will be assigned to the ParkingAgent. The ChargingStationAgent will check against its chargingState to ensure that it is indeed PENDING_CHARGE before allow the driver to wait at the waitingQueue.

Clone this wiki locally