emod_api.interventions.common module#

class emod_api.interventions.common.TargetGender(value)[source]#

Bases: Enum

An enumeration.

Male = 'Male'#
Female = 'Female'#
All = 'All'#
emod_api.interventions.common.BroadcastEvent(camp, Event_Trigger: str = 'Births')[source]#

Wrapper function to create and return a BroadcastEvent intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Event_Trigger – A valid trigger/event/signal.

Returns:

Schema-based smart dictionary representing a new BroadastEvent intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.broadcast_node_event(campaign, broadcast_event: str, cost_to_consumer: float = 0.0, disqualifying_properties: List[str] | None = None, dont_allow_duplicates: bool = False, intervention_name: str = 'BroadcastNodeEvent', new_property_value: str = '')[source]#

Wrapper function to create and return a BroadcastNodeEvent intervention.

Parameters:
  • campaign – emod_api.campaign object with schema_path set

  • broadcast_event – String that will be broadcast as Node-level event

  • cost_to_consumer – The unit cost of the intervention campaign that will be assigned to the specified nodes.

  • disqualifying_properties – A list of NodeProperty key:value pairs that cause an intervention to be aborted. Generally used to control the flow of health care access. For example, to prevent the same individual from accessing health care via two different routes at the same time.

  • dont_allow_duplicates – If a node’s container has the same intervention, set to True to prevent them from receiving another copy of the intervention. Supported by all intervention classes.

  • intervention_name – The optional name used to refer to this intervention as a means to differentiate it from others that use the same class.

  • new_property_value – An optional NodeProperty key:value pair that will be assigned when the intervention is distributed. Generally used to indicate the broad category of health care cascade to which an intervention belongs to prevent individuals from accessing care through multiple pathways.

Returns:

BroadcastNodeEvent intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.BroadcastEventToOtherNodes(camp, Event_Trigger, Node_Selection_Type='DISTANCE_ONLY', Max_Distance_To_Other_Nodes_Km=-1, Include_My_Node=1)[source]#

Wrapper function to create and return a BroadcastEventToOtherNodes intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Event_Trigger – A valid trigger/event/signal.

  • Node_Selection_Type – TBD.

  • Max_Distance_To_Other_Nodes_Km – TBD.

  • Include_My_Node – TBD.

Returns:

Schema-based smart dictionary representing a new BroadastEvent intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.add_broadcast_coordinator_event(campaign, broadcast_event: str, start_day: int = 0, cost_to_consumer: float | None = None, coordinator_name: str = 'BroadcastCoordinatorEvent')[source]#

Creates and adds BroadcastCoordinatorEvent intervention to the campaign

Parameters:
  • campaign – emod_api.campaign object with schema_path set.

  • broadcast_event – String that will be broadcast as Coordinator-level event.

  • start_day – The day in the simulation on which to send out this event.

  • cost_to_consumer – The unit cost of broadcasting the event.

  • coordinator_name – The unique identifying coordinator name, which is useful with the output report, ReportCoordinatorEventRecorder.csv

Returns:

Nothing

emod_api.interventions.common.MultiInterventionDistributor(camp, Intervention_List)[source]#

Wrapper function to create and return a MultiInterventionDistributor intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Intervention_List – List of 1 or more valid intervention dictionaries to be

  • together. (distributed) –

Returns:

Schema-based smart dictionary representing a new MultiInterventionDistributor intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.DelayedIntervention(camp, Configs: List[dict], Delay_Dict: dict)[source]#

Wrapper function to create and return a DelayedIntervention containing a list of individual-level interventions.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Configs – A list of individual-level interventions

  • Delay_Dict – Dictionary with delay parameters, please use emod_api.utils.Distributions to generate the delay parameters.

Returns:

Schema-based smart dictionary representing a new DelayedIntervention intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.HSB(camp, Event_Or_Config='Event', Config=None, Event='NoTrigger', Tendency=1.0, Single_Use=True, Name='HSB')[source]#

Wrapper function to create and return a HealthSeekingBehaviour intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Event_Or_Config – “Event” or “Config”.

  • Config – Complete, valid intervention configuration to be distributed.

  • Event – Event/Trigger/Signal to be broadcast, alternative to an intervention.

  • Tendency – Daily probability of ‘seeking care’ aka distributing payload intervention.

  • Single_Use – One-and-done, or continuous?

  • Name – Intervention Name. Useful if you want to provide uniqueness and not worry about

  • management. (duplicate intervention) –

Returns:

Schema-based smart dictionary representing a new HSB intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.NLHTI(camp, Triggers: List[str], Interventions: List[dict], Property_Restrictions=None, Demographic_Coverage=1.0, Target_Age_Min: float = 0, Target_Age_Max: float = 45625, Target_Gender='All', Target_Residents_Only=False, Duration: float = -1, Blackout_Event_Trigger=None, Blackout_Period=None, Blackout_On_First_Occurrence=None, Disqualifying_Properties=None)[source]#

Wrapper function to create and return a NodeLevelHealthTriggeredIntervention intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Triggers – List of Triggers/Events/Signals

  • Interventions – List of interventions to distrbute when signal is heard.

  • Property_Restrictions – Individual Properties that an agent must have to qualify for intervention.

  • Demographic_Coverage – Percentage of individuals to receive intervention.

  • Target_Age_Min – Minimum age (in years).

  • Target_Age_Max – Maximum age (in years).

  • Target_Gender – All, Male, or Female.

  • Target_Residents_Only – Not used.

  • Duration – How long this listen-and-distribute should last.

  • Blackout_Event_Trigger – Not used.

  • Blackout_Period – Not used.

  • Blackout_On_First_Occurrence – Not used.

  • Disqualifying_Properties – Not used.

Returns:

Schema-based smart dictionary representing a new NLHTI intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.PropertyValueChanger(camp, Target_Property_Key, Target_Property_Value, Daily_Probability=1.0, Maximum_Duration=1, Revert=-1, Intervention_Name='', Event_Trigger_Distributed='', Event_Trigger_Expired='')[source]#

Wrapper function to create and return a PropertyValueChanger intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • IP. (Target_Property_Value. The value part of the new key-value pair of the) –

  • IP.

  • IP.

  • key (New_Property_Value.. Optional IP) – value part to be set, common to all interventions.

  • Target_Property_Value. (Daily_Probability. The daily probability that an individual will move to the) –

  • works (Maximum_Duration. The maximum amount of time individuals have to move to a new group. This timing) – in conjunction with Daily_Probability.

  • group. (Revert. The number of days before an individual moves back to their original) –

  • policy. (Intervention_Name. Optional Intervention_Name. Useful if managing a replacement) –

  • distributed. (Event_Trigger_Distributed. Optional broadcast trigger to be published when PVC is) –

  • expired. (Event_Trigger_Expired. Optional broadcast trigger to be published when PVC is) –

Returns:

Schema-based smart dictionary representing a new PropertyValueChanger intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.ScheduledCampaignEvent(camp, Start_Day: int, Node_Ids=None, Nodeset_Config=None, Number_Repetitions: int = 1, Timesteps_Between_Repetitions: int = -1, Event_Name: str = 'Scheduled_Campaign_Event', Property_Restrictions=None, Demographic_Coverage: float = 1.0, Target_Age_Min=0, Target_Age_Max=45625, Target_Gender: str = 'All', Target_Residents_Only: bool = False, Intervention_List=None)[source]#

Wrapper function to create and return a ScheduledCampaignEvent intervention. The alternative to a ScheduledCampaignEvent is a TriggeredCampaignEvent.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Start_Day – When to start.

  • Event_Name – Name for overall campaign event, of no functional meaning. Not in schema and not yet used.

  • Node_Ids – Nodes to target with this intervenion

  • Nodeset_Config

    Nodes to target with this intervenion, return from utils.do_nodes().

    Deprecated since version 2.x: Use parameter Node_Ids instead

  • Property_Restrictions – Individual Properties a person must have to receive the intervention(s).

  • Number_Repetitions – N/A

  • Timesteps_Between_Repetitions – N/A

  • Demographic_Coverage – Percentage of individuals to receive intervention.

  • Target_Age_Min – Minimum age (in years).

  • Target_Age_Max – Maximum age (in years).

  • Target_Gender – All, Male, or Female.

  • Intervention_List – List of 1 or more valid intervention dictionaries to be

  • together. (distributed) –

Returns:

Schema-based smart dictionary representing a new ScheduledCampaignEvent intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.TriggeredCampaignEvent(camp, Start_Day: int, Event_Name: str, Triggers: List[str], Intervention_List: List[dict], Node_Ids: List[int] | None = None, Nodeset_Config: dict | None = None, Node_Property_Restrictions: List[dict] | None = None, Property_Restrictions: List[dict] | None = None, Number_Repetitions: int = 1, Timesteps_Between_Repetitions: int = -1, Demographic_Coverage: float = 1.0, Target_Age_Min: float = 0, Target_Age_Max: float = 45625, Target_Gender: str = 'All', Target_Residents_Only: bool = False, Duration: float = -1, Blackout_Event_Trigger: str | None = None, Blackout_Period: float = 0, Blackout_On_First_Occurrence=0, Disqualifying_Properties: List[str] | None = None, Delay: dict | None = None)[source]#

Wrapper function to create and return a TriggeredCampaignEvent intervention. The alternative to a TriggeredCampaignEvent is a ScheduledCampaignEvent.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Start_Day – When to start.

  • Event_Name – Name for overall campaign event, of no functional meaning. Not in schema and not yet used.

  • Node_Ids – Nodes to target with this intervenion

  • Nodeset_Config

    Nodes to target with this intervenion, return from utils.do_nodes().

    Deprecated since version 2.x: Use parameter Node_Ids instead

  • Triggers – List of triggers/events/signals to listen to in order to trigger distribution.

  • Intervention_List – List of 1 or more valid individual-level intervention dictionaries to be

  • together. (distributed) –

  • Node_Property_Restrictions – N/A.

  • Property_Restrictions – Individual Properties a person must have to receive the intervention(s).

  • Demographic_Coverage – Percentage of individuals to receive intervention.

  • Target_Age_Min – Minimum age (in years).

  • Target_Age_Max – Maximum age (in years).

  • Target_Gender – All, Male, or Female.

  • Target_Residents_Only – TBD.

  • Duration – How long this listen-and-distribute should last.

  • Blackout_Event_Trigger – Not used.

  • Blackout_Period – Not used.

  • Blackout_On_First_Occurrence – Not used.

  • Disqualifying_Properties – Not used.

  • Delay – Optional delay between trigger and actual distribution, a distribution dictionary generated by emod_api.utils.Distributions class.

Returns:

Schema-based smart dictionary representing a new TriggeredCampaignEvent intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.add_triggered_coordinator_event(campaign, start_day: int = 0, listening_duration: float = -1, start_trigger_condition_list: list | None = None, stop_trigger_condition_list: list | None = None, demographic_coverage: float | None = None, target_num_individuals: int | None = None, node_ids: list | None = None, repetitions: int | None = None, timesteps_between_repetitions: int | None = None, ind_property_restrictions: list | None = None, node_property_restrictions: list | None = None, target_age_min: float | None = None, target_age_max: float | None = None, target_gender: TargetGender = TargetGender.All, target_residents_only: bool = False, completion_event: str = '', coordinator_name: str = 'TriggeredEventCoordinator', node_interventions: any | None = None, individual_interventions: any | None = None)[source]#

Wrapper function to create and adds a TriggeredCoordinatorEvent. The intervention is triggered by COORDINATOR-level event, and sends out a COORDINATOR-level event when done.

Parameters:
  • campaign – campaign object to which the intervention will be added, and schema_path container

  • start_day – The day the intervention is given out.

  • listening_duration – The number of time steps that the coordinator will monitor for triggers before expiring. Default is -1, which is indefinitely.

  • start_trigger_condition_list – A list of the COORDINATOR-level events that will trigger intervention distribution.

  • stop_trigger_condition_list – A list of the COORDINATOR-level events that will stop intervention from happening if the intervention is repeating.

  • demographic_coverage – This value is the probability that each individual in the target population will receive the intervention. It does not guarantee that the exact fraction of the target population set by Demographic_Coverage receives the intervention.

  • target_num_individuals – The exact number of people to select out of the targeted group. If this value is set, demographic_coverage parameter is ignored

  • node_ids – List of nodes to which to distribute the intervention. [] or None, indicates all nodes will get the intervention

  • repetitions – The number of times an intervention is given, used with timesteps_between_repetitions. -1 means the intervention repeats forever. Sets Number_Repetitions

  • timesteps_between_repetitions – The interval, in timesteps, between repetitions. Ignored if repetitions = 1. Sets Timesteps_Between_Repetitions

  • ind_property_restrictions – A list of dictionaries of IndividualProperties, which are needed for the individual to receive the intervention. Sets the Property_Restrictions_Within_Node

  • node_property_restrictions – “A list of the NodeProperty key:value pairs, as defined in the demographics file, that nodes must have to be targeted by the intervention.

  • target_age_min – The lower end of ages targeted for an intervention, in years. Sets Target_Age_Min

  • target_age_max – The upper end of ages targeted for an intervention, in years. Sets Target_Age_Max

  • target_gender – The gender targeted for an intervention: All, Male, or Female.

  • target_residents_only – When set to True, the intervention is only distributed to individuals that began the simulation in the node (i.e. those that claim the node as their residence)

  • completion_event – A COORDINATOR-level event to send out when the coordinator has expired.

  • coordinator_name – The unique identifying coordinator name used to identify the different coordinators in reports.

  • node_interventions – A node-level intervention or a list of node-level interventions that will be distributed when one of the triggers from start_trigger_condition_list is heard.

  • individual_interventions – A individual-level intervention or a list of individual-level interventions that will be distributed when one of the triggers from start_trigger_condition_list is heard.

Returns:

None

emod_api.interventions.common.StandardDiagnostic(camp, Base_Sensitivity: float = 1.0, Base_Specificity: float = 1.0, Days_To_Diagnosis: float = 0.0, Event_Trigger_Distributed: str | None = None, Event_Trigger_Expired: str | None = None, Positive_Diagnosis_Intervention=None, Positive_Diagnosis_Event: str = 'PositiveResult', Negative_Diagnosis_Intervention=None, Negative_Diagnosis_Event: str = 'NegativeResult', Treatment_Fraction: float = 1.0)[source]#

Wrapper function to create and return a StandardDiagnostic intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • Base_Sensitivity – base sensitivity [0..1]

  • Base_Specificity – base specificity [0..1]

  • Days_To_Diagnosis – days to diagnosis

  • Event_Trigger_Distributed – A trigger that is fired when intervention was distributed

  • Event_Trigger_Expired – A trigger that is fired when intervention has expired

  • Positive_Diagnosis_Intervention – Intervention that is distributed in case of a positive diagnosis. If set, no events may be configured.

  • Positive_Diagnosis_Event – A trigger that is fired in case of a positive diagnosis

  • Negative_Diagnosis_Intervention – Intervention that is distributed in case of a Negative diagnosis. If set, no events may be configured. Not used outside of Malaria-Ongoing yet.

  • Negative_Diagnosis_Event – A trigger that is fired in case of a Negative diagnosis. Not used outside of Malaria-Ongoing yet.

  • Treatment_Fraction – treatment fraction [0..1]

Returns:

Schema-based smart dictionary representing a new MultiInterventionDistributor intervention ready to be added to a campaign.

Return type:

ReadOnlyDict

emod_api.interventions.common.triggered_campaign_delay_event(camp, start_day, trigger, delay, intervention, ip_targeting=None, coverage=1.0)[source]#

Create and return a campaign event that responds to a trigger after a delay with an intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • start_day – Day the event will start.

  • delay – Dictionary with delay parameters, please use emod_api.utils.Distributions to generate the delay parameters.

  • trigger – E.g., “NewInfection”.

  • intervention – List of 1 or more valid intervention dictionaries to be distributed together.

  • ip_targeting – Optional Individual Properties required for someone to receive the intervention(s).

  • coverage – Fraction of the population that will receive the intervention.

Returns:

Campaign event.

emod_api.interventions.common.triggered_campaign_event_with_optional_delay(camp, start_day, triggers, intervention, delay=None, duration=-1, ip_targeting=None, coverage=1.0, target_age_min=0, target_age_max=45625, target_sex='All', target_residents_only=False, blackout=True, check_at_trigger=False)[source]#

Create and return a campaign event that responds to a trigger after a delay with an intervention.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • start_day – When to start.

  • triggers – List of signals to listen for/trigger on. E.g., “NewInfection”.

  • intervention – List of 1 or more valid intervention dictionaries to be distributed together.

  • delay – Optional dictionary of 1 or 2 params that are the literal Delay_Distribution parameters,

  • "Delay_Period_Exponential" (but without the distribution, which is inferred. E.g., {) – 5 }. If omitted,

  • immediate. (intervention is) –

  • duration – How long to listen.

  • ip_targeting – Optional Individual Properties required for someone to receive the intervntion(s).

  • coverage – Fraction of target population to reach.

  • target_age_min – Minimum age to target.

  • target_age_max – Maximum age to target.

  • target_sex – Optional target just “MALE” or “FEMALE” individuals.

  • target_residents_only – Set to True to target only the individuals who started the simulation in this node and are still in the node.

  • blackout – Set to True if you don’t want the triggered intervention to be distributed to the same person more than once a day.

  • check_at_trigger – if triggered event is delayed, you have an option to check individual/node’s eligibility at the initial trigger or when the event is actually distributed after delay.

Returns:

Campaign event.

emod_api.interventions.common.change_individual_property_at_age(camp, new_ip_key, new_ip_value, change_age_in_days, revert_in_days, ip_targeting_key, ip_targeting_value, coverage=1.0)[source]#

Create and return a campaign event that changes a person’s Individual Properties once they turns a certain age. e.g., change_individual_property_at_age(cb, ‘ForestGoing’, ‘LovesForest’, coverage=0.6, change_age_in_days=15*365, revert=20*365)

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • new_ip_key – The new IP key.

  • new_ip_value – The new IP value.

  • change_age_in_days – The age at which the individual transitions (in units of days).

  • revert_in_days – How many days they remain with the new property.

  • ip_targeting_key – The IP key a person must have to receive this.

  • ip_targeting_value – The IP value a person must have to receive this.

  • coverage – Optional fraction to limit this to a subset of the target population.

Returns:

Campaign event.

emod_api.interventions.common.change_individual_property_triggered(camp, triggers: list, new_ip_key: str, new_ip_value: str, start_day: int = 0, daily_prob: float = 1, max_duration: int = 9.3228e+35, revert_in_days: int = -1, node_ids: list | None = None, ip_restrictions: list | None = None, coverage: float = 1.0, target_age_min: float = 0, target_age_max: float = 45625, target_sex: str = 'All', target_residents_only: bool = False, delay=None, listening_duration: int = -1, blackout: bool = True, check_at_trigger: bool = False)[source]#

Change Individual Properties when a certain trigger is observed.

Parameters:
  • camp – The instance containing the campaign builder and accumulator.

  • triggers – A list of the events that will trigger the intervention.

  • new_ip_key – The individual property key to assign to the individual. For example, InterventionStatus.

  • new_ip_value – The individual property value to assign to the individual. For example, RecentDrug.

  • start_day – The day on which to start distributing the intervention (Start_Day parameter).

  • node_ids – The list of nodes to apply this intervention to. If not provided, defaults to all nodes.

  • daily_prob – The daily probability that an individual’s property value will be updated (Daily_Probability parameter).

  • max_duration – The maximum amount of time individuals have to move to a new daily_prob; individuals not moved to the new value by the end of max_duration keep the same value.

  • revert_in_days – The number of days before a node reverts to its original property value. Default of 0 means the new value is kept forever.

  • ip_restrictions – The IndividualProperty key:value pairs to target.

  • coverage – The proportion of the population that will receive the intervention (Demographic_Coverage parameter).

  • target_age_min – Minimum age to target.

  • target_age_max – Maximum age to target.

  • target_sex – Optional target just “MALE” or “FEMALE” individuals.

  • target_residents_only – Set to True to target only the individuals who started the simulation in this node and are still in the node.

  • delay – The number of days the campaign is delayed after being triggered.

  • listening_duration – The number of time steps that the triggered campaign will be active for. Default is -1, which is indefinitely.

  • blackout (advanced) – Set to True if you don’t want the triggered intervention to be distributed to the same person more than once a day.

  • check_at_trigger (advanced) – if triggered event is delayed, you have an option to check individual/node’s eligibility at the initial trigger or when the event is actually distributed after delay.

  • Returns – N/A.

emod_api.interventions.common.change_individual_property_scheduled(camp, new_ip_key, new_ip_value, start_day: int = 0, number_repetitions: int = 1, timesteps_between_reps: int = -1, node_ids: list | None = None, daily_prob: float = 1, max_duration: int = 9.3228e+35, revert_in_days: int = -1, ip_restrictions: list | None = None, coverage: float = 1.0, target_age_min: float = 0, target_age_max: float = 45625, target_sex: str = 'All', target_residents_only: bool = False)[source]#

Change Individual Properties at a given time.

Parameters:
  • camp – The instance containing the campaign builder and accumulator.

  • new_ip_key – The individual property key to assign to the individual. For example, InterventionStatus.

  • new_ip_value – The individual property value to assign to the individual. For example, RecentDrug.

  • start_day – The day on which to start distributing the intervention (Start_Day parameter).

  • node_ids – The list of nodes to apply this intervention to. If not provided, defaults to all nodes.

  • daily_prob – The daily probability that an individual’s property value will be updated (Daily_Probability parameter).

  • max_duration – The maximum amount of time individuals have to move to a new daily_prob; individuals not moved to the new value by the end of max_duration keep the same value.

  • revert_in_days – The number of days before an individual reverts to its original property value. Default of -1 means the new value is kept forever.

  • ip_restrictions – The IndividualProperty key:value pairs to target.

  • coverage – The proportion of the population that will receive the intervention (Demographic_Coverage parameter).

  • target_age_min – Minimum age to target.

  • target_age_max – Maximum age to target.

  • target_sex – Optional target just “MALE” or “FEMALE” individuals.

  • target_residents_only – Set to True to target only the individuals who started the simulation in this node and are still in the node.

  • Returns – N/A.

emod_api.interventions.common.change_individual_property(camp, target_property_name: str, target_property_value: str, start_day: int = 0, number_repetitions: int = 1, timesteps_between_reps: int = -1, node_ids: list | None = None, daily_prob: float = 1, max_duration: int = 9.3228e+35, revert: int = -1, coverage: float = 1, ip_restrictions: list | None = None, target_age_min: float = 0, target_age_max: float = 45625, target_sex: str = 'All', target_residents_only: bool = False, trigger_condition_list: list | None = None, triggered_campaign_delay: int = 0, listening_duration: int = -1, blackout_flag: bool = True, check_eligibility_at_trigger: bool = False)[source]#

Add an intervention that changes the individual property value to another on a particular day OR after a triggering event using the PropertyValueChanger class. Deprecated. Prefer change_individual_property_scheduled or change_individual_property_triggered depending on the use case.

Parameters:
  • camp – emod_api.campaign object with schema_path set.

  • target_property_name – The individual property key to assign to the individual. For example, Risk.

  • target_property_value – The individual property value to assign to the individual. For example, High.

  • start_day – The day on which to start distributing the intervention.

  • number_repetitions – Optional repeater value. Does not work with triggers.

  • timesteps_between_reps – Gap between repetitions, optional. Does not work with triggers.

  • node_ids – The list of nodes to apply this intervention to. Defaults to all.

  • daily_prob – The daily probability that an individual’s property value will be updated (Daily_Probability parameter).

  • max_duration – The number of days to continue the intervention after start_day.

  • revert – The number of days before an individual reverts to its original property value. Default of -1 means the new value is kept forever.

  • coverage – The proportion of the population that will receive the intervention (Demographic_Coverage parameter).

  • ip_restrictions – The IndividualProperty key:value pairs to target. Usually this will be the same key but different from the target_property_xxx entries.

  • target_residents_only – Set to True to target only the individuals who started the simulation in this node and are still in the node.

  • target_age_min – Optional minimum age, defaults to 0.

  • target_age_max – Optional maximum age, defaults to inf.

  • target_sex – Optional target sex, defaults to both.

  • triggered_campaign_delay – The number of days the campaign is delayed after being triggered.

  • trigger_condition_list – A list of the events that will trigger the intervention. If included, start_day is the day when monitoring for triggers begins.

  • listening_duration – The number of time steps that the triggered campaign will be active for. Default is -1, which is indefinitely.

  • blackout_flag – Set to True if you don’t want the triggered intervention to be distributed to the same person more than once a day.

  • check_eligibility_at_trigger – if triggered event is delayed, you have an option to check individual/node’s eligibility at the initial trigger or when the event is actually distributed after delay.

Returns:

None