osecir Namespace Reference

CPP API: mio::osecir Namespace Reference
mio::osecir Namespace Reference

Classes

struct  ContactPatterns
 the contact patterns within the society are modelled using an UncertainContactMatrix More...
 
struct  CriticalPerSevere
 the percentage of ICU patients per hospitalized patients in the SECIR model More...
 
struct  DeathsPerCritical
 the percentage of dead patients per ICU patients in the SECIR model More...
 
struct  DynamicNPIsImplementationDelay
 The delay with which DynamicNPIs are implemented and enforced after exceedance of threshold. More...
 
struct  DynamicNPIsInfectedSymptoms
 the NPIs that are enforced if certain infection thresholds are exceeded. More...
 
struct  ICUCapacity
 the icu capacity in the SECIR model More...
 
struct  MaxRiskOfInfectionFromSymptomatic
 risk of infection from symptomatic cases increases as test and trace capacity is exceeded. More...
 
class  Model
 
class  Parameters
 Parameters of an age-resolved SECIR/SECIHURD model. More...
 
struct  RecoveredPerInfectedNoSymptoms
 the percentage of asymptomatic cases in the SECIR model More...
 
struct  RelativeTransmissionNoSymptoms
 the relative InfectedNoSymptoms infectability More...
 
struct  RiskOfInfectionFromSymptomatic
 the risk of infection from symptomatic cases in the SECIR model More...
 
struct  Seasonality
 the seasonality in the SECIR model the seasonality is given as (1+k*sin()) where the sine curve is below one in summer and above one in winter More...
 
struct  SeverePerInfectedSymptoms
 the percentage of hospitalized patients per infected patients in the SECIR model More...
 
class  Simulation
 specialization of compartment model simulation for secir models. More...
 
struct  StartDay
 the start day in the SECIR model The start day defines in which season the simulation can be started If the start day is 180 and simulation takes place from t0=0 to tmax=100 the days 180 to 280 of the year are simulated More...
 
struct  TestAndTraceCapacity
 capacity to test and trace contacts of infected for quarantine per day. More...
 
struct  TestAndTraceCapacityMaxRisk
 Multiplier for the test and trace capacity to determine when it is considered overloaded. More...
 
struct  TimeExposed
 the (mean) latent time in day unit More...
 
struct  TimeInfectedCritical
 the time people are treated by ICU before returning home in the SECIR model in day unit More...
 
struct  TimeInfectedNoSymptoms
 the (mean) time in day unit for asymptomatic cases that are infectious but have not yet developed symptoms. More...
 
struct  TimeInfectedSevere
 the time people are 'simply' hospitalized before returning home in the SECIR model in day unit More...
 
struct  TimeInfectedSymptoms
 the infectious time for symptomatic cases that are infected but who do not need to be hsopitalized in the SECIR model in day unit More...
 
struct  TransmissionProbabilityOnContact
 probability of getting infected from a contact More...
 

Typedefs

using Flows = TypeList< Flow< InfectionState::Susceptible, InfectionState::Exposed >, Flow< InfectionState::Exposed, InfectionState::InfectedNoSymptoms >, Flow< InfectionState::InfectedNoSymptoms, InfectionState::InfectedSymptoms >, Flow< InfectionState::InfectedNoSymptoms, InfectionState::Recovered >, Flow< InfectionState::InfectedNoSymptomsConfirmed, InfectionState::InfectedSymptomsConfirmed >, Flow< InfectionState::InfectedNoSymptomsConfirmed, InfectionState::Recovered >, Flow< InfectionState::InfectedSymptoms, InfectionState::InfectedSevere >, Flow< InfectionState::InfectedSymptoms, InfectionState::Recovered >, Flow< InfectionState::InfectedSymptomsConfirmed, InfectionState::InfectedSevere >, Flow< InfectionState::InfectedSymptomsConfirmed, InfectionState::Recovered >, Flow< InfectionState::InfectedSevere, InfectionState::InfectedCritical >, Flow< InfectionState::InfectedSevere, InfectionState::Recovered >, Flow< InfectionState::InfectedSevere, InfectionState::Dead >, Flow< InfectionState::InfectedCritical, InfectionState::Dead >, Flow< InfectionState::InfectedCritical, InfectionState::Recovered > >
 
template<typename FP >
using ParametersBase = ParameterSet< StartDay< FP >, Seasonality< FP >, ICUCapacity< FP >, TestAndTraceCapacity< FP >, TestAndTraceCapacityMaxRisk< FP >, ContactPatterns< FP >, DynamicNPIsImplementationDelay< FP >, DynamicNPIsInfectedSymptoms< FP >, TimeExposed< FP >, TimeInfectedNoSymptoms< FP >, TimeInfectedSymptoms< FP >, TimeInfectedSevere< FP >, TimeInfectedCritical< FP >, TransmissionProbabilityOnContact< FP >, RelativeTransmissionNoSymptoms< FP >, RecoveredPerInfectedNoSymptoms< FP >, RiskOfInfectionFromSymptomatic< FP >, MaxRiskOfInfectionFromSymptomatic< FP >, SeverePerInfectedSymptoms< FP >, CriticalPerSevere< FP >, DeathsPerCritical< FP > >
 

Enumerations

enum class  InfectionState {
  Susceptible = 0 , Exposed , InfectedNoSymptoms , InfectedNoSymptomsConfirmed ,
  InfectedSymptoms , InfectedSymptomsConfirmed , InfectedSevere , InfectedCritical ,
  Recovered , Dead , Count
}
 The InfectionState enum describes the possible categories for the infectious state of persons. More...
 

Functions

template<typename FP >
Graph< Model< FP >, MobilityParameters< FP > > draw_sample (Graph< Model< FP >, MobilityParameters< FP >> &graph)
 
template<typename FP >
void draw_sample (Model< FP > &model)
 Draws a sample from Model parameter distributions and stores sample values as SecirParams parameter values (cf. More...
 
template<typename FP >
void draw_sample_demographics (Model< FP > &model)
 draws a sample from the specified distributions for all parameters related to the demographics, e.g. More...
 
template<typename FP >
void draw_sample_infection (Model< FP > &model)
 draws a sample from the specified distributions for all parameters related to the infection. More...
 
template<typename FP , class Model >
std::vector< Modelensemble_params_percentile (const std::vector< std::vector< Model >> &ensemble_params, FP p)
 computes the p percentile of the parameters for each node. More...
 
template<typename FP , class Base = mio::Simulation<FP, Model<FP>>>
FP get_infections_relative (const Simulation< FP, Base > &model, FP t, const Eigen::Ref< const Eigen::VectorX< FP >> &y)
 get percentage of infections per total population. More...
 
template<typename FP , class Base = mio::Simulation<FP, Model<FP>>>
auto get_mobility_factors (const Simulation< FP, Base > &sim, FP, const Eigen::Ref< const Eigen::VectorX< FP >> &y)
 Get mobility factors. More...
 
template<typename FP , class Base >
IOResult< FP > get_reproduction_number (FP t_value, const Simulation< FP, Base > &sim)
 Computes the reproduction number at a given time point of the Simulation. More...
 
template<typename FP , class Base >
IOResult< FP > get_reproduction_number (size_t t_idx, const Simulation< FP, Base > &sim)
 Computes the reproduction number at a given index time of the Model output obtained by the Simulation. More...
 
template<typename FP , class Base >
Eigen::VectorX< FP > get_reproduction_numbers (const Simulation< FP, Base > &sim)
 Computes the reproduction number for all time points of the Model output obtained by the Simulation. More...
 
template<typename FP >
void set_params_distributions_normal (Model< FP > &model, FP t0, FP tmax, FP dev_rel)
 Sets alls SecirParams parameters normally distributed, using the current value and a given standard deviation. More...
 
template<typename FP >
auto simulate (FP t0, FP tmax, FP dt, const Model< FP > &model, std::unique_ptr< OdeIntegratorCore< FP >> &&integrator_core=nullptr)
 Specialization of simulate for SECIR models using Simulation. More...
 
template<typename FP >
auto simulate_flows (FP t0, FP tmax, FP dt, const Model< FP > &model, std::unique_ptr< OdeIntegratorCore< FP >> &&integrator_core=nullptr)
 Specialization of simulate for SECIR models using the FlowSimulation. More...
 
template<typename FP , class Base = mio::Simulation<FP, Model<FP>>>
auto test_commuters (Simulation< FP, Base > &sim, Eigen::Ref< Eigen::VectorX< FP >> mobile_population, FP time)
 

Typedef Documentation

◆ Flows

◆ ParametersBase

Enumeration Type Documentation

◆ InfectionState

The InfectionState enum describes the possible categories for the infectious state of persons.

Enumerator
Susceptible 
Exposed 
InfectedNoSymptoms 
InfectedNoSymptomsConfirmed 
InfectedSymptoms 
InfectedSymptomsConfirmed 
InfectedSevere 
InfectedCritical 
Recovered 
Dead 
Count 

Function Documentation

◆ draw_sample() [1/2]

template<typename FP >
Graph<Model<FP>, MobilityParameters<FP> > mio::osecir::draw_sample ( Graph< Model< FP >, MobilityParameters< FP >> &  graph)

◆ draw_sample() [2/2]

template<typename FP >
void mio::osecir::draw_sample ( Model< FP > &  model)

Draws a sample from Model parameter distributions and stores sample values as SecirParams parameter values (cf.

UncertainValue and SecirParams classes).

Parameters
[in,out]modelModel including contact patterns for alle age groups.

◆ draw_sample_demographics()

template<typename FP >
void mio::osecir::draw_sample_demographics ( Model< FP > &  model)

draws a sample from the specified distributions for all parameters related to the demographics, e.g.

population.

Parameters
[in,out]modelModel including contact patterns for alle age groups

◆ draw_sample_infection()

template<typename FP >
void mio::osecir::draw_sample_infection ( Model< FP > &  model)

draws a sample from the specified distributions for all parameters related to the infection.

Parameters
[in,out]modelModel including contact patterns for alle age groups

◆ ensemble_params_percentile()

template<typename FP , class Model >
std::vector<Model> mio::osecir::ensemble_params_percentile ( const std::vector< std::vector< Model >> &  ensemble_params,
FP  p 
)

computes the p percentile of the parameters for each node.

Parameters
ensemble_resultgraph of multiple simulation runs
ppercentile value in open interval (0, 1)
Returns
p percentile of the parameters over all runs

◆ get_infections_relative()

template<typename FP , class Base = mio::Simulation<FP, Model<FP>>>
FP mio::osecir::get_infections_relative ( const Simulation< FP, Base > &  model,
FP  t,
const Eigen::Ref< const Eigen::VectorX< FP >> &  y 
)

get percentage of infections per total population.

Parameters
modelthe compartment model with initial values.
tcurrent simulation time.
ycurrent value of compartments.
Template Parameters
FPfloating point type, e.g., double.
Basesimulation type that uses a secir compartment model. see Simulation.

◆ get_mobility_factors()

template<typename FP , class Base = mio::Simulation<FP, Model<FP>>>
auto mio::osecir::get_mobility_factors ( const Simulation< FP, Base > &  sim,
FP  ,
const Eigen::Ref< const Eigen::VectorX< FP >> &  y 
)

Get mobility factors.

Used by mobility graph simulation. Like infection risk, mobility of infected individuals is reduced if they are well isolated.

Parameters
modelthe compartment model with initial values.
tcurrent simulation time.
ycurrent value of compartments.
Returns
vector expression, same size as y, with mobility factors per compartment.
Template Parameters
FPfloating point type, e.g., double.
Basesimulation type that uses a secir compartment model; see Simulation.

◆ get_reproduction_number() [1/2]

template<typename FP , class Base >
IOResult<FP> mio::osecir::get_reproduction_number ( FP  t_value,
const Simulation< FP, Base > &  sim 
)

Computes the reproduction number at a given time point of the Simulation.

If the particular time point is not part of the output, a linearly interpolated value is returned.

Parameters
t_valueThe time point at which the reproduction number should be computed.
simThe Model Simulation.
Template Parameters
Basesimulation type that uses a SECIR compartment model. see Simulation.
Returns
The computed reproduction number at the provided time point, potentially using linear interpolation.

◆ get_reproduction_number() [2/2]

template<typename FP , class Base >
IOResult<FP> mio::osecir::get_reproduction_number ( size_t  t_idx,
const Simulation< FP, Base > &  sim 
)

Computes the reproduction number at a given index time of the Model output obtained by the Simulation.

Parameters
t_idxThe index time at which the reproduction number is computed.
simThe simulation holding the SECIR model
Template Parameters
Basesimulation type that uses a SECIR compartment model. see Simulation.
Returns
The computed reproduction number at the provided index time.

◆ get_reproduction_numbers()

template<typename FP , class Base >
Eigen::VectorX<FP> mio::osecir::get_reproduction_numbers ( const Simulation< FP, Base > &  sim)

Computes the reproduction number for all time points of the Model output obtained by the Simulation.

Parameters
simThe Model Simulation.
Template Parameters
Basesimulation type that uses a SECIR compartment model. see Simulation.
Returns
Eigen::Vector containing all reproduction numbers

◆ set_params_distributions_normal()

template<typename FP >
void mio::osecir::set_params_distributions_normal ( Model< FP > &  model,
FP  t0,
FP  tmax,
FP  dev_rel 
)

Sets alls SecirParams parameters normally distributed, using the current value and a given standard deviation.

Parameters
[in,out]paramsSecirParams including contact patterns for alle age groups
[in]t0start time
[in]tmaxend time
[in]dev_relmaximum relative deviation from particular value(s) given in params

◆ simulate()

template<typename FP >
auto mio::osecir::simulate ( FP  t0,
FP  tmax,
FP  dt,
const Model< FP > &  model,
std::unique_ptr< OdeIntegratorCore< FP >> &&  integrator_core = nullptr 
)
inline

Specialization of simulate for SECIR models using Simulation.

Template Parameters
FPfloating point type, e.g., double.
Parameters
[in]t0start time.
[in]tmaxend time.
[in]dttime step.
[in]modelSECIR model to simulate.
[in]integrator_coreoptional IntegratorCore, uses rk45 if nullptr.
Returns
Returns the result of the simulation.

◆ simulate_flows()

template<typename FP >
auto mio::osecir::simulate_flows ( FP  t0,
FP  tmax,
FP  dt,
const Model< FP > &  model,
std::unique_ptr< OdeIntegratorCore< FP >> &&  integrator_core = nullptr 
)
inline

Specialization of simulate for SECIR models using the FlowSimulation.

Template Parameters
FPfloating point type, e.g., double.
Parameters
[in]t0start time.
[in]tmaxend time.
[in]dttime step.
[in]modelSECIR model to simulate.
[in]integrator_coreoptional IntegratorCore, uses rk45 if nullptr.
Returns
Returns the result of the Flowsimulation.

◆ test_commuters()

template<typename FP , class Base = mio::Simulation<FP, Model<FP>>>
auto mio::osecir::test_commuters ( Simulation< FP, Base > &  sim,
Eigen::Ref< Eigen::VectorX< FP >>  mobile_population,
FP  time 
)