Simulation< FP, BaseT > Class Template Reference

CPP API: mio::osecirts::Simulation< FP, BaseT > Class Template Reference
mio::osecirts::Simulation< FP, BaseT > Class Template Reference

specialization of compartment model simulation for the SECIRTS model. More...

#include <model.h>

Inheritance diagram for mio::osecirts::Simulation< FP, BaseT >:
Collaboration diagram for mio::osecirts::Simulation< FP, BaseT >:

Public Member Functions

Eigen::Ref< Eigen::VectorX< FP > > advance (FP tmax)
 advance simulation to tmax. More...
 
void apply_variant (const FP t, const CustomIndexArray< UncertainValue< FP >, AgeGroup > base_infectiousness)
 Applies the effect of a new variant of a disease to the transmission probability of the model. More...
 
 Simulation (mio::osecirts::Model< FP > const &model, FP t0=0., FP dt=0.1)
 construct a simulation. More...
 

Private Attributes

std::pair< FP, SimulationTime< FP > > m_dynamic_npi = {-std::numeric_limits<FP>::max(), SimulationTime<FP>(0)}
 
FP m_t_last_npi_check
 

Detailed Description

template<typename FP, class BaseT>
class mio::osecirts::Simulation< FP, BaseT >

specialization of compartment model simulation for the SECIRTS model.

Template Parameters
FPfloating point type, e.g., double.
BaseTsimulation type, default mio::Simulation. For testing purposes only!

Constructor & Destructor Documentation

◆ Simulation()

template<typename FP , class BaseT >
mio::osecirts::Simulation< FP, BaseT >::Simulation ( mio::osecirts::Model< FP > const &  model,
FP  t0 = 0.,
FP  dt = 0.1 
)
inline

construct a simulation.

Parameters
modelthe model to simulate.
t0start time
dttime steps

Member Function Documentation

◆ advance()

template<typename FP , class BaseT >
Eigen::Ref<Eigen::VectorX<FP> > mio::osecirts::Simulation< FP, BaseT >::advance ( FP  tmax)
inline

advance simulation to tmax.

Overwrites Simulation::advance and includes a check for dynamic NPIs in regular intervals.

See also
Simulation::advance
Parameters
tmaxnext stopping point of simulation
Returns
value at tmax

◆ apply_variant()

template<typename FP , class BaseT >
void mio::osecirts::Simulation< FP, BaseT >::apply_variant ( const FP  t,
const CustomIndexArray< UncertainValue< FP >, AgeGroup base_infectiousness 
)
inline

Applies the effect of a new variant of a disease to the transmission probability of the model.

This function adjusts the transmission probability of the disease for each age group based on the share of the new variant. The share of the new variant is calculated based on the time t and the start day of the new variant. The transmission probability is then updated for each age group in the model.

Based on Equation (35) and (36) in doi.org/10.1371/journal.pcbi.1010054

Parameters
[in]tThe current time.
[in]base_infectiousnessThe base infectiousness of the old variant for each age group.

Member Data Documentation

◆ m_dynamic_npi

template<typename FP , class BaseT >
std::pair<FP, SimulationTime<FP> > mio::osecirts::Simulation< FP, BaseT >::m_dynamic_npi = {-std::numeric_limits<FP>::max(), SimulationTime<FP>(0)}
private

◆ m_t_last_npi_check

template<typename FP , class BaseT >
FP mio::osecirts::Simulation< FP, BaseT >::m_t_last_npi_check
private