Exemplo n.º 1
0
def test_apply_person_based_full_quarantine(population):
    policy = policies.HouseholdQuarantined(
        probability_samplers.PersonProbability(1))
    policies.apply_policies(population, policy, in_place=True)
    for hid, household in population.households.items():
        for pid, person in household.people.items():
            assert_single_home_activity(person)
Exemplo n.º 2
0
def test_apply_two_policies(population):
    policy1 = policies.HouseholdQuarantined(.1)
    policy2 = policies.PersonStayAtHome(.4)
    counter = 0
    policies.apply_policies(population, [policy1, policy2], in_place=True)
    for hid, household in population.households.items():
        assert len(household.people) == 2
        for pid, person in household.people.items():
            counter += len(person.plan) == 1
    assert counter < 60  # super dodgy test with probability
Exemplo n.º 3
0
def test_apply_person_based_full_hh_quarantine_doesnt_create_or_delete_households(
        population):
    policy = policies.HouseholdQuarantined(
        probability_samplers.PersonProbability(1))
    policies.apply_policies(population, policy, in_place=True)
    assert len(population.households) == 20
Exemplo n.º 4
0
def test_apply_full_hh_quarantine(population):
    policy = policies.HouseholdQuarantined(1)
    policies.apply_policies(population, policy, in_place=True)
    for hid, household in population.households.items():
        for pid, person in household.people.items():
            assert_single_home_activity(person)
Exemplo n.º 5
0
def test_apply_full_hh_quarantine_doesnt_create_or_delete_households(
        population):
    policy = policies.HouseholdQuarantined(1)
    policies.apply_policies(population, policy, in_place=True)
    assert len(population.households) == 20