A representation of a carrier An abstract base class for delivery transportation clases like Drone or Robot. Robot and Drone inherited from Carrier.
More...
|
bool | BatteryDead () |
| This checks if the carrier is out of battery. More...
|
|
bool | BatteryFull () |
| This function checks if the battery is full. More...
|
|
float | GetBattery () |
| This returns the time in secs left in the carrier's battery.
|
|
float | GetMaxBattery () |
| This returns the battery maximum capacity.
|
|
bool | Charging (float) |
| This function is used to charge the battery of the carrier for a certain amount of time in seconds. More...
|
|
bool | HavePackage () |
| This checks if the carrier is already linked to a package. More...
|
|
Package * | GetPackage () |
| This returns a Package pointer to the package that the carrier is linking to, and returns NULL if the carrier is not linking to any package.
|
|
bool | AddPackage (Package *arg) |
| This links a package object to the carrier if the carrier is not already linking to another package (carrier can only carry one package at a time) More...
|
|
Package * | DropPackage () |
| This releases the link of the package from the carrier, making the package pointer of the carrier NULL, and return a pointer to the just dropped/delivered package. More...
|
|
void | SetPosition (std::vector< float > v) |
| This function uses to set the new position of the carrier. However, carrier only moves in simulation if its dynamic attribute is set to true. More...
|
|
void | SetSpeed (float) |
| This sets the speed of the carrier. Change the speed of the carrier if the argument is a non-negative float number. More...
|
|
float | GetSpeed () |
| return the current speed of the carrier
|
|
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 GetPath() function from IGraph class. More...
|
|
std::vector< float > | NextPosition () |
| This function returns the next position in std::vector<float> in the queue that the carrier needs to move to.
|
|
void | PopPosition () |
| This function pops the first element/position in the position queue of the carrier.
|
|
void | GetStatus () |
| Overwritten GetStatus from ASubject. This function creates the arguments required by Notify function and makes call to Notify function. This function should be called when path is added to the carrier and when the carrier becomes idle. More...
|
|
RouteStrategy * | GetRouteStrategy () |
| return the Route Strategy that the carrier uses, such as Smart Route, Beeline, or Parabolic Route
|
|
bool | IsCurrentlyCharging () |
| This function checks if the carrier battery is currently charging. More...
|
|
Battery * | GetBatteryObj () |
| This function will return the Battery object. More...
|
|
void | SetChargingStatus (bool b) |
| This function sets the carrier battery status. More...
|
|
void | SetDroneStatusWhenBatteryDies (std::string status) |
| This function sets the battery status when the battery dies (alive, dead on ground, or dead in the air) More...
|
|
std::string | GetDroneStatusWhenBatteryDies () |
| This function gets the battery status (alive, dead on ground, or dead in the air) More...
|
|
void | GoDownToGround () |
| This function sends the carrier down (if on the air) to the ground when the battery is dead. If the carrier is currently delivering a package, it will drop its package for other available carriers to come and pick it up.
|
|
void | Update (float dt) |
| This is an inherited method from EntityBase to use for DeliverySimulation. This updates the position of the carrier on the simulation if the position changes and its dynamic is set to true. In addition, this function also checks if the carrier is in within distance with the package to pick it up, or within distance with the customer to drop off the package.
|
|
const picojson::object & | GetDetails () |
|
int | GetId () const |
|
const std::string & | GetName () |
|
const std::vector< float > & | GetPosition () const |
|
const std::vector< float > & | GetDirection () const |
|
float | GetRadius () const |
|
int | GetVersion () const |
|
bool | IsDynamic () const |
|
float | DistanceBetween (IEntity *another) |
|
bool | IsWithin (IEntity *another) |
|
std::string | GetType () |
|
virtual | ~IEntity () |
| The destructor.
|
|
void | Attach (entity_project::IEntityObserver *observer) |
| Adds an observer to the list of observers for this subject. More...
|
|
void | Detach (entity_project::IEntityObserver *observer) |
| Deletes an observer from the list of observers for this subject. More...
|
|
std::vector< entity_project::IEntityObserver * > | GetList () |
| Getter function for the list of observers (mostly used in testing) More...
|
|
void | Notify (picojson::value &event, const entity_project::IEntity &entity) |
| Sends out Notification to the observer watching this subject. More...
|
|
A representation of a carrier An abstract base class for delivery transportation clases like Drone or Robot. Robot and Drone inherited from Carrier.