june.groups.leisure.care_home_visits.CareHomeVisitsDistributor¶
-
class
june.groups.leisure.care_home_visits.
CareHomeVisitsDistributor
(male_age_probabilities: dict = None, female_age_probabilities: dict = None, neighbours_to_consider=None, maximum_distance=None, weekend_boost: float = 2.0, drags_household_probability=1.0) 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
-
__init__
(male_age_probabilities: dict = None, female_age_probabilities: dict = None, neighbours_to_consider=None, maximum_distance=None, weekend_boost: float = 2.0, drags_household_probability=1.0) 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
-
classmethod
from_config
(config_filename: str = PosixPath('/home/sadie/JUNE/configs/defaults/groups/leisure/care_home_visits.yaml'))
-
get_leisure_subgroup_type
(person)
-
get_poisson_parameter
(sex, age, is_weekend: bool = False) Poisson parameter (lambda) of a person going to one social venue according to their age and sex and the distribution of visitors in the venue.
- person
an instance of Person
- delta_t
interval of time in units of days
- is_weekend
whether it is a weekend or not
-
get_possible_venues_for_area
(area: june.geography.geography.Area) Given an area, searches for the social venues inside
self.maximum_distance
. It then returnsself.neighbours_to_consider
of them randomly. If there are no social venues inside the maximum distance, it returns the closest one.
-
get_possible_venues_for_household
(household: june.groups.household.Household) Given a household location, searches for the social venues inside
self.maximum_distance
. It then returnsself.neighbours_to_consider
of them randomly. If there are no social venues inside the maximum distance, it returns the closest one.
-
get_social_venue_for_person
(person) Adds a person to one of the social venues in the distributor. To decide, we select randomly from a certain number of neighbours, or the closest venue if the distance is greater than the maximum_distance.
person
-
link_households_to_care_homes
(super_areas) Links households and care homes in the giving super areas. For each care home, we find a random house in the super area and link it to it. The house needs to be occupied by a family, or a couple.
- super_areas
list of super areas
-
person_drags_household
() Check whether person drags household or not.
-
probability_to_go_to_social_venue
(person, delta_time, is_weekend: bool = False) Probabilty of a person going to one social venue according to their age and sex and the distribution of visitors in the venue.
- person
an instance of Person
- delta_t
interval of time in units of days
- is_weekend
whether it is a weekend or not