Infection Class Reference
|
CPP API
|
#include <infection.h>
Public Member Functions | |
| auto | default_serialize () |
| This method is used by the default serialization feature. More... | |
| InfectionState | get_infection_state (TimePoint t) const |
| Get the InfectionState of the Infection. More... | |
| TimePoint | get_start_date () const |
| ScalarType | get_viral_load (TimePoint t) const |
| Gets the ViralLoad of the Infection at a given TimePoint. More... | |
| ScalarType | get_viral_shed (TimePoint t) const |
| Get viral shed at a specific time. More... | |
| VirusVariant | get_virus_variant () const |
| : Get VirusVariant. More... | |
| Infection (PersonalRandomNumberGenerator &rng, VirusVariant virus, AgeGroup age, const Parameters ¶ms, TimePoint init_date, InfectionState init_state, const InitialInfectionStateDistribution &init_state_dist, ProtectionEvent latest_protection={ProtectionType::NoProtection, TimePoint(0)}, bool detected=false) | |
| Create an Infection for a single Person with a time spent in the given initial state that is drawn from the given distribution. More... | |
| Infection (PersonalRandomNumberGenerator &rng, VirusVariant virus, AgeGroup age, const Parameters ¶ms, TimePoint start_date, InfectionState start_state=InfectionState::Exposed, ProtectionEvent latest_protection={ProtectionType::NoProtection, TimePoint(0)}, bool detected=false) | |
| Create an Infection for a single Person. More... | |
| bool | is_detected () const |
| void | set_detected () |
| Set the Infection to detected. More... | |
Private Member Functions | |
| ScalarType | calculate_death_probability (AgeGroup age, const Parameters ¶ms) const |
| Calculate the overall death probability for the infection. More... | |
| TimePoint | draw_infection_course_backward (PersonalRandomNumberGenerator &rng, AgeGroup age, const Parameters ¶ms, TimePoint init_date, InfectionState init_state) |
| Determine Infection course prior to the given InfectionState start_state. More... | |
| void | draw_infection_course_forward (PersonalRandomNumberGenerator &rng, AgeGroup age, const Parameters ¶ms, TimePoint init_date, InfectionState init_state, ProtectionEvent latest_protection) |
| Determine Infection course subsequent to the given InfectionState start_state. More... | |
| StateTransition | get_backward_transition (PersonalRandomNumberGenerator &rng, AgeGroup age, const Parameters ¶ms, InfectionState current_state) const |
| Get the backward transition from a given infection state. More... | |
| StateTransition | get_dead_backward_transition (PersonalRandomNumberGenerator &rng, AgeGroup age, const Parameters ¶ms) const |
| Get the backward transition from dead state. More... | |
| StateTransition | get_forward_transition (PersonalRandomNumberGenerator &rng, AgeGroup age, const Parameters ¶ms, InfectionState current_state, TimePoint current_time, ProtectionEvent latest_protection) const |
| Get the forward transition from a given infection state. More... | |
| StateTransition | get_recovered_backward_transition (PersonalRandomNumberGenerator &rng, AgeGroup age, const Parameters ¶ms) const |
| Get the backward transition from recovered state. More... | |
| ScalarType | get_severity_protection_factor (const Parameters ¶ms, ProtectionEvent latest_protection, AgeGroup age, TimePoint current_time) const |
| Get the severity protection factor based on latest protection. More... | |
| Infection ()=default | |
| void | initialize_viral_load (PersonalRandomNumberGenerator &rng, VirusVariant virus, AgeGroup age, const Parameters ¶ms, ProtectionEvent latest_protection) |
| Initialize the viral load parameters for the infection. More... | |
| void | initialize_viral_shed (PersonalRandomNumberGenerator &rng, VirusVariant virus, AgeGroup age, const Parameters ¶ms) |
| Initialize the viral shed parameters and individual factor for the infection. More... | |
Private Attributes | |
| friend | DefaultFactory< Infection > |
| bool | m_detected |
| Whether an Infection is detected or not. More... | |
| ScalarType | m_individual_viral_shed_factor |
| Individual viral shed factor. More... | |
| std::vector< std::pair< TimePoint, InfectionState > > | m_infection_course |
| Start date of each InfectionState. More... | |
| ScalarType | m_log_norm_alpha |
| ScalarType | m_log_norm_beta |
| Parameters for the viral shed mapping, which is modelled through an invlogit function. More... | |
| ViralLoad | m_viral_load |
| ViralLoad of the Infection. More... | |
| VirusVariant | m_virus_variant |
| Variant of the Infection. More... | |
Constructor & Destructor Documentation
◆ Infection() [1/3]
| mio::abm::Infection::Infection | ( | PersonalRandomNumberGenerator & | rng, |
| VirusVariant | virus, | ||
| AgeGroup | age, | ||
| const Parameters & | params, | ||
| TimePoint | start_date, | ||
| InfectionState | start_state = InfectionState::Exposed, |
||
| ProtectionEvent | latest_protection = {ProtectionType::NoProtection, TimePoint(0)}, |
||
| bool | detected = false |
||
| ) |
Create an Infection for a single Person.
Draws a random infection course.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] virus Virus type of the Infection. [in] age AgeGroup to determine the ViralLoad course. [in] params Parameters of the Model. [in] init_date Date of initializing the Infection. [in] init_state [Default: InfectionState::Exposed] InfectionState at time of initializing the Infection. [in] latest_protection [Default: {ProtectionType::NoProtection, TimePoint(0)}] The pair value of last ProtectionType (previous Infection/Vaccination) and TimePoint of that protection. [in] detected [Default: false] If the Infection is detected.
◆ Infection() [2/3]
| mio::abm::Infection::Infection | ( | PersonalRandomNumberGenerator & | rng, |
| VirusVariant | virus, | ||
| AgeGroup | age, | ||
| const Parameters & | params, | ||
| TimePoint | init_date, | ||
| InfectionState | init_state, | ||
| const InitialInfectionStateDistribution & | init_state_dist, | ||
| ProtectionEvent | latest_protection = {ProtectionType::NoProtection, TimePoint(0)}, |
||
| bool | detected = false |
||
| ) |
Create an Infection for a single Person with a time spent in the given initial state that is drawn from the given distribution.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] virus Virus type of the Infection. [in] age AgeGroup to determine the ViralLoad course. [in] params Parameters of the Model. [in] init_date Date of initializing the Infection. [in] init_state InfectionState at time of initializing the Infection. [in] init_state_dist Distribution to draw the relative time spent in the initial state from. Values have to be within [0, 1]. [in] latest_protection The pair value of last ProtectionType (previous Infection/Vaccination) and TimePoint of that protection. [in] detected If the Infection is detected.
◆ Infection() [3/3]
|
privatedefault |
Member Function Documentation
◆ calculate_death_probability()
|
private |
Calculate the overall death probability for the infection.
- Parameters
-
[in] age AgeGroup of the Person. [in] params Parameters of the Model.
- Returns
- The probability of death for this infection.
◆ default_serialize()
|
inline |
This method is used by the default serialization feature.
◆ draw_infection_course_backward()
|
private |
Determine Infection course prior to the given InfectionState start_state.
From the start_state, a random path through the InfectionState tree is chosen backwards, until Susceptible is reached. For more detailed information, refer to draw_infection_course_forward.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] age AgeGroup of the person. [in] params Parameters of the Model. [in] init_date Date of initializing the Infection. [in] init_state InfectionState at time of initializing the Infection.
- Returns
- The starting date of the Infection.
◆ draw_infection_course_forward()
|
private |
Determine Infection course subsequent to the given InfectionState start_state.
From the start_state, a random path through the InfectionState tree is chosen, that is Susceptible -> InfectedNoSymptoms, InfectedNoSymptoms -> InfectedSymptoms or InfectedNoSymptoms -> Recovered, InfectedSymptoms -> Infected_Severe or InfectedSymptoms -> Recovered, InfectedSevere -> InfectedCritical or InfectedSevere -> Recovered or InfectedSevere -> Dead, InfectedCritical -> Recovered or InfectedCritical -> Dead, until either Recoverd or Dead is reached. The duration in each InfectionState is taken from the respective parameter.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] age AgeGroup of the Person. [in] params Parameters of the Model. [in] init_date Date of initializing the Infection. [in] init_state InfectionState at time of initializing the Infection. [in] latest_protection Latest protection against Infection, has an influence on transition probabilities.
◆ get_backward_transition()
|
private |
Get the backward transition from a given infection state.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] age AgeGroup of the Person. [in] params Parameters of the Model. [in] current_state Current infection state.
- Returns
- StateTransition representing the previous transition.
◆ get_dead_backward_transition()
|
private |
Get the backward transition from dead state.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] age AgeGroup of the Person. [in] params Parameters of the Model.
- Returns
- StateTransition representing the transition that led to death.
◆ get_forward_transition()
|
private |
Get the forward transition from a given infection state.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] age AgeGroup of the Person. [in] params Parameters of the Model. [in] current_state Current infection state. [in] current_time Current time point. [in] latest_protection Latest protection against Infection.
- Returns
- StateTransition representing the next transition.
◆ get_infection_state()
| InfectionState mio::abm::Infection::get_infection_state | ( | TimePoint | t | ) | const |
Get the InfectionState of the Infection.
- Parameters
-
[in] t TimePoint of the querry.
- Returns
- InfectionState at the given TimePoint.
◆ get_recovered_backward_transition()
|
private |
Get the backward transition from recovered state.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] age AgeGroup of the Person. [in] params Parameters of the Model.
- Returns
- StateTransition representing the transition that led to recovery.
◆ get_severity_protection_factor()
|
private |
Get the severity protection factor based on latest protection.
- Parameters
-
[in] params Parameters of the Model. [in] latest_protection Latest protection against Infection. [in] age AgeGroup of the Person. [in] current_time Current time point.
- Returns
- The protection factor against severe outcomes.
◆ get_start_date()
| TimePoint mio::abm::Infection::get_start_date | ( | ) | const |
- Returns
- Get the start date of the infection.
◆ get_viral_load()
| ScalarType mio::abm::Infection::get_viral_load | ( | TimePoint | t | ) | const |
◆ get_viral_shed()
| ScalarType mio::abm::Infection::get_viral_shed | ( | TimePoint | t | ) | const |
Get viral shed at a specific time.
Computed depending on current ViralLoad and individual invlogit function of each Person corresponding to https://www.science.org/doi/full/10.1126/science.abi5273 The mapping corresponds to Fig. 2 C. Formula of invlogit function can be found here: https://github.com/VirologyCharite/SARS-CoV-2-VL-paper/tree/main in ExtendedMethods.html, Section 3.1.2.1.
- Also in accordance to Fig. 3d of another publication: https://www.nature.com/articles/s41564-022-01105-z/figures/3 The result is in arbitrary units and has to be scaled to the rate "infections per day".
- Parameters
-
[in] t TimePoint of the querry.
- Returns
- Viral shed at given TimePoint.
◆ get_virus_variant()
| VirusVariant mio::abm::Infection::get_virus_variant | ( | ) | const |
: Get VirusVariant.
- Returns
- VirusVariant of the Infection.
◆ initialize_viral_load()
|
private |
Initialize the viral load parameters for the infection.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] virus Virus type of the Infection. [in] age AgeGroup of the Person. [in] params Parameters of the Model. [in] latest_protection Latest protection against Infection.
◆ initialize_viral_shed()
|
private |
Initialize the viral shed parameters and individual factor for the infection.
- Parameters
-
[in,out] rng PersonalRandomNumberGenerator of the Person. [in] virus Virus type of the Infection. [in] age AgeGroup of the Person. [in] params Parameters of the Model.
◆ is_detected()
| bool mio::abm::Infection::is_detected | ( | ) | const |
- Returns
- Get the detected state.
◆ set_detected()
| void mio::abm::Infection::set_detected | ( | ) |
Set the Infection to detected.
Member Data Documentation
◆ DefaultFactory< Infection >
|
private |
◆ m_detected
|
private |
Whether an Infection is detected or not.
◆ m_individual_viral_shed_factor
|
private |
Individual viral shed factor.
◆ m_infection_course
|
private |
Start date of each InfectionState.
◆ m_log_norm_alpha
|
private |
◆ m_log_norm_beta
|
private |
Parameters for the viral shed mapping, which is modelled through an invlogit function.
◆ m_viral_load
◆ m_virus_variant
|
private |
Variant of the Infection.
Generated by