june.groups.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.
-
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.
-
june.groups.leisure.leisure.
generate_leisure_for_config
(world, config_filename=PosixPath('/home/sadie/JUNE/configs/config_example.yaml'))¶ Generates an instance of the leisure class for the specified geography and leisure groups. Parameters ———- list_of_leisure_groups
list of names of the lesire groups desired. Ex: [“pubs”, “cinemas”]
-
june.groups.leisure.leisure.
generate_leisure_for_world
(list_of_leisure_groups, world)¶ Generates an instance of the leisure class for the specified geography and leisure groups.
- list_of_leisure_groups
list of names of the lesire groups desired. Ex: [“pubs”, “cinemas”]
-
june.groups.leisure.leisure.
random
() → x in the interval [0, 1).¶
-
june.groups.leisure.leisure.
roll_activity_dice
(poisson_parameters, delta_time, n_activities)¶