june.simulator_box

exception june.simulator_box.SimulatorError
__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
class june.simulator_box.SimulatorBox(world: june.world.World, interaction: june.interaction.interaction.Interaction, timer, activity_manager, infection_selector: june.infection.infection_selector.InfectionSelector = None, infection_seed: Optional[InfectionSeed] = None, checkpoint_dates: List[datetime.date] = None, record: Record = None, checkpoint_path: str = None)

Class to run an epidemic spread simulation on a box. It is basically a wrapper around the Simualtor class, disabling the options that are not available in box mode, like moving ill people to households.

world:

instance of World class

interaction:

instance of Interaction class

infection:

instance of Infection class

activity_to_groups:

mapping between an activity and its corresponding groups

time_config:

dictionary with temporal configuration to set up the simulation

min_age_home_alone:

minimum age of a child to be left alone at home when ill

policies:

policies to be implemented at different time steps

ActivityManager

alias of june.activity.activity_manager_box.ActivityManagerBox

__init__(world: june.world.World, interaction: june.interaction.interaction.Interaction, timer, activity_manager, infection_selector: june.infection.infection_selector.InfectionSelector = None, infection_seed: Optional[InfectionSeed] = None, checkpoint_dates: List[datetime.date] = None, record: Record = None, checkpoint_path: str = None)

Class to run an epidemic spread simulation on a box. It is basically a wrapper around the Simualtor class, disabling the options that are not available in box mode, like moving ill people to households.

world:

instance of World class

interaction:

instance of Interaction class

infection:

instance of Infection class

activity_to_groups:

mapping between an activity and its corresponding groups

time_config:

dictionary with temporal configuration to set up the simulation

min_age_home_alone:

minimum age of a child to be left alone at home when ill

policies:

policies to be implemented at different time steps

bury_the_dead(world: june.world.World, person: june.demography.person.Person)

When someone dies, send them to cemetery. ZOMBIE ALERT!!

time person:

person to send to cemetery

static check_inputs(time_config: dict)

Check that the iput time configuration is correct, i.e., activities are among allowed activities and days have 24 hours.

time_config:

dictionary with time steps configuration

clear_world()

Removes everyone from all possible groups, and sets everyone’s busy attribute to False.

do_timestep()

Perform a time step in the simulation

classmethod from_checkpoint(world: june.world.World, checkpoint_path: str, interaction: june.interaction.interaction.Interaction, infection_selector=None, policies: Optional[june.policy.policy.Policies] = None, infection_seed: Optional[june.infection_seed.infection_seed.InfectionSeed] = None, leisure: Optional[june.groups.leisure.leisure.Leisure] = None, travel: Optional[june.groups.travel.travel.Travel] = None, config_filename: str = PosixPath('/home/sadie/JUNE/configs/config_example.yaml'), record: Optional[Record] = None)
classmethod from_file(world: june.world.World, interaction: june.interaction.interaction.Interaction, infection_selector=None, policies: Optional[june.policy.policy.Policies] = None, infection_seed: Optional[june.infection_seed.infection_seed.InfectionSeed] = None, leisure: Optional[june.groups.leisure.leisure.Leisure] = None, travel: Optional[june.groups.travel.travel.Travel] = None, config_filename: str = PosixPath('/home/sadie/JUNE/configs/config_example.yaml'), checkpoint_path: str = None, record: Optional[Record] = None) → Simulator

Load config for simulator from world.yaml

leisure infection_seed policies interaction world config_filename

The path to the world yaml configuration

comment

A brief description of the purpose of the run(s)

A Simulator

infect_people(infected_ids, people_from_abroad_dict)

Given a list of infected ids, it initialises an infection object for them and sets it to person.infection. For the people who do not live in this domain a dictionary with their ids and domains is prepared to be sent through MPI.

recover(person: june.demography.person.Person)

When someone recovers, erase the health information they carry and change their susceptibility.

person:

person to recover

time:

time (in days), at which the person recovers

run()

Run simulation with n_seed initial infections

save_checkpoint(saving_date)
tell_domains_to_infect(infect_in_domains)

Sends information about the people who got infected in this domain to the other domains.

update_health_status(time: float, duration: float)

Update symptoms and health status of infected people. Send them to hospital if necessary, or bury them if they have died.

time:

time now

duration:

duration of time step