june.infection_seed.infection_seed.InfectionSeed

class june.infection_seed.infection_seed.InfectionSeed(world: World, infection_selector: june.infection.infection_selector.InfectionSelector, seed_strength: float = 1.0, age_profile: Optional[dict] = None, daily_super_area_cases: Optional[pandas.core.frame.DataFrame] = None)

Class that generates the seed for the infection.

world:

world to infect

infection_selector:

selector to generate infections

seed_strength:

float that controls the strength of the seed

age_profile:

dictionary with weight on age groups. Example: age_profile = {‘0-20’: 0., ‘21-50’:1, ‘51-100’:0.} would only infect people aged between 21 and 50

__init__(world: World, infection_selector: june.infection.infection_selector.InfectionSelector, seed_strength: float = 1.0, age_profile: Optional[dict] = None, daily_super_area_cases: Optional[pandas.core.frame.DataFrame] = None)

Class that generates the seed for the infection.

world:

world to infect

infection_selector:

selector to generate infections

seed_strength:

float that controls the strength of the seed

age_profile:

dictionary with weight on age groups. Example: age_profile = {‘0-20’: 0., ‘21-50’:1, ‘51-100’:0.} would only infect people aged between 21 and 50

get_people_from_age_group(susceptible_ids: List[int], n_people: int, age_group: str) → List[int]

Get `n_people` in a given `age_group` from the list of susceptible_ids

susceptible_ids:

list of ids of susceptible people to select from

n_people:

number of people to select

age_group:

age limits to select from (Example: ‘18-25’)

ids of people in age group

infect_super_areas(n_cases_per_super_area: pandas.core.frame.DataFrame, record: Optional[Record] = None)

Infect super areas with numer of cases given by data frame

n_cases_per_super_area:

data frame containig the number of cases per super area

select_susceptiles_by_age(susceptible_ids: List[int], n_cases: int) → List[int]

Select cases according to an age profile

susceptible_ids:

list of ids of susceptible people to select from

n_cases:

number of cases

choices:

ids of people to infect, following the age profile given

unleash_virus(population: Population, n_cases: int, mpi_rank: int = 0, mpi_comm: Optional[MPI.COMM_WORLD] = None, mpi_size: Optional[int] = None, box_mode=False, record: Optional[Record] = None)

Infects `n_cases` people in `population`

population:

population to infect

n_cases:

number of initial cases

mpi_rank:

rank of the process

mpi_comm:

mpi comm_world to enable communication between different processes

mpi_size:

number of processes

box_mode:

whether to run on box mode

unleash_virus_per_day(date: datetime, record: Optional[Record] = None)

Infect super areas at a given `date`

date:

datetime object