Skip to content

Commit

Permalink
fixed the if condition for when hospitalization starts
Browse files Browse the repository at this point in the history
  • Loading branch information
debog committed Nov 6, 2024
1 parent 179af4e commit ac776b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/HospitalModel.H
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,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;
Expand Down Expand Up @@ -136,7 +136,7 @@ void HospitalModel<PCType, PTDType, PType>::treatAgents(PCType& a_agents, /*!< A
// agent is not in hospital
return;
}
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 ac776b8

Please sign in to comment.