Parameters< FP > Class Template Reference

CPP API: mio::osecirvvs::Parameters< FP > Class Template Reference

Parameters of an age-resolved SECIR/SECIHURD model with paths for partial and improved immunity through vaccination. More...

#include <parameters.h>

Inheritance diagram for mio::osecirvvs::Parameters< FP >:
Collaboration diagram for mio::osecirvvs::Parameters< FP >:

Public Member Functions

bool apply_constraints ()
 Checks whether all Parameters satisfy their corresponding constraints and applies them, if they do not. More...
 
bool check_constraints () const
 Checks whether all Parameters satisfy their corresponding constraints and logs an error if constraints are not satisfied. More...
 
FP & get_commuter_nondetection ()
 Percentage of infected commuters that are not detected. More...
 
FP get_commuter_nondetection () const
 
FP & get_end_commuter_detection ()
 Time in simulation after which no infected commuters are detected. More...
 
FP get_end_commuter_detection () const
 
FP & get_end_dynamic_npis ()
 Time in simulation after which no dynamic NPIs are applied. More...
 
FP get_end_dynamic_npis () const
 
AgeGroup get_num_groups () const
 
FP & get_start_commuter_detection ()
 Time in simulation before which no infected commuters are detected. More...
 
FP get_start_commuter_detection () const
 
 Parameters (AgeGroup num_agegroups)
 
- Public Member Functions inherited from mio::ParameterSet< Tags >
template<class Tag >
ParameterTagTraits< Tag >::Type & get ()
 get value of a parameter More...
 
template<class Tag >
const ParameterTagTraits< Tag >::Type & get () const
 get value of a parameter More...
 
bool operator!= (const ParameterSet &b) const
 
bool operator== (const ParameterSet &b) const
 
template<class Dummy = void, class = std::enable_if_t< details::AllOf<has_get_default_member_function, ParameterTagTraits<Tags>...>::value, Dummy>>
 ParameterSet ()
 default initializing constructor Initializes each parameter using either the get_default function defined in the parameter tag or the default constructor. More...
 
template<class Dummy = void, class = std::enable_if_t<details::AllOf<std::is_default_constructible, typename Tags::Type...>::value, Dummy>>
 ParameterSet (NoDefaultInit)
 Non-initializing default constructor. More...
 
template<class T1 , class... TN, class = std::enable_if_t< !std::is_same_v<std::decay_t<T1>, ParameterSet> && details::AllOf<details::BindTail<has_get_default_member_function, T1, TN...>::template type, ParameterTagTraits<Tags>...>::value>>
 ParameterSet (T1 &&arg1, TN &&... argn)
 default initializing constructor. More...
 
template<class IOContext >
void serialize (IOContext &io) const
 serialize this. More...
 
template<class Tag >
void set (const typename ParameterTagTraits< Tag >::Type &value)
 set value of a parameter More...
 
template<class Tag , class T >
void set (T &&arg)
 set value of a parameter More...
 
template<class Tag , class... T>
std::enable_if_t< has_get_default_member_function< ParameterTagTraits< Tag >, T... >::value, void > set_default (T &&... ts)
 (re)set parameter to its default value More...
 

Static Public Member Functions

template<class IOContext >
static IOResult< Parametersdeserialize (IOContext &io)
 deserialize an object of this class. More...
 
- Static Public Member Functions inherited from mio::ParameterSet< Tags >
template<class IOContext >
static IOResult< ParameterSetdeserialize (IOContext &io)
 deserialize an object of this class. More...
 
static constexpr size_t size ()
 returns the number of parameters More...
 

Private Member Functions

 Parameters (ParametersBase< FP > &&base)
 

Private Attributes

FP m_commuter_nondetection = 0.0
 
FP m_end_commuter_detection = 0.0
 
FP m_end_dynamic_npis = std::numeric_limits<FP>::max()
 
AgeGroup m_num_groups
 
FP m_start_commuter_detection = 0.0
 

Detailed Description

template<typename FP>
class mio::osecirvvs::Parameters< FP >

Parameters of an age-resolved SECIR/SECIHURD model with paths for partial and improved immunity through vaccination.

Constructor & Destructor Documentation

◆ Parameters() [1/2]

template<typename FP >
mio::osecirvvs::Parameters< FP >::Parameters ( AgeGroup  num_agegroups)
inline

◆ Parameters() [2/2]

template<typename FP >
mio::osecirvvs::Parameters< FP >::Parameters ( ParametersBase< FP > &&  base)
inlineprivate

Member Function Documentation

◆ apply_constraints()

template<typename FP >
bool mio::osecirvvs::Parameters< FP >::apply_constraints ( )
inline

Checks whether all Parameters satisfy their corresponding constraints and applies them, if they do not.

Time spans cannot be negative and probabilities can only take values between [0,1].

Attention: This function should be used with care. It is necessary for some test problems to run through quickly, but in a manual execution of an example, check_constraints() may be preferred. Note that the apply_constraints() function can and will not set Parameters to meaningful values in an epidemiological or virological context, as all models are designed to be transferable to multiple diseases. Consequently, only acceptable (like 0 or 1 for probabilities or small positive values for time spans) values are set here and a manual adaptation may often be necessary to have set meaningful values.

Returns
Returns true if one ore more constraint were corrected, false otherwise.

◆ check_constraints()

template<typename FP >
bool mio::osecirvvs::Parameters< FP >::check_constraints ( ) const
inline

Checks whether all Parameters satisfy their corresponding constraints and logs an error if constraints are not satisfied.

Returns
Returns true if one constraint is not satisfied, otherwise false.

◆ deserialize()

template<typename FP >
template<class IOContext >
static IOResult<Parameters> mio::osecirvvs::Parameters< FP >::deserialize ( IOContext &  io)
inlinestatic

deserialize an object of this class.

See also
epi::deserialize

◆ get_commuter_nondetection() [1/2]

template<typename FP >
FP& mio::osecirvvs::Parameters< FP >::get_commuter_nondetection ( )
inline

Percentage of infected commuters that are not detected.

◆ get_commuter_nondetection() [2/2]

template<typename FP >
FP mio::osecirvvs::Parameters< FP >::get_commuter_nondetection ( ) const
inline

◆ get_end_commuter_detection() [1/2]

template<typename FP >
FP& mio::osecirvvs::Parameters< FP >::get_end_commuter_detection ( )
inline

Time in simulation after which no infected commuters are detected.

◆ get_end_commuter_detection() [2/2]

template<typename FP >
FP mio::osecirvvs::Parameters< FP >::get_end_commuter_detection ( ) const
inline

◆ get_end_dynamic_npis() [1/2]

template<typename FP >
FP& mio::osecirvvs::Parameters< FP >::get_end_dynamic_npis ( )
inline

Time in simulation after which no dynamic NPIs are applied.

◆ get_end_dynamic_npis() [2/2]

template<typename FP >
FP mio::osecirvvs::Parameters< FP >::get_end_dynamic_npis ( ) const
inline

◆ get_num_groups()

template<typename FP >
AgeGroup mio::osecirvvs::Parameters< FP >::get_num_groups ( ) const
inline

◆ get_start_commuter_detection() [1/2]

template<typename FP >
FP& mio::osecirvvs::Parameters< FP >::get_start_commuter_detection ( )
inline

Time in simulation before which no infected commuters are detected.

◆ get_start_commuter_detection() [2/2]

template<typename FP >
FP mio::osecirvvs::Parameters< FP >::get_start_commuter_detection ( ) const
inline

Member Data Documentation

◆ m_commuter_nondetection

template<typename FP >
FP mio::osecirvvs::Parameters< FP >::m_commuter_nondetection = 0.0
private

◆ m_end_commuter_detection

template<typename FP >
FP mio::osecirvvs::Parameters< FP >::m_end_commuter_detection = 0.0
private

◆ m_end_dynamic_npis

template<typename FP >
FP mio::osecirvvs::Parameters< FP >::m_end_dynamic_npis = std::numeric_limits<FP>::max()
private

◆ m_num_groups

template<typename FP >
AgeGroup mio::osecirvvs::Parameters< FP >::m_num_groups
private

◆ m_start_commuter_detection

template<typename FP >
FP mio::osecirvvs::Parameters< FP >::m_start_commuter_detection = 0.0
private