Skip to content

Commit

Permalink
Should be incubation period, not latent period.
Browse files Browse the repository at this point in the history
Check if agent is in hospital before assigning hospital. This can happen in multiple diseases.
  • Loading branch information
stevenhofmeyr committed Nov 6, 2024
1 parent 627ca7c commit 04511a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 4 additions & 3 deletions examples/inputs.nm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ agent.urbanpop_filename = "../UrbanPop/NM_35/urbanpop_nm"
agent.nsteps = 70
#agent.seed = 11

agent.number_of_diseases = 2
agent.disease_names = "covid" "flu"
# disease.initial_case_type = "file"
# disease.case_filename = "../CaseData/nm-july4.cases"

agent.number_of_diseases = 2
agent.disease_names = "covid" "flu"

disease.initial_case_type = "random" "random"
disease.num_initial_cases = 1000

Expand All @@ -31,4 +32,4 @@ disease_flu.num_initial_cases = 100
disease_flu.p_trans = 0.3
disease_flu.latent_length_mean = 3.0
disease_flu.infectious_length_mean = 3.0
disease_flu.incution_length_mean = 3.0
disease_flu.incubation_length_mean = 3.0
4 changes: 2 additions & 2 deletions src/DiseaseStatus.H
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ void DiseaseStatus<AC,ACT,ACTD,A>::updateAgents(AC& a_agents, /*!< Agent contain

ParallelFor( np, [=] AMREX_GPU_DEVICE (int i) noexcept
{
if (marked_for_hosp_ptr[i] == 1) {
AMREX_ALWAYS_ASSERT(!inHospital(i, ptd));
if (marked_for_hosp_ptr[i] == 1 && !inHospital(i, ptd)) {
//AMREX_ALWAYS_ASSERT(!inHospital(i, ptd));
assign_hospital( i, hosp_i_ptr, hosp_j_ptr, ptd);
}
});
Expand Down
8 changes: 3 additions & 5 deletions src/HospitalModel.H
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ void HospitalModel<PCType, PTDType, PType>::treatAgents(PCType& a_agents, /*!< A
int r_RT = RealIdx::nattribs;

GpuArray<int*,ExaEpi::max_num_diseases> status_ptrs, symptomatic_ptrs;
GpuArray<ParticleReal*,ExaEpi::max_num_diseases> counter_ptrs, timer_ptrs, latent_per_ptrs;
GpuArray<ParticleReal*,ExaEpi::max_num_diseases> counter_ptrs, timer_ptrs, incubation_per_ptrs;
for (int d = 0; d < n_disease; d++) {
status_ptrs[d] = soa.GetIntData(i_RT+i0(d)+IntIdxDisease::status).data();
symptomatic_ptrs[d] = soa.GetIntData(i_RT+i0(d)+IntIdxDisease::symptomatic).data();
counter_ptrs[d] = soa.GetRealData(r_RT+r0(d)+RealIdxDisease::disease_counter).data();
timer_ptrs[d] = soa.GetRealData(r_RT+r0(d)+RealIdxDisease::treatment_timer).data();
latent_per_ptrs[d] = soa.GetRealData(r_RT+r0(d)+RealIdxDisease::latent_period).data();
incubation_per_ptrs[d] = soa.GetRealData(r_RT+r0(d)+RealIdxDisease::incubation_period).data();
}

Gpu::DeviceVector<int> is_alive(np);
Expand Down Expand Up @@ -134,9 +134,7 @@ void HospitalModel<PCType, PTDType, PType>::treatAgents(PCType& a_agents, /*!< A
// agent is not in hospital
return;
}
// Should this be:?
// if (counter_ptrs[d][i] == Math::floor(incubation_per_ptrs[d][i]))
if (counter_ptrs[d][i] == Math::ceil(latent_per_ptrs[d][i])) {
if (counter_ptrs[d][i] == Math::floor(incubation_per_ptrs[d][i])) {
// agent just started treatment
return;
}
Expand Down

0 comments on commit 04511a5

Please sign in to comment.