3 #include "DroneDecorator.h"
4 #include "SimulationModel.h"
23 unsigned currentCharge_,
unsigned lowCharge_,
24 double decreaseTime_);
116 void arriveAtRechargeStation();
124 void lookAheadForRechargeStation();
132 double batteryNeededForDistance(
double distance);
134 unsigned currentCharge;
136 double movingDecreaseTime;
137 double timeElapsed = 0;
138 bool ismoving =
false;
139 bool notCharging =
false;
140 bool droneReady =
false;
141 double chargingRate = 2;
144 bool goingToPackage =
false;
145 bool goingToFinalDestination =
false;
146 double malfunctionedStationTime = 0;
Decorator class for adding battery to a drone Responsible for charging, discharging,...
Definition: DroneBatteryDecorator.h:12
DroneBatteryDecorator(Drone *drone, unsigned maxCharge_, unsigned currentCharge_, unsigned lowCharge_, double decreaseTime_)
Construct a new Drone Battery Decorator object.
Vector3 findNearestRechargeStation()
Find the nearest recharge station.
void headToRechargeStation(Vector3 station)
Head to a given recharge station.
void charge(double dt)
Charge the drone, add 2% charge to the drone if the drone is not at max charge. Charging speed is aff...
bool isAtRechargeStation()
Determine if the drone is at the recharge station.
void decreaseCharge(double dt)
Decrease the charge of the drone, add 2% charge to the drone.
void addToFunctionalDroneList()
If the drone is max charged, add it to the functional drone list. This tells the recharge drone that ...
virtual ~DroneBatteryDecorator()
Destroy the Drone Battery Decorator object.
void removeFromFunctionalDroneList()
If the drone is dead, remove it from the functional drone list to tell the recharge drone that this d...
void update(double dt)
Update the state of the drone, like position, charge, etc.
Vector3 findNearestRechargeStation(Vector3 startPosition)
Find the nearest recharge station from a given position.
void addToDeadDronesList()
If the drone is dead, add it to the dead drones list in the simulation model and wait for recharge dr...
Base class decorator for Drone that implements IEntityDecorator Drone template, delegates all work to...
Definition: DroneDecorator.h:13
Represents a drone in a physical system. Drones move using euler integration based on a specified vel...
Definition: Drone.h:19
Strategy interface.
Definition: IStrategy.h:11
a simple class used for vector math, most function are self explanatory
Definition: vector3.h:12