DynamicNPIs< FP > Class Template Reference
|
CPP API
|
represents non-pharmaceutical interventions (NPI) that are activated during the simulation if some value (e.g. More...
#include <dynamic_npis.h>
Public Member Functions | |
| void | draw_sample () |
| draw a random sample from the damping distributions More... | |
| SimulationTime< FP > | get_duration () const |
| get the duration of the NPIs. More... | |
| auto | get_max_exceeded_threshold (FP value) |
| find the highest threshold that is smaller than the value. More... | |
| template<class IOContext > | |
| void | serialize (IOContext &io) const |
| serialize this. More... | |
| void | set_duration (SimulationTime< FP > v) |
| set the duration of the NPIs. More... | |
| void | set_threshold (FP threshold, const std::vector< DampingSampling< FP >> &dampings) |
| set a threshold and the NPIs that should be enacted. More... | |
| auto | get_thresholds () const |
| range of pairs of threshold values and NPIs. More... | |
| auto | get_thresholds () |
| range of pairs of threshold values and NPIs. More... | |
| SimulationTime< FP > | get_interval () const |
| Get/Set the interval at which the NPIs are checked. More... | |
| void | set_interval (SimulationTime< FP > interval) |
| FP | get_base_value () const |
| Get/Set the base value of the thresholds. More... | |
| void | set_base_value (FP v) |
Static Public Member Functions | |
| template<class IOContext > | |
| static IOResult< DynamicNPIs > | deserialize (IOContext &io) |
| deserialize an object of this class. More... | |
Private Attributes | |
| FP | m_base {1.0} |
| SimulationTime< FP > | m_duration {14.0} |
| SimulationTime< FP > | m_interval {3.0} |
| std::vector< std::pair< FP, std::vector< DampingSampling< FP > > > > | m_thresholds |
Detailed Description
template<typename FP>
class mio::DynamicNPIs< FP >
represents non-pharmaceutical interventions (NPI) that are activated during the simulation if some value (e.g.
infections) exceeds specified thresholds.
Member Function Documentation
◆ deserialize()
|
inlinestatic |
deserialize an object of this class.
- See also
- mio::deserialize
◆ draw_sample()
|
inline |
draw a random sample from the damping distributions
◆ get_base_value()
|
inline |
Get/Set the base value of the thresholds.
The base value determines the unit of the threshold values. E.g. If the base value is X, the thresholds should be interpreted as cases per X people.
- Returns
- The base value of the thresholds.
◆ get_duration()
|
inline |
get the duration of the NPIs.
- Returns
- the duration of the NPIs.
◆ get_interval()
|
inline |
Get/Set the interval at which the NPIs are checked.
- Returns
- the interval at which the NPIs are checked.
◆ get_max_exceeded_threshold()
|
inline |
find the highest threshold that is smaller than the value.
- Parameters
-
value value to compare against the thresholds.
- Returns
- iterator (see get_thresholds()) to the exceeded threshold if found. get_thresholds().end() otherwise
◆ get_thresholds() [1/2]
|
inline |
range of pairs of threshold values and NPIs.
thresholds are sorted by value in descending order.
- Returns
- the range of set thresholds.
◆ get_thresholds() [2/2]
|
inline |
range of pairs of threshold values and NPIs.
thresholds are sorted by value in descending order.
- Returns
- the range of set thresholds.
◆ serialize()
|
inline |
serialize this.
- See also
- mio::serialize
◆ set_base_value()
|
inline |
- Returns
- The base value of the thresholds.
◆ set_duration()
|
inline |
set the duration of the NPIs.
- Parameters
-
v the duration of the NPIs.
◆ set_interval()
|
inline |
- Parameters
-
interval The interval at which the NPIs are checked.
◆ set_threshold()
|
inline |
set a threshold and the NPIs that should be enacted.
- Parameters
-
threshold the threshold that may be exceeded. dampings the NPIs
Member Data Documentation
◆ m_base
|
private |
◆ m_duration
|
private |
◆ m_interval
|
private |
◆ m_thresholds
|
private |
Generated by