Stride Reference Manual
1.0
|
#include <LocalSimulatorAdapter.h>
Public Member Functions | |
LocalSimulatorAdapter (shared_ptr< Simulator > sim) | |
The constructor, this adapter will control one simulator. More... | |
virtual string | getName () const override |
virtual future< SimulatorStatus > | timeStep () override |
virtual void | welcomeHomeTravellers (const pair< vector< uint >, vector< Health >> &travellers) override |
virtual void | hostForeignTravellers (const vector< stride::Simulator::TravellerType > &travellers, uint days, const string &destination_district, const string &destination_facility) override |
Receive travellers travellers: the travellers this simulator has to host. More... | |
virtual void | sendNewTravellers (uint amount, uint days, const string &destination_sim_id, const string &destination_district, const string &destination_facility) override |
Send travellers to the destination region Returns a vector of indices (in the Population of the simulator), these indices are from the people that were sent (debugging purposes) amount: the amount of travellers to be sent days: how long these people will be gone destination_sim: a way of communicating with the destination simulator, this must contain all data to achieve communication destination_district: The name of the city in which the airport / facility is located e.g. More... | |
virtual void | returnForeignTravellers () override |
Return foreign people that would return today, signals the Simulator to return today's travellers. More... | |
const Simulator & | getSimulator () const |
![]() | |
virtual | ~AsyncSimulator () |
Private Member Functions | |
virtual void | sendNewTravellers (const vector< Simulator::TravellerType > &travellers, uint days, const string &destination_sim_id, const string &destination_district, const string &destination_facility) override |
Send travellers to the destination region This function is used by the Simulator to give the signal to send people. More... | |
virtual void | returnForeignTravellers (const pair< vector< uint >, vector< Health >> &travellers, const string &home_sim_id) override |
Send foreign travellers to the original region This function is used by the Simulator to give the signal to send people. More... | |
Private Attributes | |
Simulator * | m_sim = nullptr |
Friends | |
class | Simulator |
class | Coordinator |
template<ClusterType clusterType> | |
class | ClusterCalculator |
Definition at line 30 of file LocalSimulatorAdapter.h.
LocalSimulatorAdapter::LocalSimulatorAdapter | ( | shared_ptr< Simulator > | sim | ) |
The constructor, this adapter will control one simulator.
Definition at line 13 of file LocalSimulatorAdapter.cpp.
|
inlineoverridevirtual |
Implements stride::AsyncSimulator.
Definition at line 35 of file LocalSimulatorAdapter.h.
|
overridevirtual |
Implements stride::AsyncSimulator.
Definition at line 16 of file LocalSimulatorAdapter.cpp.
References m_sim, and stride::Simulator::timeStep().
|
overridevirtual |
Implements stride::AsyncSimulator.
Definition at line 22 of file LocalSimulatorAdapter.cpp.
References m_sim, and stride::Simulator::welcomeHomeTravellers().
|
overridevirtual |
Receive travellers travellers: the travellers this simulator has to host.
Contains the data needed to identify a person in the home simulator days: The amount of days the travellers will stay in this simulator destination_district: The name of the city in which the airport / facility is located e.g. "Antwerp" destination_facility: The name of the facility / airport e.g. "ANR" TODO: future return value?
Implements stride::AsyncSimulator.
Definition at line 26 of file LocalSimulatorAdapter.cpp.
References stride::Simulator::hostForeignTravellers(), and m_sim.
|
overridevirtual |
Send travellers to the destination region Returns a vector of indices (in the Population of the simulator), these indices are from the people that were sent (debugging purposes) amount: the amount of travellers to be sent days: how long these people will be gone destination_sim: a way of communicating with the destination simulator, this must contain all data to achieve communication destination_district: The name of the city in which the airport / facility is located e.g.
"Antwerp" destination_facility: The name of the facility / airport e.g. "ANR"
Implements stride::AsyncSimulator.
Definition at line 32 of file LocalSimulatorAdapter.cpp.
References m_sim, and stride::Simulator::sendNewTravellers().
|
overridevirtual |
Return foreign people that would return today, signals the Simulator to return today's travellers.
Implements stride::AsyncSimulator.
Definition at line 37 of file LocalSimulatorAdapter.cpp.
References m_sim, and stride::Simulator::returnForeignTravellers().
|
inline |
Definition at line 63 of file LocalSimulatorAdapter.h.
|
overrideprivatevirtual |
Send travellers to the destination region This function is used by the Simulator to give the signal to send people.
Implements stride::AsyncSimulator.
Definition at line 41 of file LocalSimulatorAdapter.cpp.
|
overrideprivatevirtual |
Send foreign travellers to the original region This function is used by the Simulator to give the signal to send people.
Implements stride::AsyncSimulator.
Definition at line 48 of file LocalSimulatorAdapter.cpp.
|
friend |
Definition at line 79 of file LocalSimulatorAdapter.h.
|
friend |
Definition at line 81 of file LocalSimulatorAdapter.h.
|
friend |
Definition at line 84 of file LocalSimulatorAdapter.h.
|
private |
Definition at line 66 of file LocalSimulatorAdapter.h.
Referenced by hostForeignTravellers(), returnForeignTravellers(), sendNewTravellers(), timeStep(), and welcomeHomeTravellers().