june.groups.household

class june.groups.household.Household(type=None, area=None, max_size=inf)

The Household class represents a household and contains information about its residents. We assume four subgroups: 0 - kids 1 - young adults 2 - adults 3 - old adults

Type should be on of [“family”, “student”, “young_adults”, “old”, “other”, “nokids”, “ya_parents”, “communal”]. Relatives is a list of people that are related to the family living in the household

class SubgroupType(value)

An enumeration.

adults = 2
kids = 0
old_adults = 3
young_adults = 1
__init__(type=None, area=None, max_size=inf)

Type should be on of [“family”, “student”, “young_adults”, “old”, “other”, “nokids”, “ya_parents”, “communal”]. Relatives is a list of people that are related to the family living in the household

_collate_from_subgroups(attribute: str) → List[june.demography.person.Person]

Return a set of all of the people in the subgroups with a particular health status

attribute

The name of the attribute in the subgroup, e.g. “in_hospital”

The union of all the sets with the given attribute name in all of the sub groups.

classmethod _next_id() → int

Iterate an id for this class. Each group class has its own id iterator starting at 0

add(person, subgroup_type=<SubgroupType.adults: 2>, activity='residence')

Add a person to a given subgroup. For example, in a school a student is added to the subgroup matching their age.

person

A person

group_type

clear()
get_spec() → str

Returns the speciailization of the group.

make_household_residents_stay_home(to_send_abroad=None)

Forces the residents to stay home if they are away doing leisure. This is used to welcome visitors.

quarantine(time, quarantine_days, household_compliance)
remove_person(person: june.demography.person.Person)

Remove a person from this group by removing them from the subgroup to which they belong

person

A person

_abc_impl = <_abc_data object>
property adults
area
care_homes_to_visit
property contains_people

Does this group contain at least one person?

property coordinates
property dead
external = False
households_to_visit
id
ids_checked
property in_hospital
property infected
property kids
max_size
property must_timestep
property n_residents
property name

The name is computed on the fly to reduce memory footprint. It combines the name fo the class with the id of the instance.

property old_adults
property people

All the people in this group

quarantine_starting_date
property recovered
residents
property size
property size_infected
property size_recovered
property size_susceptible
spec
subgroups
property super_area
property susceptible
type
property young_adults
class june.groups.household.Households(households: List[june.groups.household.Household])

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

__init__(households: List[june.groups.household.Household])

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

_make_member_ids_dict(members)

Makes a dictionary with the ids of the members.

add(group)
clear()
classmethod for_box_mode()
classmethod for_geography()
classmethod from_file()
get_from_id(id)
get_spec() → str

Returns the speciailization of the super group.

property group_spec
property member_ids
june.groups.household.random() → x in the interval [0, 1).