Skip to content

Commit

Permalink
Use sample_person with query
Browse files Browse the repository at this point in the history
  • Loading branch information
confunguido committed Dec 19, 2024
1 parent 5e4d686 commit 0fdebe2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transmission_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use statrs::distribution::{ContinuousCDF, Exp, Poisson};

use crate::contact::ContextContactExt;
use crate::parameters::Parameters;
use crate::population_loader::Alive;

// Define the possible infectious statuses for a person.
// These states refer to the person's infectiousness at a given time
Expand Down Expand Up @@ -46,7 +47,7 @@ pub fn init(context: &mut Context) {
fn seed_infections(context: &mut Context) -> Result<(), IxaError> {
// For now, we just pick a random person and make them infectious.
// In the future, we may pick people based on specific person properties.
let random_person_id = context.sample_person(TransmissionRng)?;
let random_person_id = context.sample_person(TransmissionRng, (Alive, true))?;
context.set_person_property(
random_person_id,
InfectiousStatus,
Expand Down

0 comments on commit 0fdebe2

Please sign in to comment.