Class SimulationModel handling the transit simulation. it can communicate with the controller.
More...
#include <SimulationModel.h>
Class SimulationModel handling the transit simulation. it can communicate with the controller.
Simulation Model handling the transit simulation. The model can communicate with the controller.
◆ SimulationModel()
SimulationModel::SimulationModel |
( |
IController & |
controller | ) |
|
Default constructor that create the SimulationModel object.
- Parameters
-
controller | The specified Controller to be initialized in the model |
◆ addRechargeStation()
void SimulationModel::addRechargeStation |
( |
Vector3 |
station | ) |
|
add a recharge station position to the list mainly used by recharge drones when they arrive near the dead drone
- Parameters
-
station | position of the recharge station to be added |
◆ createEntity()
Creates a new simulation entity.
- Parameters
-
entity | Type JsonObject contain the entity's reference to decide which entity to create |
◆ getGraph()
Returns the graph of the map.
- Returns
- Graph* graph pointer
◆ getRechargeStations()
std::vector<Vector3> SimulationModel::getRechargeStations |
( |
| ) |
const |
Get all the Recharge Station positions.
- Returns
- std::vector<Vector3> a vector of recharge station positions
◆ notify()
void SimulationModel::notify |
( |
const std::string & |
message | ) |
const |
|
virtual |
Notifies observer with specific message.
- Parameters
-
message | The specific message |
Implements IObserver.
◆ removeEntity()
void SimulationModel::removeEntity |
( |
int |
id | ) |
|
Removes entity with given ID from the simulation.
- Parameters
-
id | of the entity to be removed |
◆ removeFromSim()
void SimulationModel::removeFromSim |
( |
int |
id | ) |
|
|
protected |
Removes the model from the simulation.
- Parameters
-
id | The id of the model to be removed |
◆ removeRechargeStation()
void SimulationModel::removeRechargeStation |
( |
Vector3 |
station | ) |
|
remove a recharge station position from the list mainly used by recharge drones when they leave after dead drone is fully charged
- Parameters
-
station | position of the recharge station to be removed |
◆ scheduleTrip()
void SimulationModel::scheduleTrip |
( |
const JsonObject & |
details | ) |
|
Schedule a trip for an object in the scene.
- Parameters
-
detail | Type JsonObject contain the entity's reference to schedule the detail of the trip being scheduled |
◆ setGraph()
◆ stop()
void SimulationModel::stop |
( |
| ) |
|
Stops the simulation.
- Returns
- Void
◆ update()
void SimulationModel::update |
( |
double |
dt | ) |
|
Update the simulation.
- Parameters
-
dt | Type double comodel.reRouteClose();ntain the time since update was last called. |
The documentation for this class was generated from the following file: