Leisure policies
ChangeLeisureProbability
Bases: LeisurePolicy
Source code in june/policy/leisure_policies.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
__init__(start_time, end_time, activity_reductions)
Changes the probability of the specified leisure activities.
Parameters
- start_time : starting time of the policy.
- end_time : end time of the policy.
- leisure_activities_probabilities : dictionary where the first key is an age range, and the second a
number with the new probability for the activity in that age. Example:
- leisure_activities_probabilities = {"pubs" : {"men" :{"0-50" : 0.5, "50-99" : 0.2}, "women" : {"0-70" : 0.2, "71-99" : 0.8}}}
Source code in june/policy/leisure_policies.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
apply(leisure)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
leisure
|
Leisure
|
|
required |
Source code in june/policy/leisure_policies.py
185 186 187 188 189 190 191 192 |
|
ChangeVisitsProbability
Bases: LeisurePolicy
Source code in june/policy/leisure_policies.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
|
__init__(start_time, end_time, new_residence_type_probabilities)
Changes the probability of the specified leisure activities.
Parameters
- start_time : starting time of the policy.
- end_time : end time of the policy.
- new_residence_type_probabilities new probabilities for residence visits splits, eg, {"household" : 0.8, "care_home" : 0.2}
Source code in june/policy/leisure_policies.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
apply(leisure)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
leisure
|
Leisure
|
|
required |
Source code in june/policy/leisure_policies.py
217 218 219 220 221 222 223 224 225 226 |
|
CloseLeisureVenue
Bases: LeisurePolicy
Source code in june/policy/leisure_policies.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
__init__(start_time, end_time, venues_to_close=('cinemas', 'groceries'))
Template for policies that will close types of leisure venues
Parameters
start_time: date at which to start applying the policy end_time: date from which the policy won't apply venues_to_close: list of leisure venues that will close
Source code in june/policy/leisure_policies.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
apply(leisure)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
leisure
|
Leisure
|
|
required |
Source code in june/policy/leisure_policies.py
93 94 95 96 97 98 99 100 101 102 |
|
LeisurePolicies
Bases: PolicyCollection
Source code in june/policy/leisure_policies.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
apply(date, leisure)
Applies all the leisure policies. Each Leisure policy will change the probability of doing a certain leisure activity. For instance, closing Pubs sets the probability of going to the Pub to zero. We store a dictionary with the relative reductions in leisure probabilities per activity, and this dictionary is then looked at by the leisure module.
This is very similar to how we deal with social distancing / mask wearing policies.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date
|
datetime
|
|
required |
leisure
|
Leisure
|
|
required |
Source code in june/policy/leisure_policies.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
LeisurePolicy
Bases: Policy
Source code in june/policy/leisure_policies.py
8 9 10 11 12 13 14 15 16 17 18 |
|