june.groups.group.group.Group¶
-
class
june.groups.group.group.
Group
A group of people enjoying social interactions. It contains three lists, all people in the group, the healthy ones and the infected ones (we may have to add the immune ones as well).
This is very basic and we will have to specify derived classes with additional information - like household, work, commute - where some, like household groups are stable and others, like commute groups, are randomly assorted on a step-by-step base.
The logic is that the group will enjoy one Interaction per time step, where the infection spreads, with a probablity driven by transmission probabilities and inteaction intensity, plus, possilby, individual susceptibility to become infected.
TODO: we will have to decide in how far specific groups define behavioral patterns, which may be time-dependent. So, far I have made a first pass at a list of group specifiers - we could promote it to a dicitonary with default intensities (maybe mean+width with a pre-described range?).
A group of people such as in a hospital or a school.
If a spec attribute is not defined in the child class then it is generated by converting the class name into snakecase.
-
class
SubgroupType
(value) Defines the indices of subgroups within the subgroups array
-
default
= 0
-
-
__init__
() A group of people such as in a hospital or a school.
If a spec attribute is not defined in the child class then it is generated by converting the class name into snakecase.
-
_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: june.demography.person.Person, activity: str, subgroup_type: june.groups.group.group.Group.SubgroupType) 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.
-
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
contains_people
Does this group contain at least one person?
-
property
dead
-
external
= False
-
id
-
property
in_hospital
-
property
infected
-
property
must_timestep
-
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
people
All the people in this group
-
property
recovered
-
property
size
-
property
size_infected
-
property
size_recovered
-
property
size_susceptible
-
spec
-
subgroups
-
property
susceptible
-
class