emodpy_hiv.campaign.node_intervention module#
- class emodpy_hiv.campaign.node_intervention.MultiNodeInterventionDistributor(campaign: <module 'emod_api.campaign' from '/home/docs/checkouts/readthedocs.org/user_builds/institute-for-disease-modeling-emodpy-hiv/envs/latest/lib/python3.9/site-packages/emod_api/campaign.py'>, node_intervention_list: list[emodpy.campaign.base_intervention.NodeIntervention], common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#
Bases:
NodeIntervention
The MultiNodeInterventionDistributor intervention class is a node-level intervention that distributes multiple other node-level interventions when the distributor only allows specifying one intervention. This class can be thought of as an “adapter”, where it can adapt interventions or coordinators that were designed to distribute one intervention to instead distribute many.
- Parameters:
campaign (api_campaign, required) – An instance of the emod_api.campaign module.
node_intervention_list (list[NodeIntervention], optional) – A list of NodeIntervention objects for the multi-node-level interventions to be distributed by this intervention.
common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 4 common parameters: intervention_name, dont_allow_duplicates, new_property_value, disqualifying_properties. The following parameters are not valid for this intervention: cost Default value: None
- class emodpy_hiv.campaign.node_intervention.BroadcastNodeEvent(campaign: <module 'emod_api.campaign' from '/home/docs/checkouts/readthedocs.org/user_builds/institute-for-disease-modeling-emodpy-hiv/envs/latest/lib/python3.9/site-packages/emod_api/campaign.py'>, broadcast_event: str | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#
Bases:
NodeIntervention
The BroadcastNodeEvent node intervention class broadcasts node-level events. This can be used with the campaign class, SurveillanceEventCoordinator, that can monitor and listen for events received from BroadcastNodeEvent and then perform an action based on the broadcasted event. You can also use this for the reporting, by recording broadcasted events with
emodpy.reporters.common.ReportNodeEventRecorder
oremodpy.reporters.common.ReportSurveillanceEventRecorder
. You must use this coordinator class with listeners that are operating on the same core. You can also use NLHTIVNode. For more information, see Simulation core components.- Parameters:
campaign (api_campaign, required) – An instance of the emod_api.campaign module.
broadcast_event (str, optional) – The name of the Node Event to broadcast. configuration parameter. Default value: None
common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates, cost. Default value: None
- class emodpy_hiv.campaign.node_intervention.ImportPressure(campaign: <module 'emod_api.campaign' from '/home/docs/checkouts/readthedocs.org/user_builds/institute-for-disease-modeling-emodpy-hiv/envs/latest/lib/python3.9/site-packages/emod_api/campaign.py'>, import_age: float = 365, genome: int = 0, durations: list[int] | None = None, daily_import_pressures: list[float] | None = None, antigen: int = 0)#
Bases:
NodeIntervention
The ImportPressure intervention class extends the ImportCases outbreak event. Rather than importing a deterministic number of cases on a scheduled day, ImportPressure applies a set of per-day rates of importation of infected individuals, over a corresponding set of durations. ImportPressure inherits from Outbreak; the Antigen and Genome parameters are defined as they are for all Outbreak events.
WARNING
Be careful when configuring import pressure in multi-node simulations. Daily_Import_Pressures defines a rate of per-day importation for each node that the intervention is distributed to. In a 10 node simulation with Daily_Import_Pressures = [0.1, 5.0], the total importation rate summed over all nodes will be 1/day and 50/day during the two time periods. You must divide the per-day importation rates by the number of nodes.
- Parameters:
campaign (api_campaign, required) – An instance of the emod_api.campaign module.
import_age (float, optional) – The age (in days) of infected import cases. Minimum value: 0 Maximum value: 43800 Default value: 365
genome (int, optional) – The genetic substrain ID of the outbreak infection. Together with Antigen, they are a unitary object representing a strain of infection, which allows for differentiation among infections. Minimum value: -1 Maximum value: 16777200.0 Default value: 0
durations (list[int], optional) – The durations over which to apply import pressure. Default value: None
daily_import_pressures (list[float], optional) – The rate of per-day importation for each node that the intervention is distributed to. Default value: None
antigen (int, optional) – The antigenic base strain ID of the outbreak infection. Minimum value: 0 Maximum value: 10 Default value: 0
- class emodpy_hiv.campaign.node_intervention.MigrateFamily(campaign: <module 'emod_api.campaign' from '/home/docs/checkouts/readthedocs.org/user_builds/institute-for-disease-modeling-emodpy-hiv/envs/latest/lib/python3.9/site-packages/emod_api/campaign.py'>, duration_before_leaving_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution, duration_at_node_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution, nodeid_to_migrate_to: int = 0, is_moving: bool = False, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#
Bases:
NodeIntervention
The MigrateFamily intervention class tells family groups of residents of the targeted node to go on a round trip migration (“family trip”). The duration of time residents wait before migration and the time spent at the destination node can be configured; the pre-migration waiting timer does not start until all residents are at the home node.
Use of this intervention does require that human migration be enabled by setting the configuration parameters Migration_Model to FIXED_RATE_MIGRATION and Migration_Pattern to SINGLE_ROUND_TRIP.
- Parameters:
campaign (api_campaign, required) – An instance of the emod_api.campaign module.
duration_before_leaving_distribution (BaseDistribution, required) – The distribution type to use for assigning the duration of time a family waits before migrating to the destination node after all residents are home. Each assigned value is a random draw from the distribution. Please use the following distribution classes from emodpy.utils.distributions to define the distribution: * ConstantDistribution * UniformDistribution * GaussianDistribution * ExponentialDistribution * PoissonDistribution * LogNormalDistribution * DualConstantDistribution * WeibullDistribution * DualExponentialDistribution
duration_at_node_distribution (BaseDistribution, required) – The distribution type to use for assigning the duration of time an individual or family spends at a destination node after intervention-based migration. Each assigned value is a random draw from the distribution. Please use the following distribution classes from emodpy.utils.distributions to define the distribution: * ConstantDistribution * UniformDistribution * GaussianDistribution * ExponentialDistribution * PoissonDistribution * LogNormalDistribution * DualConstantDistribution * WeibullDistribution * DualExponentialDistribution
nodeid_to_migrate_to (int, optional) – The destination node ID for intervention-based migration. Minimum value: 0 Maximum value: 4294970000.0 Default value: 0
is_moving (bool, optional) – Set to true (1) to indicate all the individuals of the family are permanently moving to a new home node for intervention-based migration. Once at the new home node, trips will be made with this node as the root (i.e. round trips come back to this node). Default value: True
common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that contains the 4 common parameters: disqualifying_properties, dont_allow_duplicates, intervention_name, new_property_value. The following parameters are not valid for this intervention: cost Default value: None
- class emodpy_hiv.campaign.node_intervention.NodePropertyValueChanger(campaign: <module 'emod_api.campaign' from '/home/docs/checkouts/readthedocs.org/user_builds/institute-for-disease-modeling-emodpy-hiv/envs/latest/lib/python3.9/site-packages/emod_api/campaign.py'>, target_np_key_value: str, revert: float = 0, maximum_duration: float = 3.40282e+38, daily_probability: float = 1, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#
Bases:
NodeIntervention
The NodePropertyValueChanger intervention class sets a given node property to a new value. You can also define a duration in days before the node property reverts back to its original value, the probability that a node will change its node property to the target value, and the number of days over which nodes will attempt to change their individual properties to the target value. This node-level intervention functions in a similar manner as the individual-level intervention, PropertyValueChanger.
- Parameters:
campaign (api_campaign, required) – An instance of the emod_api.campaign module.
target_np_key_value (str, required) – The NodeProperty key:value pair, as defined in the demographics file, to assign to the node.
revert (float, optional) – The number of days to keep the value of the property/key, specified in Target_NP_Key_Value and set by the intervenion, for the node. When the time has expired, the intervention will reset the property/key back to the value it had when the intervention was first applied. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 0
maximum_duration (float, optional) – The maximum amount of time in days nodes have to update the property value. This timing works in conjunction with Daily_Probability. Minimum value: -1 Maximum value: 3.40282e+38 Default value: 3.40282e+38
daily_probability (float, optional) – The daily probability that the node’s property value changes to the Target_NP_Key_Value. Minimum value: 0 Maximum value: 1 Default value: 1
common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that contains the 4 common parameters: disqualifying_properties, dont_allow_duplicates, intervention_name, new_property_value. The following parameters are not valid for this intervention: cost Default value: None
- class emodpy_hiv.campaign.node_intervention.Outbreak(campaign: <module 'emod_api.campaign' from '/home/docs/checkouts/readthedocs.org/user_builds/institute-for-disease-modeling-emodpy-hiv/envs/latest/lib/python3.9/site-packages/emod_api/campaign.py'>, probability_of_infection: float = 1, number_cases_per_node: int = 1, import_age: float = 365, genome: int = 0, antigen: int = 0)#
Bases:
NodeIntervention
The Outbreak class allows the introduction of a disease outbreak event by the addition of new infected or susceptible individuals to a node. Outbreak is a node-level intervention; to distribute an outbreak to specific categories of existing individuals within a node, use OutbreakIndividual.
- Parameters:
campaign (api_campaign, required) – An instance of the emod_api.campaign module.
probability_of_infection (float, optional) – The probability that new individuals are infected. 1.0 implies all new individuals are infected while 0.0 adds all of the people as susceptible individuals. Minimum value: 0 Maximum value: 1 Default value: 1
number_cases_per_node (int, optional) – The number of new imported individuals. .. note:: This will increase the population with demographics of 50/50 male/female and user-defined ages Minimum value: 0 Maximum value: 2147480000.0 Default value: 1
import_age (float, optional) – The age (in days) of infected import cases. Minimum value: 0 Maximum value: 43800 Default value: 365
genome (int, optional) – The genetic substrain ID of the outbreak infection. Together with Antigen, they are a unitary object representing a strain of infection, which allows for differentiation among infections. Minimum value: -1 Maximum value: 16777200.0 Default value: 0
antigen (int, optional) – The antigenic base strain ID of the outbreak infection. Minimum value: 0 Maximum value: 10 Default value: 0