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_implementation_delay () const |
| Get/Set the implementation delay at which the NPIs are implemented after threshold exceedance. More... | |
| void | set_implementation_delay (SimulationTime< FP > delay) |
| FP | get_base_value () const |
| Get/Set the base value of the thresholds. More... | |
| void | set_base_value (FP v) |
| SimulationTime< FP > | get_directive_begin () const |
| Get/Set the first day of the simulation for which a DynamicNPI can be activated. More... | |
| void | set_directive_begin (SimulationTime< FP > begin) |
| SimulationTime< FP > | get_directive_end () const |
| Get/Set the last day of the simulation for which a DynamicNPI can be active. More... | |
| void | set_directive_end (SimulationTime< FP > end) |
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_delay {0.0} |
| SimulationTime< FP > | m_directive_begin {SimulationTime<FP>(std::numeric_limits<FP>::lowest())} |
| SimulationTime< FP > | m_directive_end {SimulationTime<FP>(std::numeric_limits<FP>::max())} |
| SimulationTime< FP > | m_duration {14.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_directive_begin()
|
inline |
Get/Set the first day of the simulation for which a DynamicNPI can be activated.
This parameter imitates the beginning date of a legal directive.
- Returns
- the first day of a legal directive prescribing the DynamicNPI.
◆ get_directive_end()
|
inline |
Get/Set the last day of the simulation for which a DynamicNPI can be active.
This parameter imitates the last date of a legal directive and ends all active DynamicNPIs.
- Returns
- the last day of a legal directive prescribing the DynamicNPI.
◆ get_duration()
|
inline |
get the duration of the NPIs.
- Returns
- the duration of the NPIs.
◆ get_implementation_delay()
|
inline |
Get/Set the implementation delay at which the NPIs are implemented after threshold exceedance.
This parameter imitates delayed reaction times when automatic implementations should be realized.
- Returns
- the implementation delay after which the NPIs are implemented upon threshold exceedance.
◆ 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 |
- Parameters
-
v Sets the base value of the thresholds.
◆ set_directive_begin()
|
inline |
- Parameters
-
begin The first day of a legal directive prescribing the DynamicNPI.
◆ set_directive_end()
|
inline |
- Parameters
-
end The last day of a legal directive prescribing the DynamicNPI.
◆ set_duration()
|
inline |
set the duration of the NPIs.
- Parameters
-
v the duration of the NPIs.
◆ set_implementation_delay()
|
inline |
- Parameters
-
delay The implementation delay after which the NPIs are implemented upon threshold exceedance.
◆ 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_delay
|
private |
◆ m_directive_begin
|
private |
◆ m_directive_end
|
private |
◆ m_duration
|
private |
◆ m_thresholds
|
private |
Generated by