emod_api.interventions.migration module#

emod_api.interventions.migration.add_migration_event(camp, nodeto, start_day: int = 0, coverage: float = 1, repetitions: int = 1, tsteps_btwn: int = 365, duration_at_node: dict | None = None, duration_before_leaving: dict | None = None, target_age: dict | None = None, nodes_from_ids: List[int] | None = None, ind_property_restrictions=None, node_property_restrictions=None, triggered_campaign_delay=0, trigger_condition_list=None, listening_duration=-1)[source]#

Add a migration event to a campaign that moves individuals from one node to another.

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

  • nodeto – The NodeID that the individuals will travel to.

  • start_day – A day when intervention is distributed

  • coverage – The proportion of the population covered by the intervention

  • repetitions – The number of times to repeat the intervention

  • tsteps_btwn – The number of time steps between repetitions.

  • duration_before_leaving

    Dictionary of parameters that define the distribution for duration before leaving node, including the distribution. Durations are in days. .. rubric:: Examples

    {“Duration_Before_Leaving_Distribution”:”GAUSSIAN_DISTRIBUTION”, “Duration_Before_Leaving_Gaussian_Mean”: 14, “Duration_Before_Leaving_Gaussian_Std_Dev” 3} {“Duration_Before_Leaving_Distribution”:”POISSON_DISTRIBUTION”, “Duration_Before_Leaving_Poisson_Mean” 30}

  • duration_at_node

    Dictionary of parameters that define the distribution for duration at node, including the distribution Durations are in days. .. rubric:: Examples

    {“Duration_At_Node_Distribution”:”GAUSSIAN_DISTRIBUTION”, “Duration_At_Node_Gaussian_Mean”: 14, “Duration_At_Node_Gaussian_Std_Dev” 3} {“Duration_At_Node_Distribution”:”POISSON_DISTRIBUTION”, “Duration_At_Node_Poisson_Mean” 30}

  • target_age – The individuals to target with the intervention. To restrict by age, provide a dictionary of {‘agemin’ : x, ‘agemax’ : y}. Default is targeting everyone.

  • nodes_from_ids – The list of node ids to apply this intervention to.

  • ind_property_restrictions – The IndividualProperty key:value pairs that individuals must have to receive the intervention (Property_Restrictions_Within_Node parameter). In the format [{"BitingRisk":"High"}, {"IsCool":"Yes}].

  • node_property_restrictions – The NodeProperty key:value pairs that nodes must have to receive the intervention. In the format [{"Place":"RURAL"}, {"ByALake":"Yes}].

  • triggered_campaign_delay – After the trigger is received, the number of time steps until distribution starts. Eligibility of people or nodes for the campaign is evaluated on the start day, not the triggered day.

  • trigger_condition_list – A list of the events that will trigger the intervention. If included, start_days is then used to distribute NodeLevelHealthTriggeredIV.

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

Returns:

None

Example

from emod_api import campaign as camp dan = {“Duration_At_Node_Distribution”:”POISSON_DISTRIBUTION”, “Duration_At_Node_Poisson_Mean” 30} dbl = {“Duration_Before_Leaving_Distribution”:”GAUSSIAN_DISTRIBUTION”, “Duration_Before_Leaving_Gaussian_Mean”: 14, “Duration_Before_Leaving_Gaussian_Std_Dev” 3}

add_migration_event(camp, nodeto=5, start_day=1, coverage=0.75, duration_at_node = dan,

duration_before_leaving = dbl, repetitions=1, tsteps_btwn=90, target=’Everyone’, nodesfrom={“class”: “NodeSetAll”}, node_property_restrictions=[{“Place”: “Rural”}])