Simulation Class Reference

CPP API: mio::isecir::Simulation Class Reference
mio::isecir::Simulation Class Reference

run the simulation in discrete steps and report results. More...

#include <simulation.h>

Public Member Functions

void advance (ScalarType tmax)
 Run the simulation from the current time to tmax. More...
 
ScalarType get_dt ()
 get the time step of the simulation. More...
 
Modelget_model ()
 returns the simulation model used in simulation. More...
 
const Modelget_model () const
 returns the simulation model used in simulation. More...
 
TimeSeries< ScalarTypeget_result ()
 Get the result of the simulation. More...
 
const TimeSeries< ScalarType > & get_result () const
 Get the result of the simulation. More...
 
TimeSeries< ScalarType > const & get_transitions ()
 Get the transitions between the different InfectionStates. More...
 
 Simulation (Model const &model, ScalarType dt=0.1)
 setup the Simulation for an IDE model. More...
 

Private Attributes

ScalarType m_dt
 Time step used for numerical computations in simulation. More...
 
std::unique_ptr< Modelm_model
 Unique pointer to the Model simulated. More...
 

Detailed Description

run the simulation in discrete steps and report results.

Constructor & Destructor Documentation

◆ Simulation()

mio::isecir::Simulation::Simulation ( Model const &  model,
ScalarType  dt = 0.1 
)
inline

setup the Simulation for an IDE model.

Parameters
[in]modelAn instance of the IDE model.
[in]dtStep size of numerical solver. Throughout the simulation, the step size will be constant.

Member Function Documentation

◆ advance()

void mio::isecir::Simulation::advance ( ScalarType  tmax)

Run the simulation from the current time to tmax.

Parameters
tmaxTime to stop.

◆ get_dt()

ScalarType mio::isecir::Simulation::get_dt ( )
inline

get the time step of the simulation.

◆ get_model() [1/2]

Model& mio::isecir::Simulation::get_model ( )
inline

returns the simulation model used in simulation.

◆ get_model() [2/2]

const Model& mio::isecir::Simulation::get_model ( ) const
inline

returns the simulation model used in simulation.

◆ get_result() [1/2]

TimeSeries<ScalarType> mio::isecir::Simulation::get_result ( )
inline

Get the result of the simulation.

Return the number of persons in all InfectionStates.

Returns
The result of the simulation.

◆ get_result() [2/2]

const TimeSeries<ScalarType>& mio::isecir::Simulation::get_result ( ) const
inline

Get the result of the simulation.

Return the number of persons in all InfectionStates.

Returns
The result of the simulation.

◆ get_transitions()

TimeSeries<ScalarType> const& mio::isecir::Simulation::get_transitions ( )
inline

Get the transitions between the different InfectionStates.

Returns
TimeSeries with stored transitions calculated in the simulation.

Member Data Documentation

◆ m_dt

ScalarType mio::isecir::Simulation::m_dt
private

Time step used for numerical computations in simulation.

◆ m_model

std::unique_ptr<Model> mio::isecir::Simulation::m_model
private

Unique pointer to the Model simulated.