MobilityParameters< FP > Class Template Reference

CPP API: mio::MobilityParameters< FP > Class Template Reference
mio::MobilityParameters< FP > Class Template Reference

parameters that influence mobility. More...

#include <metapopulation_mobility_instant.h>

Collaboration diagram for mio::MobilityParameters< FP >:

Public Member Functions

 MobilityParameters (const Eigen::VectorX< FP > &coeffs)
 constructor from mobility coefficients. More...
 
 MobilityParameters (const Eigen::VectorX< FP > &coeffs, const std::vector< std::vector< size_t >> &save_indices)
 Constructor for initializing mobility parameters with coefficients from an Eigen Vector and specific save indices. More...
 
 MobilityParameters (const MobilityCoefficientGroup< FP > &coeffs)
 constructor from mobility coefficients. More...
 
 MobilityParameters (const MobilityCoefficientGroup< FP > &coeffs, const std::vector< std::vector< size_t >> &save_indices)
 Constructor for initializing mobility parameters with coefficients from type MobilityCoefficientGroup and specific save indices. More...
 
bool operator!= (const MobilityParameters &other) const
 
bool operator== (const MobilityParameters &other) const
 equality comparison operators More...
 
template<class IOContext >
void serialize (IOContext &io) const
 serialize this. More...
 
const MobilityCoefficientGroup< FP > & get_coefficients () const
 Get/Setthe mobility coefficients. More...
 
MobilityCoefficientGroup< FP > & get_coefficients ()
 Get/Setthe mobility coefficients. More...
 
void set_coefficients (const MobilityCoefficientGroup< FP > &coeffs)
 
const auto & get_save_indices () const
 Get the indices of compartments to be saved during mobility. More...
 
const DynamicNPIs< FP > & get_dynamic_npis_infected () const
 Get/Set dynamic NPIs that are implemented when relative infections exceed thresholds. More...
 
DynamicNPIs< FP > & get_dynamic_npis_infected ()
 Get/Setthe mobility coefficients. More...
 
void set_dynamic_npis_infected (const DynamicNPIs< FP > &v)
 

Static Public Member Functions

template<class IOContext >
static IOResult< MobilityParametersdeserialize (IOContext &io)
 deserialize an object of this class. More...
 

Private Attributes

MobilityCoefficientGroup< FP > m_coefficients
 
DynamicNPIs< FP > m_dynamic_npis
 
std::vector< std::vector< size_t > > m_saved_compartment_indices
 

Detailed Description

template<typename FP>
class mio::MobilityParameters< FP >

parameters that influence mobility.

Template Parameters
FPthe underlying floating point type, e.g., double

Constructor & Destructor Documentation

◆ MobilityParameters() [1/4]

template<typename FP >
mio::MobilityParameters< FP >::MobilityParameters ( const MobilityCoefficientGroup< FP > &  coeffs)
inline

constructor from mobility coefficients.

Parameters
coeffsmobility coefficients

◆ MobilityParameters() [2/4]

template<typename FP >
mio::MobilityParameters< FP >::MobilityParameters ( const Eigen::VectorX< FP > &  coeffs)
inline

constructor from mobility coefficients.

Parameters
coeffsmobility coefficients

◆ MobilityParameters() [3/4]

template<typename FP >
mio::MobilityParameters< FP >::MobilityParameters ( const MobilityCoefficientGroup< FP > &  coeffs,
const std::vector< std::vector< size_t >> &  save_indices 
)
inline

Constructor for initializing mobility parameters with coefficients from type MobilityCoefficientGroup and specific save indices.

Parameters
[in]coeffsA group of mobility coefficients represented by a MobilityCoefficientGroup object, defining how individuals move between nodes.
[in]save_indicesA 2D vector of indices. The outer vector represents different sets of compartments. Each inner vector represents a set of compartments whose data will be saved in the member m_mobility_results of the MobilityEdge class during the simulation using the add_mobility_result_time_point function.

◆ MobilityParameters() [4/4]

template<typename FP >
mio::MobilityParameters< FP >::MobilityParameters ( const Eigen::VectorX< FP > &  coeffs,
const std::vector< std::vector< size_t >> &  save_indices 
)
inline

Constructor for initializing mobility parameters with coefficients from an Eigen Vector and specific save indices.

Parameters
[in]coeffsAn Eigen::VectorX<FP> containing mobility coefficients.
[in]save_indicesA 2D vector of indices. The outer vector represents different sets of compartments. Each inner vector represents a set of compartments whose data will be saved in the member m_mobility_results of the MobilityEdge class during the simulation using the add_mobility_result_time_point function.

Member Function Documentation

◆ deserialize()

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

deserialize an object of this class.

See also
mio::deserialize

◆ get_coefficients() [1/2]

template<typename FP >
MobilityCoefficientGroup<FP>& mio::MobilityParameters< FP >::get_coefficients ( )
inline

Get/Setthe mobility coefficients.

The coefficients represent the (time-dependent) percentage of people moving from one node to another by age and infection compartment.

Returns
the mobility coefficients.

◆ get_coefficients() [2/2]

template<typename FP >
const MobilityCoefficientGroup<FP>& mio::MobilityParameters< FP >::get_coefficients ( ) const
inline

Get/Setthe mobility coefficients.

The coefficients represent the (time-dependent) percentage of people moving from one node to another by age and infection compartment.

Returns
the mobility coefficients.

◆ get_dynamic_npis_infected() [1/2]

template<typename FP >
DynamicNPIs<FP>& mio::MobilityParameters< FP >::get_dynamic_npis_infected ( )
inline

Get/Setthe mobility coefficients.

The coefficients represent the (time-dependent) percentage of people moving from one node to another by age and infection compartment.

Returns
the mobility coefficients.

◆ get_dynamic_npis_infected() [2/2]

template<typename FP >
const DynamicNPIs<FP>& mio::MobilityParameters< FP >::get_dynamic_npis_infected ( ) const
inline

Get/Set dynamic NPIs that are implemented when relative infections exceed thresholds.

This feature is optional. The simulation model needs to overload the get_infected_relative function.

Returns
dynamic NPIs for relative infections.

◆ get_save_indices()

template<typename FP >
const auto& mio::MobilityParameters< FP >::get_save_indices ( ) const
inline

Get the indices of compartments to be saved during mobility.

This function returns a reference to the vector of m_saved_compartment_indices, which specifies the groups of compartments that are saved in the member m_mobility_results of the MobilityEdge class during the simulation using the add_mobility_result_time_point function.

Returns
A reference to the 2D vector containing indices of compartments to be saved. The outer vector represents different sets of compartments. Each inner vector represents a group of compartments defined by indices.

◆ operator!=()

template<typename FP >
bool mio::MobilityParameters< FP >::operator!= ( const MobilityParameters< FP > &  other) const
inline

◆ operator==()

template<typename FP >
bool mio::MobilityParameters< FP >::operator== ( const MobilityParameters< FP > &  other) const
inline

equality comparison operators

◆ serialize()

template<typename FP >
template<class IOContext >
void mio::MobilityParameters< FP >::serialize ( IOContext &  io) const
inline

serialize this.

See also
mio::serialize

◆ set_coefficients()

template<typename FP >
void mio::MobilityParameters< FP >::set_coefficients ( const MobilityCoefficientGroup< FP > &  coeffs)
inline
Parameters
coeffsthe mobility coefficients.

◆ set_dynamic_npis_infected()

template<typename FP >
void mio::MobilityParameters< FP >::set_dynamic_npis_infected ( const DynamicNPIs< FP > &  v)
inline
Parameters
vdynamic NPIs for relative infections.

Member Data Documentation

◆ m_coefficients

template<typename FP >
MobilityCoefficientGroup<FP> mio::MobilityParameters< FP >::m_coefficients
private

◆ m_dynamic_npis

template<typename FP >
DynamicNPIs<FP> mio::MobilityParameters< FP >::m_dynamic_npis
private

◆ m_saved_compartment_indices

template<typename FP >
std::vector<std::vector<size_t> > mio::MobilityParameters< FP >::m_saved_compartment_indices
private