Skip to content

Commit

Permalink
Changed reduced_inf option to asymp_relative_inf - much clearer.
Browse files Browse the repository at this point in the history
Automatically set t_hosp_offset to be 3 more than highest hospitalization days, singe this was not an accessible option on the command line.
  • Loading branch information
stevenhofmeyr committed Nov 8, 2024
1 parent 495ab16 commit 8d44996
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions docs/source/usage/how_to_run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ The following inputs specify the disease parameters:
Probability of transmission given contact. There must be one entry for each disease strain.
* ``disease.p_asymp`` (`list of float`, default ``0.4``)
The fraction of cases that are asymptomatic. There must be one entry for each disease strain.
* ``disease.reduced_inf`` (`list of float`, default ``0.75``)
The relative infectiousness of asymptomatic individuals. There must be one entry for each disease strain.
* ``disease.asymp_relative_inf`` (`list of float`, default ``0.75``)
The relative infectiousness of asymptomatic individuals, from 0 to 1. There must be one entry for each disease strain.
`This is not yet implemented`.
* ``disease.vac_eff`` (`float`, default ``0``)
The vaccine efficacy - the probability of transmission will be multiplied by one minus this factor.
`Vaccination is not yet implemented, so this factor must be left at 0`.
Expand Down
8 changes: 4 additions & 4 deletions examples/inputs.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ disease.nstrain = 1
disease.p_trans = 0.2
# Probability of being asymptomatic.
disease.p_asymp = 0.4
# Relative infectiousness of asymptomatic indivudals.
disease.reduced_inf = 0.75
# Relative infectiousness of asymptomatic indivudals. Curnently not implemented.
disease.asymp_relative_inf = 0.75
# Vaccine efficacy. Not yet implemented; leave at 0.
disease.vac_eff = 0
# Mean length in days that agents are immune after recovery from an infection.
Expand All @@ -107,9 +107,9 @@ disease.infectious_length_mean = 6.0
# Standard deviation in days.
disease.infectious_length_std = 1.0
# Mean length in days from the time of infectioun untli symptoms develop.
disease.incution_length_mean = 5.0
disease.incubation_length_mean = 5.0
# Standard deviation in days.
disease.incution_length_std = 1.0
disease.incubation_length_std = 1.0

# Number of days in hospital for the age groups under 50, 50 to 64 and over 64.
disease.hospitalization_days = 3 8 7
Expand Down
5 changes: 3 additions & 2 deletions src/DiseaseParm.H
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct DiseaseParm
int nstrain = 1; /*!< Number of strains */
Real p_trans[1] = {Real(0.20)}; /*!< probability of transimission given contact */
Real p_asymp[1] = {Real(0.40)}; /*!< fraction of cases that are asymptomatic */
Real reduced_inf[1] = {Real(0.75)}; /*!< relative infectiousness of asymptomatic individuals */
Real asymp_relative_inf[1] = {Real(0.75)}; /*!< relative infectiousness of asymptomatic individuals */

Real vac_eff = Real(0.0); /*!< Vaccine efficacy */

Expand All @@ -101,7 +101,8 @@ struct DiseaseParm
* used in other parts of the code (#AgeGroups) */
Real m_t_hosp[AgeGroups_Hosp::total] = {Real(3), Real(8), Real(7)};
/*! Offset to separate the timers for hospital, ICU, and ventilator;
* needs to be greater than the maximum of #DiseaseParm::m_t_hosp */
* needs to be greater than the maximum of #DiseaseParm::m_t_hosp
* Set automatically when the hospital days are set. */
Real m_t_hosp_offset = 10;

/*! sick -> hospital probabilities */
Expand Down
5 changes: 3 additions & 2 deletions src/DiseaseParm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void DiseaseParm::readInputs ( const std::string& a_pp_str /*!< Parmparse string

queryArray(pp, "p_trans", p_trans, nstrain);
queryArray(pp, "p_asymp", p_asymp, nstrain);
queryArray(pp, "reduced_inf", reduced_inf, nstrain);
queryArray(pp, "asymp_relative_inf", asymp_relative_inf, nstrain);

pp.query("vac_eff", vac_eff);
// no support yet for vaccinations
Expand All @@ -78,9 +78,10 @@ void DiseaseParm::readInputs ( const std::string& a_pp_str /*!< Parmparse string
pp.query("immune_length_mean", immune_length_mean);
pp.query("immune_length_std", immune_length_std);

m_t_hosp_offset = 0;
queryArray(pp, "hospitalization_days", m_t_hosp, AgeGroups_Hosp::total);
for (int i = 0; i < AgeGroups_Hosp::total; i++) {
if (m_t_hosp[i] > m_t_hosp_offset) m_t_hosp_offset = m_t_hosp[i] + 1;
if (m_t_hosp[i] > m_t_hosp_offset) m_t_hosp_offset = m_t_hosp[i] + 3;
}

queryArray(pp, "CHR", m_CHR, AgeGroups::total);
Expand Down

0 comments on commit 8d44996

Please sign in to comment.