Stride Reference Manual  1.0
stride::LocalSimulatorAdapter Class Reference

#include <LocalSimulatorAdapter.h>

Inheritance diagram for stride::LocalSimulatorAdapter:
Inheritance graph
Collaboration diagram for stride::LocalSimulatorAdapter:
Collaboration graph

Public Member Functions

 LocalSimulatorAdapter (shared_ptr< Simulator > sim)
 The constructor, this adapter will control one simulator. More...
 
virtual string getName () const override
 
virtual future< SimulatorStatustimeStep () 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 SimulatorgetSimulator () const
 
- Public Member Functions inherited from stride::AsyncSimulator
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

Simulatorm_sim = nullptr
 

Friends

class Simulator
 
class Coordinator
 
template<ClusterType clusterType>
class ClusterCalculator
 

Detailed Description

Definition at line 30 of file LocalSimulatorAdapter.h.

Constructor & Destructor Documentation

LocalSimulatorAdapter::LocalSimulatorAdapter ( shared_ptr< Simulator sim)

The constructor, this adapter will control one simulator.

Definition at line 13 of file LocalSimulatorAdapter.cpp.

Member Function Documentation

virtual string stride::LocalSimulatorAdapter::getName ( ) const
inlineoverridevirtual

Implements stride::AsyncSimulator.

Definition at line 35 of file LocalSimulatorAdapter.h.

future< SimulatorStatus > LocalSimulatorAdapter::timeStep ( )
overridevirtual

Implements stride::AsyncSimulator.

Definition at line 16 of file LocalSimulatorAdapter.cpp.

References m_sim, and stride::Simulator::timeStep().

void LocalSimulatorAdapter::welcomeHomeTravellers ( const pair< vector< uint >, vector< Health >> &  travellers)
overridevirtual
void LocalSimulatorAdapter::hostForeignTravellers ( const vector< stride::Simulator::TravellerType > &  travellers,
uint  days,
const string &  destination_district,
const string &  destination_facility 
)
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.

void LocalSimulatorAdapter::sendNewTravellers ( uint  amount,
uint  days,
const string &  destination_sim_id,
const string &  destination_district,
const string &  destination_facility 
)
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().

void LocalSimulatorAdapter::returnForeignTravellers ( )
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().

const Simulator& stride::LocalSimulatorAdapter::getSimulator ( ) const
inline

Definition at line 63 of file LocalSimulatorAdapter.h.

void LocalSimulatorAdapter::sendNewTravellers ( const vector< Simulator::TravellerType > &  travellers,
uint  days,
const string &  destination_sim_id,
const string &  destination_district,
const string &  destination_facility 
)
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.

void LocalSimulatorAdapter::returnForeignTravellers ( const pair< vector< uint >, vector< Health >> &  travellers,
const string &  home_sim_id 
)
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.

Friends And Related Function Documentation

friend class Simulator
friend

Definition at line 79 of file LocalSimulatorAdapter.h.

friend class Coordinator
friend

Definition at line 81 of file LocalSimulatorAdapter.h.

template<ClusterType clusterType>
friend class ClusterCalculator
friend

Definition at line 84 of file LocalSimulatorAdapter.h.

Member Data Documentation

Simulator* stride::LocalSimulatorAdapter::m_sim = nullptr
private

The documentation for this class was generated from the following files: