june.groups.leisure.leisure.Leisure¶
-
class
june.groups.leisure.leisure.
Leisure
(leisure_distributors: Dict[str, june.groups.leisure.social_venue_distributor.SocialVenueDistributor]) Class to manage all possible activites that happen during leisure time.
- leisure_distributors
List of social venue distributors.
-
__init__
(leisure_distributors: Dict[str, june.groups.leisure.social_venue_distributor.SocialVenueDistributor]) - leisure_distributors
List of social venue distributors.
-
distribute_social_venues_to_areas
(areas: june.geography.geography.Areas, super_areas: june.geography.geography.SuperAreas)
-
drags_household_to_activity
(person, activity)
-
generate_leisure_probabilities_for_timestep
(delta_time: float, working_hours: bool, is_weekend: bool)
-
get_leisure_probability_for_age_and_sex
(age, sex, delta_time, is_weekend, working_hours) Computes the probabilities of going to different leisure activities, and dragging the household with the person that does the activity.
-
get_subgroup_for_person_and_housemates
(person: june.demography.person.Person, to_send_abroad: dict = None) Main function of the Leisure class. For every possible activity a person can do, we chech the Poisson parameter lambda = probability / day * deltat of that activty taking place. We then sum up the Poisson parameters to decide whether a person does any activity at all. The relative weight of the Poisson parameters gives then the specific activity a person does. If a person ends up going to a social venue, we do a second check to see if his/her entire household accompanies him/her. The social venue subgroups are attached to the involved people, but they are not added to the subgroups, since it is possible they change their plans if a policy is in place or they have other responsibilities. The function returns None if no activity takes place.
- person
an instance of person
-
send_household_with_person_if_necessary
(person, subgroup, probability, to_send_abroad=None) When we know that the person does an activity in the social venue X, then we ask X whether the person needs to drag the household with him or her.
-
update_household_and_care_home_visits_targets
(people: List[june.demography.person.Person]) Updates the candidates to go for visiting households and care homes. This is necessary in case the relatives have died.