Skip to content

Commit

Permalink
Allow for agents to die directly (without hospitalization)
Browse files Browse the repository at this point in the history
  • Loading branch information
atmyers committed Jan 28, 2025
1 parent 933109a commit 8ccb8f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DiseaseParm.H
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ struct DiseaseParm
{Real(0), Real(0), Real(0), Real(0), Real(0), Real(0.26)},
{Real(0.20), Real(0.20), Real(0.20), Real(0.45), Real(0.45), Real(1.0)}};

/*! Probabilites of dying while *not* in hospital for age groups */
Real m_unhospToDeath[AgeGroups::total] = {
Real(0), Real(0), Real(0), Real(0), Real(0), Real(0)};


DiseaseParm(const std::string& dname) {
memset(disease_name, 0, 50);
Expand Down
1 change: 1 addition & 0 deletions src/DiseaseParm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void DiseaseParm::readInputs ( const std::string& a_pp_str /*!< Parmparse string
queryArray(pp, "CHR", m_CHR, AgeGroups::total);
queryArray(pp, "CIC", m_CIC, AgeGroups::total);
queryArray(pp, "CVE", m_CVE, AgeGroups::total);
queryArray(pp, "unhospCVF", m_unhospToDeath, AgeGroups::total);
queryArray(pp, "hospCVF", m_hospToDeath[DiseaseStats::hospitalization], AgeGroups::total);
queryArray(pp, "icuCVF", m_hospToDeath[DiseaseStats::ICU], AgeGroups::total);
queryArray(pp, "ventCVF", m_hospToDeath[DiseaseStats::ventilator], AgeGroups::total);
Expand Down
6 changes: 6 additions & 0 deletions src/HospitalModel.H
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ void HospitalModel<PCType, PTDType, PType>::treatAgents(PCType& a_agents, /*!< A
{
if ( !inHospital(i, ptd) ) {
// agent is not in hospital
// determine if agent dies anyway.
if (Random(engine) < disease_parm_d->m_unhospToDeath[age_group_ptr[i]]) {
is_alive_ptr[i] = 0;
flag_status_ptr[i] *= -1;
status_ptrs[d][i] = Status::dead;
}
return;
}
if (counter_ptrs[d][i] == Math::floor(incubation_per_ptrs[d][i])) {
Expand Down

0 comments on commit 8ccb8f1

Please sign in to comment.