june.policy.interaction_policies¶
-
class
june.policy.interaction_policies.
InteractionPolicies
(policies: List[june.policy.policy.Policy])¶ A collection of like policies active on the same date
-
__init__
(policies: List[june.policy.policy.Policy])¶ A collection of like policies active on the same date
-
apply
(date: <module 'datetime' from '/home/sadie/anaconda3/envs/june/lib/python3.8/datetime.py'>, interaction: june.interaction.interaction.Interaction)¶
-
classmethod
from_policies
(policies: june.policy.policy.Policies)¶
-
get_active
(date: <module 'datetime' from '/home/sadie/anaconda3/envs/june/lib/python3.8/datetime.py'>)¶
-
original_betas
= None¶
-
policy_type
= 'interaction'¶
-
-
class
june.policy.interaction_policies.
InteractionPolicy
(start_time: str, end_time: str)¶ Template for a general policy.
- start_time:
date at which to start applying the policy
- end_time:
date from which the policy won’t apply
-
__init__
(start_time: str, end_time: str)¶ Template for a general policy.
- start_time:
date at which to start applying the policy
- end_time:
date from which the policy won’t apply
-
get_spec
() → str¶ Returns the speciailization of the policy.
-
is_active
(date: datetime.datetime) → bool¶ Returns true if the policy is active, false otherwise
- date:
date to check
-
static
read_date
(date: Union[str, datetime.datetime]) → datetime.datetime¶ Read date in two possible formats, either string or datetime.date, both are translated into datetime.datetime to be used by the simulator
- date:
date to translate into datetime.datetime
date in datetime format
-
_abc_impl
= <_abc_data object>¶
-
class
june.policy.interaction_policies.
MaskWearing
(start_time: str, end_time: str, compliance: float, beta_factor: float, mask_probabilities: dict = None)¶ Template for a general policy.
- start_time:
date at which to start applying the policy
- end_time:
date from which the policy won’t apply
-
__init__
(start_time: str, end_time: str, compliance: float, beta_factor: float, mask_probabilities: dict = None)¶ Template for a general policy.
- start_time:
date at which to start applying the policy
- end_time:
date from which the policy won’t apply
-
apply
()¶ Implement mask wearing policy
Parameters: betas: e.g. (dict) from DefaultInteraction, e.g. DefaultInteraction.from_file(selector=selector).beta
Assumptions: - Currently we assume that mask wearing is implemented in a similar way to social distanding
but with a mean field effect in beta reduction
Currently we assume that the changes are not group dependent
TODO: - Implement structure for people to adhere to mask wearing with a certain compliance
Note: this would require a change in the mean field effect set up
Check per group in config file
-
get_spec
() → str¶ Returns the speciailization of the policy.
-
is_active
(date: datetime.datetime) → bool¶ Returns true if the policy is active, false otherwise
- date:
date to check
-
static
read_date
(date: Union[str, datetime.datetime]) → datetime.datetime¶ Read date in two possible formats, either string or datetime.date, both are translated into datetime.datetime to be used by the simulator
- date:
date to translate into datetime.datetime
date in datetime format
-
_abc_impl
= <_abc_data object>¶
-
class
june.policy.interaction_policies.
SocialDistancing
(start_time: str, end_time: str, beta_factors: dict = None)¶ Template for a general policy.
- start_time:
date at which to start applying the policy
- end_time:
date from which the policy won’t apply
-
__init__
(start_time: str, end_time: str, beta_factors: dict = None)¶ Template for a general policy.
- start_time:
date at which to start applying the policy
- end_time:
date from which the policy won’t apply
-
apply
()¶ Implement social distancing policy
Parameters: betas: e.g. (dict) from DefaultInteraction, e.g. DefaultInteraction.from_file(selector=selector).beta
Assumptions: - Currently we assume that social distancing is implemented first and this affects all
interactions and intensities globally
Currently we assume that the changes are not group dependent
TODO: - Implement structure for people to adhere to social distancing with a certain compliance - Check per group in config file
-
get_spec
() → str¶ Returns the speciailization of the policy.
-
is_active
(date: datetime.datetime) → bool¶ Returns true if the policy is active, false otherwise
- date:
date to check
-
static
read_date
(date: Union[str, datetime.datetime]) → datetime.datetime¶ Read date in two possible formats, either string or datetime.date, both are translated into datetime.datetime to be used by the simulator
- date:
date to translate into datetime.datetime
date in datetime format
-
_abc_impl
= <_abc_data object>¶