Classes

This lists, and categorises, all classes in june, where for a given class all members of that module are shown, including special, private and inherited members, and ones that are not (yet) documented.

Note

Note that following the link to view a given class will show it alongside the rest of the module it belongs to, so if that module contains multiple classes there will be multiple ones on the page. The class in question will be highlighted though.

Box

box.box_mode.Box()

A group of people such as in a hospital or a school.

box.box_mode.Boxes(boxes)

Demography

demography.demography.AgeSexGenerator(…[, …])

age_counts is an array where the index in the array indicates the age, and the value indicates the number of counts in that age. sex_bins are the lower edges of each sex bin where we have a fraction of females from census data, and female_fractions are those fractions. ethnicity_age_bins are the lower edges of the age bins that ethnicity data is in ethnicity_groups are the labels of the ethnicities which we have data for. ethnicity_structure are (integer) ratios of the ethnicities, for each age bin. the sum of this strucutre need NOT be the total number of people returned by the generator. Example: age_counts = [1, 2, 3] means 1 person of age 0, 2 people of age 1 and 3 people of age 2. sex_bins = [1, 3] defines two bins: (0,1) and (3, infinity) female_fractions = [0.3, 0.5] means that between the ages 0 and 1 there are 30% females, and there are 50% females in the bin 3+ years ethnicity_age_bins - see sex_bins ethnicity_groups = [‘A’,’B’,’C’] - there are three types of ethnicities that we are assigning here. ethnicity_structure = [[0,5,3],[2,3,0],…] in the first age bin, we assign people ethnicities A:B:C with probability 0:5:3, and so on. socioecon_index = 6 means this area belongs to the 6th decile in the index of multiple deprivation. Given this information we initialize two generators for age and sex, that can be accessed through gen = AgeSexGenerator().age() and AgeSexGenerator().sex().

demography.demography.Population(people)

A population of people.

demography.demography.Demography(area_names, …)

Tool to generate population for a certain geographical regin.

demography.demography.ComorbidityGenerator(…)

demography.person.Activities(residence, …)

Create new instance: Activities(residence, primary_activity, medical_facility, commute, rail_travel, leisure, box)

demography.person.Person(id, sex, age, …)

Create new instance: Person(id, sex, age, ethnicity, socioecon_index, area, work_super_area, sector, sub_sector, lockdown_status, comorbidity, mode_of_transport, busy, subgroups, infection, susceptibility, dead)

Exceptions (Exception classes):

demography.demography.DemographyError

Distributors

distributors.care_home_distributor.CareHomeDistributor(…)

Tool to distribute people from a certain area into a care home, if there is one.

distributors.company_distributor.CompanyDistributor()

Distributes workers that are not yet working in key company sectors (e.g.

distributors.hospital_distributor.HospitalDistributor(…)

Distributes people to work as health care workers in hospitals

distributors.household_distributor.HouseholdDistributor(…)

Tool to populate areas with households and fill them with the correct composition based on census data.

distributors.school_distributor.SchoolDistributor(schools)

Distributes students in an area to different schools

distributors.university_distributor.UniversityDistributor(…)

For each university it searches in the nearby super areas for students living in student households.

distributors.worker_distributor.WorkerDistributor(…)

This class distributes people to their work.

Exceptions (Exception classes):

distributors.care_home_distributor.CareHomeError

distributors.household_distributor.HouseholdError

class for throwing household related errors

Domain

domain.Domain(id)

The idea is that the world is divided in domains, which are just collections of super areas with people living/working/doing leisure in them.

domain.DomainSplitter(number_of_domains, …)

Class used to split the world into n domains containing an equal number of super areas continuous to each other.

Geography

City

geography.city.City(super_areas, super_area, …)

A city is a collection of areas, with some added methods for functionality, such as commuting or local lockdowns.

geography.city.Cities(cities[, ball_tree])

A collection of cities.

geography.city.ExternalCity(id, domain_id[, …])

This a city that lives outside the simulated domain.

Geography

geography.geography.Area(name, super_area, …)

Fine geographical resolution.

geography.geography.Areas(areas[, super_area])

geography.geography.SuperArea(name, areas, …)

Coarse geographical resolution.

geography.geography.SuperAreas(super_areas, …)

Group to aggregate SuperArea objects.

geography.geography.ExternalSuperArea(id, …)

This a city that lives outside the simulated domain.

geography.geography.Region(name, super_areas)

Coarsest geographical resolution

geography.geography.Regions(regions)

geography.geography.Geography(areas, …)

Generate hierachical devision of geography.

Exceptions (Exception classes):

geography.geography.GeographyError

Station

geography.station.Station(city, super_area)

This represents a railway station (like King’s Cross).

geography.station.Stations(stations)

A collection of stations belonging to a city.

geography.station.ExternalStation(id, domain_id)

This a station that lives outside the simulated domain.

Groups

Group Groups

groups.group.abstract.AbstractGroup()

Represents properties common to groups and subgroups.

groups.group.external.ExternalGroup(id, …)

groups.group.external.ExternalSubgroup(…)

groups.group.group.Group()

A group of people enjoying social interactions.

groups.group.group.Group.SubgroupType(value)

Defines the indices of subgroups within the subgroups array

groups.group.subgroup.Subgroup(group, …)

A group within a group.

groups.group.supergroup.Supergroup(members)

A group containing a collection of groups of the same specification, like households, carehomes, etc.

Leisure Groups

groups.leisure.care_home_visits.CareHomeVisitsDistributor(…)

A sex/age profile for the social venue attendees can be specified as male_age_probabilities = {“18-65” : 0.3} any non-specified ages in the range (0,99) will have 0 probabilty Parameters ———- social_venues A SocialVenues object male_age_probabilities a dictionary containg age as keys and the probabilty per day (think of it as the Poisson parameter lambda) of a male person of that age going to the social venue as value. This probability value is per day. So the chance of going to the social venue in a time delta_t is 1 - exp(- probabilty * delta_t) female_age_probabilities a dictionary containg age as keys and the probabilty of a female person of that age going to the social venue as value weekend_boost boosting factor for the weekend probability.

groups.leisure.cinema.Cinema()

A group of people such as in a hospital or a school.

groups.leisure.cinema.Cinemas(social_venues)

groups.leisure.grocery.Grocery()

A group of people such as in a hospital or a school.

groups.leisure.grocery.Groceries(social_venues)

groups.leisure.grocery.GroceryDistributor(…)

A sex/age profile for the social venue attendees can be specified as male_age_probabilities = {“18-65” : 0.3} any non-specified ages in the range (0,99) will have 0 probabilty Parameters ———- social_venues A SocialVenues object male_age_probabilities a dictionary containg age as keys and the probabilty per day (think of it as the Poisson parameter lambda) of a male person of that age going to the social venue as value. This probability value is per day. So the chance of going to the social venue in a time delta_t is 1 - exp(- probabilty * delta_t) female_age_probabilities a dictionary containg age as keys and the probabilty of a female person of that age going to the social venue as value weekend_boost boosting factor for the weekend probability.

groups.leisure.household_visits.HouseholdVisitsDistributor(…)

A sex/age profile for the social venue attendees can be specified as male_age_probabilities = {“18-65” : 0.3} any non-specified ages in the range (0,99) will have 0 probabilty Parameters ———- social_venues A SocialVenues object male_age_probabilities a dictionary containg age as keys and the probabilty per day (think of it as the Poisson parameter lambda) of a male person of that age going to the social venue as value. This probability value is per day. So the chance of going to the social venue in a time delta_t is 1 - exp(- probabilty * delta_t) female_age_probabilities a dictionary containg age as keys and the probabilty of a female person of that age going to the social venue as value weekend_boost boosting factor for the weekend probability.

groups.leisure.leisure.Leisure(…)

Class to manage all possible activites that happen during leisure time.

groups.leisure.pub.Pub()

A group of people such as in a hospital or a school.

groups.leisure.pub.Pubs(social_venues[, …])

groups.leisure.pub.PubDistributor(…[, …])

A sex/age profile for the social venue attendees can be specified as male_age_probabilities = {“18-65” : 0.3} any non-specified ages in the range (0,99) will have 0 probabilty Parameters ———- social_venues A SocialVenues object male_age_probabilities a dictionary containg age as keys and the probabilty per day (think of it as the Poisson parameter lambda) of a male person of that age going to the social venue as value. This probability value is per day. So the chance of going to the social venue in a time delta_t is 1 - exp(- probabilty * delta_t) female_age_probabilities a dictionary containg age as keys and the probabilty of a female person of that age going to the social venue as value weekend_boost boosting factor for the weekend probability.

groups.leisure.social_venue_distributor.SocialVenueDistributor(…)

Tool to associate social venues to people.

groups.leisure.social_venue.SocialVenue()

A group of people such as in a hospital or a school.

groups.leisure.social_venue.SocialVenue.SubgroupType(value)

An enumeration.

groups.leisure.social_venue.SocialVenues(…)

Exceptions (Exception classes):

groups.leisure.social_venue.SocialVenueError

Travel Groups

groups.travel

groups.travel.mode_of_transport.ModeOfTransport(…)

Create a ModeOfTransport from its description.

groups.travel.mode_of_transport.RegionalGenerator(…)

Randomly generate modes of transport, weighted by usage, for one particular region.

groups.travel.mode_of_transport.ModeOfTransportGenerator(…)

Generate a mode of transport that a person uses in their commute.

groups.travel.transport.Transport()

A class representing a transport unit.

groups.travel.transport.Transport.SubgroupType(value)

An enumeration.

groups.travel.transport.Transports(transports)

A collection of transport units.

groups.travel.transport.CityTransport(city)

Inner city transport

groups.travel.transport.CityTransports(…)

Inner city transports

groups.travel.transport.InterCityTransport(station)

Transport between cities.

groups.travel.transport.InterCityTransports(…)

Inter city transports

groups.travel.transport.InterRegionalTransport()

Transport between regions

groups.travel.transport.InterRegionalTransports(…)

Transports between regions

groups.travel.travel.Travel([…])

This class handles all functionality related to travel, from local commute, to inter-city and inter-regional travel.

Other Groups

groups.boundary.Boundary(world)

A group of people such as in a hospital or a school.

groups.care_home.CareHome(area, n_residents, …)

The Carehome class represents a carehome and contains information about its residents, workers and visitors.

groups.care_home.CareHome.SubgroupType(value)

An enumeration.

groups.care_home.CareHomes(care_homes)

groups.cemetery.Cemetery()

A group of people such as in a hospital or a school.

groups.cemetery.Cemeteries()

groups.company.Company([super_area, …])

The Company class represents a company that contains information about its workers which are not yet distributed to key company sectors (e.g.

groups.company.Company.SubgroupType(value)

An enumeration.

groups.company.Companies(companies)

Create companies and provide functionality to allocate workers.

groups.hospital.AbstractHospital()

Hospital functionality common for all hospitals (internal to the domain and external).

groups.hospital.Hospital(n_beds, n_icu_beds, …)

The Hospital class represents a hospital and contains information about its patients and workers - the latter being the usual “people”.

groups.hospital.Hospital.SubgroupType(value)

An enumeration.

groups.hospital.Hospitals(hospitals, …[, …])

Create a group of hospitals, and provide functionality to locate patients to a nearby hospital.

groups.hospital.ExternalHospital(id, spec, …)

groups.household.Household([type, area, …])

The Household class represents a household and contains information about its residents.

groups.household.Household.SubgroupType(value)

An enumeration.

groups.household.Households(households)

Contains all households for the given area, and information about them.

groups.school.School(coordinates, …)

Create a School given its description.

groups.school.School.SubgroupType(value)

An enumeration.

groups.school.Schools(schools, school_trees, …)

Create a group of Schools, and provide functionality to access closest school

groups.university.University([coordinates, …])

A group of people such as in a hospital or a school.

groups.university.Universities(universities)

Exceptions (Exception classes):

groups.boundary.BoundaryError

Class for throwing boundary related errors.

groups.care_home.CareHomeError

groups.company.CompanyError

groups.school.SchoolError

Infection

Infection Transmission (including XNExp)

infection.transmission.Transmission()

infection.transmission.TransmissionConstant([…])

infection.transmission.TransmissionGamma(…)

Module to simulate the infectiousness profiles found in :

infection.transmission_xnexp.TransmissionXNExp(…)

Class that defines the time profile of the infectiousness to be of the form x^n exp(-x/alpha)

Other Infection

infection.infection.Infection(transmission, …)

The infection class combines the transmission (infectiousness profile) of the infected person, and their symptoms trajectory.

infection.infection_selector.InfectionSelector(…)

Selects the type of infection a person is given

infection.health_index.HealthIndexGenerator(…)

Computes probabilities for (asymptomatic, mild symptoms, severe symptoms, hospitalisation, intensive care, fatality), using the age and sex of the subject.

infection.symptom_tag.SymptomTag(value)

A tag for the symptoms exhibited by a person.

infection.symptoms.Symptoms([health_index])

Infection Seed

infection_seed.infection_seed.InfectionSeed(…)

Class that generates the seed for the infection.

infection_seed.observed_to_cases.Observed2Cases(…)

Class to convert observed deaths over time into predicted number of latent cases over time, use for the seed of the infection.

Interaction

interaction.interaction.Interaction(…)

Class to handle interaction in groups.

interaction.interactive_group.InteractiveGroup(group)

Extracts the necessary information about a group to perform an interaction time step over it.

Logger

logger.logger.Logger(save_path, file_name, …)

Logger used by the simulator to store the relevant information.

logger.read_logger.ReadLogger(output_path, …)

Read hdf5 file saved by the logger, and produce useful data frames

logger.read_logger_legacy.ReadLoggerLegacy(…)

Read hdf5 file saved by the logger, and produce useful data frames

MPI Setup

mpi_setup.MovablePeople()

Holds information about people who might be present in a domain, but may or may not be be, given circumstances.

Policy

Individual Policies

policy.individual_policies.IndividualPolicy(…)

Template for a general policy.

policy.individual_policies.IndividualPolicies(…)

A collection of like policies active on the same date

policy.individual_policies.StayHome([…])

Template for policies that will force someone to stay at home

policy.individual_policies.SevereSymptomsStayHome([…])

Template for a general policy.

policy.individual_policies.Quarantine(…)

This policy forces people to stay at home for `n_days` days after they show symtpoms, and for `n_days_household` if someone else in their household shows symptoms

policy.individual_policies.Shielding(…)

Template for a general policy.

policy.individual_policies.SkipActivity(…)

Template for policies that will ban an activity for a person

policy.individual_policies.CloseSchools(…)

Template for a general policy.

policy.individual_policies.CloseUniversities(…)

Template for a general policy.

policy.individual_policies.CloseCompanies(…)

Prevents workers with the tag ``person.lockdown_status=furlough” to go to work. If full_closure is True, then no one will go to work.

Interaction Policies

policy.interaction_policies.InteractionPolicy(…)

Template for a general policy.

policy.interaction_policies.InteractionPolicies(…)

A collection of like policies active on the same date

policy.interaction_policies.SocialDistancing(…)

Template for a general policy.

policy.interaction_policies.MaskWearing(…)

Template for a general policy.

Leisure Policies

policy.leisure_policies.LeisurePolicy(…)

Template for a general policy.

policy.leisure_policies.LeisurePolicies(policies)

A collection of like policies active on the same date

policy.leisure_policies.CloseLeisureVenue(…)

Template for policies that will close types of leisure venues

policy.leisure_policies.ChangeLeisureProbability(…)

Changes the probability of the specified leisure activities.

Medical Care Policies

policy.medical_care_policies.MedicalCarePolicy([…])

Template for a general policy.

policy.medical_care_policies.MedicalCarePolicies(…)

A collection of like policies active on the same date

policy.medical_care_policies.Hospitalisation([…])

Hospitalisation policy.

(Policy) Policy

policy.policy.Policy(start_time, …)

Template for a general policy.

policy.policy.Policies([policies])

policy.policy.PolicyCollection(policies)

A collection of like policies active on the same date

Simulator Box

simulator_box.SimulatorBox(world, …)

Class to run an epidemic spread simulation on a box.

Exceptions (Exception classes):

simulator_box.SimulatorError

Simulator

simulator.Simulator(world, interaction, …)

Class to run an epidemic spread simulation on the world.

Time

time.Timer(initial_day, total_days, …)

World

world.World()

This Class creates the world that will later be simulated.