Skip to content

Commit

Permalink
expose the length of the incubation, infectious, and symptomatic stages
Browse files Browse the repository at this point in the history
  • Loading branch information
atmyers committed Dec 2, 2023
1 parent f14695e commit bac1fba
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
6 changes: 6 additions & 0 deletions docs/source/usage/how_to_run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ In addition to the ExaEpi inputs, there are also a number of runtime options tha
one entry for each disease strain.
* ``disease.vac_eff`` (`float`, example: ``0.4``)
The vaccine efficacy - the probability of transmission will be multiplied by this factor
* ``disease.incubation_length`` (`int`, default: ``3``)
Length of the incubation period in days. Before this, agents have no symptoms and are not infectious.
* ``disease.infectious_length`` (`int`, default: ``6``)
Length of the infectious period in days. This counter starts once the incubation phase is over. Before tihs, agents are symptomatic and can spread the disease.
* ``disease.symptomatic_length`` (`int`, default: ``5``)
Length of the symptomatic-but-not-infectious stage in days. This counter starts once the infectious phase is complete. During this time agents are symptomatic and may self-withdraw, but they cannot spread the illness.

In addition to the ExaEpi inputs, there are also a number of runtime options that can be configured for AMReX itself. Please see <https://amrex-codes.github.io/amrex/docs_html/GPU.html#inputs-parameters>`__ for more information on these options.

Expand Down
4 changes: 4 additions & 0 deletions src/AgentContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ public:
h_parm->p_asymp[i] = p_asymp[i];
h_parm->reduced_inf[i] = reduced_inf[i];
}

pp.query("incubation_length", h_parm->incubation_length);
pp.query("infectious_length", h_parm->infectious_length);
pp.query("symptomatic_length", h_parm->symptomatic_length);
}

h_parm->Initialize();
Expand Down
12 changes: 7 additions & 5 deletions src/AgentContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ void AgentContainer::updateStatus (MultiFab& disease_stats)
};
};

auto* lparm = d_parm;

// Track hospitalization, ICU, ventilator, and fatalities
Real CHR[] = {.0104, .0104, .070, .28, 1.0}; // sick -> hospital probabilities
Real CIC[] = {.24, .24, .24, .36, .35}; // hospital -> ICU probabilities
Expand All @@ -725,7 +727,7 @@ void AgentContainer::updateStatus (MultiFab& disease_stats)
}
else if (status_ptr[i] == Status::infected) {
counter_ptr[i] += 1;
if (counter_ptr[i] < 3) {
if (counter_ptr[i] < lparm->incubation_length) {
// incubation phase
return;
}
Expand Down Expand Up @@ -812,8 +814,8 @@ void AgentContainer::updateStatus (MultiFab& disease_stats)
}
}
}
else { // not hospitalized, recover on day 9
if (counter_ptr[i] == 9.0) {
else { // not hospitalized, recover once not infectious
if (counter_ptr[i] == lparm->incubation_length + lparm->infectious_length) {
status_ptr[i] = Status::immune;
}
}
Expand Down Expand Up @@ -998,14 +1000,14 @@ void AgentContainer::interactAgentsHomeWork (MultiFab& /*mask_behavior*/, bool h

AMREX_ALWAYS_ASSERT( (Long) i < np);
if (status_ptr[i] == Status::immune) { return; }
if (status_ptr[i] == Status::infected && counter_ptr[i] < 3) { return; } // incubation stage
if (status_ptr[i] == Status::infected && counter_ptr[i] < lparm->incubation_length) { return; } // incubation stage
//amrex::Real i_mask = mask_arr(home_i_ptr[i], home_j_ptr[i], 0);
for (unsigned int jj = cell_start; jj < cell_stop; ++jj) {
auto j = inds[jj];
AMREX_ALWAYS_ASSERT( (Long) j < np);
//amrex::Real j_mask = mask_arr(home_i_ptr[j], home_j_ptr[j], 0);
if (status_ptr[j] == Status::immune) {continue;}
if (status_ptr[i] == Status::infected && counter_ptr[j] < 3) { continue; } // incubation stage
if (status_ptr[i] == Status::infected && counter_ptr[j] < lparm->incubation_length) { continue; } // incubation stage

if (status_ptr[i] == Status::infected && status_ptr[j] != Status::infected) {
// i can infect j
Expand Down
4 changes: 4 additions & 0 deletions src/DiseaseParm.H
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ struct DiseaseParm

amrex::Real Child_compliance, Child_HH_closure;

int incubation_length = 3;
int infectious_length = 6;
int symptomatic_length = 5; // note, this does not affect the model yet

void Initialize ();
};
#endif

0 comments on commit bac1fba

Please sign in to comment.