20 #include "route_strategy.h" 122 void SetRoute(std::vector<vector<float>>);
202 std::vector<std::vector<float>> route;
203 std::string droneStatusWhenBatteryDies =
"not dead yet";
204 bool ChargingStatus =
false;
float GetMaxBattery()
This returns the battery maximum capacity.
Definition: carrier.cc:19
A representation of a Package, inherited from EntityBase It stores the Package's name, ID, version, position, direction, and dynamic mode.
Definition: package.h:27
void GetStatus()
Overwritten GetStatus from ASubject. This function creates the arguments required by Notify function ...
Definition: carrier.cc:98
Battery * GetBatteryObj()
This function will return the Battery object.
Definition: carrier.cc:178
bool Charging(float)
This function is used to charge the battery of the carrier for a certain amount of time in seconds...
Definition: carrier.cc:23
std::string GetDroneStatusWhenBatteryDies()
This function gets the battery status (alive, dead on ground, or dead in the air) ...
Definition: carrier.cc:126
bool HavePackage()
This checks if the carrier is already linked to a package.
Definition: carrier.cc:27
Package * DropPackage()
This releases the link of the package from the carrier, making the package pointer of the carrier NUL...
Definition: carrier.cc:49
void SetDroneStatusWhenBatteryDies(std::string status)
This function sets the battery status when the battery dies (alive, dead on ground, or dead in the air)
Definition: carrier.cc:122
Definition: asubject.cc:3
Package * GetPackage()
This returns a Package pointer to the package that the carrier is linking to, and returns NULL if the...
Definition: carrier.cc:35
float GetBattery()
This returns the time in secs left in the carrier's battery.
Definition: carrier.cc:16
bool AddPackage(Package *arg)
This links a package object to the carrier if the carrier is not already linking to another package (...
Definition: carrier.cc:39
void Update(float dt)
This is an inherited method from EntityBase to use for DeliverySimulation. This updates the position ...
Definition: carrier.cc:182
bool BatteryFull()
This function checks if the battery is full.
Definition: carrier.cc:13
void SetPosition(std::vector< float > v)
This function uses to set the new position of the carrier. However, carrier only moves in simulation ...
Definition: carrier.cc:58
void SetChargingStatus(bool b)
This function sets the carrier battery status.
Definition: carrier.cc:118
void SetRoute(std::vector< vector< float >>)
This function adds a full route to route attribute of the carrier This is useful when use for the Get...
Definition: carrier.cc:73
The base class for creating entities.
Definition: entity_base.h:27
A representation of a carrier An abstract base class for delivery transportation clases like Drone or...
Definition: carrier.h:31
float GetSpeed()
return the current speed of the carrier
Definition: carrier.cc:69
bool IsCurrentlyCharging()
This function checks if the carrier battery is currently charging.
Definition: carrier.cc:114
std::vector< float > NextPosition()
This function returns the next position in std::vector<float> in the queue that the carrier needs to ...
Definition: carrier.cc:78
RouteStrategy * GetRouteStrategy()
return the Route Strategy that the carrier uses, such as Smart Route, Beeline, or Parabolic Route ...
Definition: carrier.cc:110
void GoDownToGround()
This function sends the carrier down (if on the air) to the ground when the battery is dead...
Definition: carrier.cc:130
This is the Route Strategy class where we can use the interface to decide which type of route behavio...
Definition: route_strategy.h:24
void PopPosition()
This function pops the first element/position in the position queue of the carrier.
Definition: carrier.cc:89
void SetSpeed(float)
This sets the speed of the carrier. Change the speed of the carrier if the argument is a non-negative...
Definition: carrier.cc:63
This is the Abstract Subject class from which our subjects will inherit Implements the Observer/subje...
Definition: asubject.h:22
bool BatteryDead()
This checks if the carrier is out of battery.
Definition: carrier.cc:10