MobilityEdge< FP > Class Template Reference
|
CPP API
|
represents the mobility between two nodes. More...
#include <metapopulation_mobility_instant.h>
Public Member Functions | |
| template<class Sim > | |
| void | apply_mobility (FP t, FP dt, SimulationNode< FP, Sim > &node_from, SimulationNode< FP, Sim > &node_to) |
| compute mobility from node_from to node_to. More... | |
| const MobilityParameters< FP > & | get_parameters () const |
| get the mobility parameters. More... | |
| MobilityEdge (const Eigen::VectorX< FP > &coeffs) | |
| Create edge with coefficients. More... | |
| MobilityEdge (const Eigen::VectorX< FP > &coeffs, const std::vector< std::vector< size_t >> &save_indices) | |
| Create edge with coefficients and a 2D vector of indices which determine which compartments are saved. More... | |
| MobilityEdge (const MobilityParameters< FP > ¶ms) | |
| Create edge with coefficients. More... | |
| MobilityEdge (const MobilityParameters< FP > ¶ms, const std::vector< std::vector< size_t >> &save_indices) | |
| Create edge with coefficients as MobilityParameters object and a 2D vector of indices which determine which compartments are saved. More... | |
| TimeSeries< FP > & | get_mobility_results () |
| Get the count of commuters in selected compartments, along with the total number of commuters. More... | |
| const TimeSeries< FP > & | get_mobility_results () const |
| Get the count of commuters in selected compartments, along with the total number of commuters. More... | |
Private Member Functions | |
| void | add_mobility_result_time_point (const FP t) |
Computes a condensed version of m_mobile_population and stores it in m_mobility_results. More... | |
Private Attributes | |
| std::pair< FP, SimulationTime< FP > > | m_dynamic_npi = {-std::numeric_limits<FP>::max(), SimulationTime<FP>(0)} |
| TimeSeries< FP > | m_mobile_population |
| TimeSeries< FP > | m_mobility_results |
| MobilityParameters< FP > | m_parameters |
| bool | m_return_mobile_population |
| TimeSeries< FP > | m_return_times |
| std::vector< std::vector< size_t > > | m_saved_compartment_indices |
| FP | m_t_last_dynamic_npi_check = -std::numeric_limits<FP>::infinity() |
Detailed Description
template<typename FP>
class mio::MobilityEdge< FP >
represents the mobility between two nodes.
Constructor & Destructor Documentation
◆ MobilityEdge() [1/4]
|
inline |
Create edge with coefficients.
- Parameters
-
coeffs % of people in each group and compartment that change node in each time step.
◆ MobilityEdge() [2/4]
|
inline |
Create edge with coefficients.
- Parameters
-
[in] coeffs An Eigen::VectorX<FP>representing the percentage of people in each group and compartment that change nodes in each time step.
◆ MobilityEdge() [3/4]
|
inline |
Create edge with coefficients as MobilityParameters object and a 2D vector of indices which determine which compartments are saved.
- Parameters
-
[in] params A MobilityParametersobject representing the percentage of people in each group and compartment that change nodes in each time step.[in] save_indices A 2D vector of indices. The outer vector represents different sets of compartments. Each inner vector represents a group of indices to be saved.
◆ MobilityEdge() [4/4]
|
inline |
Create edge with coefficients and a 2D vector of indices which determine which compartments are saved.
- Parameters
-
[in] coeffs An Eigen::VectorX<FP>representing the percentage of people in each group and compartment that migrate in each time step.[in] save_indices A 2D vector of indices. The outer vector represents different sets of compartments, while each inner vector represents a group of indices for compartments to be saved.
Member Function Documentation
◆ add_mobility_result_time_point()
|
private |
Computes a condensed version of m_mobile_population and stores it in m_mobility_results.
The m_mobility_results then only contains commuters with infection states InfectedNoSymptoms and InfectedSymptoms. Additionally, the total number of commuters is stored in the last entry of m_mobility_results.
- Parameters
-
[in] t The current time.
◆ apply_mobility()
| void mio::MobilityEdge< FP >::apply_mobility | ( | FP | t, |
| FP | dt, | ||
| SimulationNode< FP, Sim > & | node_from, | ||
| SimulationNode< FP, Sim > & | node_to | ||
| ) |
compute mobility from node_from to node_to.
mobility is based on coefficients. The mobile population is added to the current state of node_to, subtracted from node_from. on return, the mobile population (adjusted for infections) is subtracted from node_to, added to node_from.
- Parameters
-
t current time dt last time step (fixed to 0.5 for mobility model) node_from node that people changed from, return to node_to node that people changed to, return from
◆ get_mobility_results() [1/2]
|
inline |
Get the count of commuters in selected compartments, along with the total number of commuters.
- Returns
- A reference to the TimeSeries object representing the mobility results.
◆ get_mobility_results() [2/2]
|
inline |
Get the count of commuters in selected compartments, along with the total number of commuters.
- Returns
- A reference to the TimeSeries object representing the mobility results.
◆ get_parameters()
|
inline |
get the mobility parameters.
Member Data Documentation
◆ m_dynamic_npi
|
private |
◆ m_mobile_population
|
private |
◆ m_mobility_results
|
private |
◆ m_parameters
|
private |
◆ m_return_mobile_population
|
private |
◆ m_return_times
|
private |
◆ m_saved_compartment_indices
|
private |
◆ m_t_last_dynamic_npi_check
|
private |
Generated by