diff --git a/src/AgentContainer.cpp b/src/AgentContainer.cpp index 65cd23a..2a3d054 100644 --- a/src/AgentContainer.cpp +++ b/src/AgentContainer.cpp @@ -671,9 +671,12 @@ void AgentContainer::infectAgents () if (amrex::Random(engine) < prob_ptr[i]) { status_ptr[i] = Status::infected; counter_ptr[i] = 0.0_rt; - latent_period_ptr[i] = std::max(amrex::ParticleReal(0.0),amrex::RandomNormal(lparm->latent_length_mean, lparm->latent_length_std, engine)); - infectious_period_ptr[i] = std::max(amrex::ParticleReal(0.0),amrex::RandomNormal(lparm->infectious_length_mean, lparm->infectious_length_std, engine)); - incubation_period_ptr[i] = std::max(amrex::ParticleReal(0.0),amrex::RandomNormal(lparm->incubation_length_mean, lparm->incubation_length_std, engine)); + latent_period_ptr[i] = amrex::RandomNormal(lparm->latent_length_mean, lparm->latent_length_std, engine); + infectious_period_ptr[i] = amrex::RandomNormal(lparm->infectious_length_mean, lparm->infectious_length_std, engine); + incubation_period_ptr[i] = amrex::RandomNormal(lparm->incubation_length_mean, lparm->incubation_length_std, engine); + if (latent_period_ptr[i] < 0) { latent_period_ptr[i] = 0.0_rt; } + if (infectious_period_ptr[i] < 0) { infectious_period_ptr[i] = 0.0_rt; } + if (incubation_period_ptr[i] < 0) { incubation_period_ptr[i] = 0.0_rt; } if (latent_period_ptr[i] > (infectious_period_ptr[i]+incubation_period_ptr[i])) { latent_period_ptr[i] = std::floor(infectious_period_ptr[i]+incubation_period_ptr[i]); }