Skip to content

outdoorrestkill

add_outdoorrestkill(campaign, start_day=1, node_ids=None, insecticide=None, killing_initial_effect=1, killing_box_duration=-1, killing_decay_time_constant=0)

Adds a node-targeted OutdoorRestKill intervention to the campaign

Parameters:

Name Type Description Default
campaign EMODCampaign

campaign object to which the intervention will be added, and schema_path container

required
start_day int

the day on which to distribute the intervention

1
insecticide str

The name of the insecticide defined in config.Insecticides for this intervention. If insecticides are being used, then this must be defined as one of those values. If they are not being used, then this does not needed to be specified or can be empty string. It cannot have a value if config.Insecticides does not define anything.

None
killing_initial_effect float

Initial_Effect in the Killing_Config*

1
killing_box_duration int

Length in days before the Initial_Effect starts to decay, -1 indicates forever.

-1
killing_decay_time_constant float

The rate of decay of the Initial_Effect*

0
node_ids list

List of nodes to which to distribute the intervention. None or empty list implies "all nodes".

None

Returns:

Type Description
EMODCampaign

configured campaign object

Source code in emodpy_malaria/interventions/outdoorrestkill.py
def add_outdoorrestkill(campaign,
                        start_day: int = 1,
                        node_ids: list = None,
                        insecticide: str = None,
                        killing_initial_effect: float = 1,
                        killing_box_duration: int = -1,
                        killing_decay_time_constant: float = 0
                        ):
    """
        Adds a node-targeted OutdoorRestKill intervention to the campaign

    Args:
        campaign (emodpy.campaign.emod_campaign.EMODCampaign): campaign object to which the intervention will be added, and schema_path container
        start_day: the day on which to distribute the intervention
        insecticide: The name of the insecticide defined in config.Insecticides for this intervention.
            If insecticides are being used, then this must be defined as one of those values.  If they are not
            being used, then this does not needed to be specified or can be empty string.  It cannot have a
            value if config.Insecticides does not define anything.
        killing_initial_effect: **Initial_Effect** in the *Killing_Config**
        killing_box_duration: Length in days before the **Initial_Effect** starts to decay, -1 indicates forever.
        killing_decay_time_constant: The rate of decay of the *Initial_Effect**
        node_ids: List of nodes to which to distribute the intervention. None or empty list implies "all nodes".

    Returns:
        (emodpy.campaign.emod_campaign.EMODCampaign): configured campaign object
    """
    schema_path = campaign.schema_path
    intervention = s2c.get_class_with_defaults("OutdoorRestKill", schema_path)
    intervention.Insecticide_Name = insecticide if insecticide else ""
    intervention.Killing_Config = utils.get_waning_from_params(schema_path,
                                                               initial=killing_initial_effect,
                                                               box_duration=killing_box_duration,
                                                               decay_time_constant=killing_decay_time_constant)

    add_campaign_event(campaign,
                       start_day=start_day,
                       node_ids=node_ids,
                       node_intervention=intervention)

    return campaign