Skip to content

Commit

Permalink
Make the shelter compliance rate user-adjustable
Browse files Browse the repository at this point in the history
  • Loading branch information
atmyers committed Apr 2, 2024
1 parent 931222d commit 12205b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/source/usage/how_to_run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ In addition to the ExaEpi inputs, there are also a number of runtime options tha
Day on which to start shelter-in-place.
* ``agent.shelter_length`` (`integer`)
Number of days shelter in-place-is in effect.
* ``agent.shelter_compliance`` (`float`)
Fraction of agents that comply with shelter-in-place order.
* ``agent.symptomatic_withdraw`` (`integer`)
Whether or not to have symptomatic agents withdraw.
* ``contact.pSC`` (`float`, default: 0.2)
Expand Down
3 changes: 3 additions & 0 deletions src/AgentContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public:
{
amrex::ParmParse pp("agent");
pp.query("symptomatic_withdraw", m_symptomatic_withdraw);
pp.query("shelter_compliance", m_shelter_compliance);
}

{
Expand Down Expand Up @@ -213,6 +214,8 @@ protected:

int m_symptomatic_withdraw = 0;

amrex::Real m_shelter_compliance = 0.95;

DiseaseParm* h_parm; /*!< Disease parameters */
DiseaseParm* d_parm; /*!< Disease parameters (GPU device) */

Expand Down
3 changes: 2 additions & 1 deletion src/AgentContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,11 @@ void AgentContainer::shelterStart ()
const auto np = ptile.numParticles();
auto withdrawn_ptr = soa.GetIntData(IntIdx::withdrawn).data();

auto shelter_compliance = m_shelter_compliance;
amrex::ParallelForRNG( np,
[=] AMREX_GPU_DEVICE (int i, amrex::RandomEngine const& engine) noexcept
{
if (amrex::Random(engine) < 0.95) {
if (amrex::Random(engine) < shelter_compliance) {
withdrawn_ptr[i] = 1;
}
});
Expand Down

0 comments on commit 12205b9

Please sign in to comment.