Decorator class for adding battery to a drone Responsible for charging, discharging, and finding recharge stations.
More...
|
| DroneBatteryDecorator (Drone *drone, unsigned maxCharge_, unsigned currentCharge_, unsigned lowCharge_, double decreaseTime_) |
| Construct a new Drone Battery Decorator object. More...
|
|
virtual | ~DroneBatteryDecorator () |
| Destroy the Drone Battery Decorator object.
|
|
void | decreaseCharge (double dt) |
| Decrease the charge of the drone, add 2% charge to the drone. More...
|
|
void | charge (double dt) |
| Charge the drone, add 2% charge to the drone if the drone is not at max charge. Charging speed is affected by charging rate. More...
|
|
Vector3 | findNearestRechargeStation () |
| Find the nearest recharge station. More...
|
|
Vector3 | findNearestRechargeStation (Vector3 startPosition) |
| Find the nearest recharge station from a given position. More...
|
|
void | update (double dt) |
| Update the state of the drone, like position, charge, etc. More...
|
|
bool | isAtRechargeStation () |
| Determine if the drone is at the recharge station. More...
|
|
void | headToRechargeStation (Vector3 station) |
| Head to a given recharge station. More...
|
|
void | addToDeadDronesList () |
| If the drone is dead, add it to the dead drones list in the simulation model and wait for recharge drone to charge it. It will be removed from the list by the recharge drone.
|
|
void | addToFunctionalDroneList () |
| If the drone is max charged, add it to the functional drone list. This tells the recharge drone that this drone no longer needs charging.
|
|
void | removeFromFunctionalDroneList () |
| If the drone is dead, remove it from the functional drone list to tell the recharge drone that this drone needs charging.
|
|
| DroneDecorator (Drone *d) |
| Constructor for DroneDecorator, calls IEntityDecorator constructor. More...
|
|
virtual | ~DroneDecorator () |
| Destructor.
|
|
virtual void | getNextDelivery () const |
| Gets the next delivery in the scheduler.
|
|
virtual bool | getPickedUp () const |
| Gets the pickedUp status of the Drone object.
|
|
virtual Package * | getPackage () const |
| Gets pointer to the Drone's package.
|
|
virtual IStrategy * | getFinalStrategy () const |
| Returns pointer to toFinalDestination.
|
|
virtual void | setToPackage (IStrategy *s) const |
| Sets the Drone's toPackage strategy to a new one. More...
|
|
virtual SimulationModel * | getModel () const |
| Get the Model object. More...
|
|
IStrategy * | getToFinalDestinationStrategy () |
| Get the To Final Destination Strategy object. More...
|
|
IStrategy * | getToPackageStrategy () |
| Get the To Package Strategy object. More...
|
|
| IEntityDecorator (T *e) |
| Constructor for IEntityDecorator. More...
|
|
virtual | ~IEntityDecorator () |
| Destructor.
|
|
virtual void | linkModel (SimulationModel *model) |
| Links this entity to a simulation model, giving it access to the model's public variables and functions. More...
|
|
virtual int | getId () const |
| Gets the ID of the entity. More...
|
|
virtual Vector3 | getPosition () const |
| Gets the position of the entity. More...
|
|
virtual Vector3 | getDirection () const |
| Gets the direction of the entity. More...
|
|
virtual const JsonObject & | getDetails () const |
| Gets the details of the entity. More...
|
|
virtual std::string | getColor () const |
| Gets the color of the entity. More...
|
|
virtual std::string | getName () const |
| Gets the name of the entity. More...
|
|
virtual double | getSpeed () const |
| Gets the speed of the entity. More...
|
|
virtual void | setPosition (Vector3 pos_) |
| Sets the position of the entity. More...
|
|
virtual void | setDirection (Vector3 dir_) |
| Set the direction of the entity. More...
|
|
virtual void | setColor (std::string col_) |
| Sets the color of the entity. More...
|
|
virtual void | rotate (double angle) |
| Rotate the entity around y axis. More...
|
|
Decorator class for adding battery to a drone Responsible for charging, discharging, and finding recharge stations.