emodpy_malaria.interventions.usage_dependent_bednet module

emodpy_malaria.interventions.usage_dependent_bednet.add_scheduled_usage_dependent_bednet(campaign, start_day: int = 1, demographic_coverage: float = 1, target_num_individuals: int | None = None, node_ids: list | None = None, ind_property_restrictions: list | None = None, target_age_min: float = 0, target_age_max: float = 125, target_gender: str = 'All', intervention_name: str = 'UsageDependentBednet', discard_config: dict | None = None, insecticide: str = '', repelling_initial_effect: float = 0, repelling_box_duration: int = 0, repelling_decay_time_constant: float = 1460, blocking_initial_effect: float = 0.9, blocking_box_duration: int = 0, blocking_decay_time_constant: float = 730, blocking_linear_times: list | None = None, blocking_linear_values: list | None = None, blocking_expire_at_end: int = 0, killing_initial_effect: float = 0, killing_box_duration: int = 0, killing_decay_time_constant: float = 1460, age_dependence: dict | None = None, seasonal_dependence: dict | None = None, dont_allow_duplicates: bool = False)[source]

Add an insecticide-treated net (ITN) intervention with a seasonal usage pattern to the campaign using the UsageDependentBednet class.

Note: for WaningEffect,

box_duration = 0 + decay_time_constant > 0 => WaningEffectExponential box_duration > 0 + decay_time_constant = 0 => WaningEffectBox/Constant (depending on duration) box_duration > 0 + decay_time_constant > 0 => WaningEffectBoxExponential

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

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

  • 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 – The list of nodes to apply this intervention to (Node_List parameter). If not provided, intervention is distributed to all nodes.

  • 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

  • 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}].

  • 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.

  • intervention_name – The optional name used to refer to this intervention as a means to differentiate it from others that use the same class. It’s possible to have multiple UsageDependentBednets interventions attached to a person if they have different Intervention_Name values.

  • discard_config

    A dictionary of parameters needed to define expiration distribution. No need to definite the distribution with all its parameters Default is bednet being discarded with EXPONENTIAL_DISTRIBUTION with Expiration_Period_Exponential of 10 years

    Examples:

    for Gaussian: {"Expiration_Period_Distribution": "GAUSSIAN_DISTRIBUTION",
                   "Expiration_Period_Gaussian_Mean": 20,
                   "Expiration_Period_Gaussian_Std_Dev":10}
    for Exponential: {"Expiration_Period_Distribution": "EXPONENTIAL_DISTRIBUTION",
                     "Expiration_Period_Exponential":150}
    

  • 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.

  • repelling_initial_effect – Initial strength of the Repelling effect. The effect may decay over time.

  • repelling_box_duration – Box duration of effect in days before the decay of Repelling Initial_Effect.

  • repelling_decay_time_constant – The exponential decay length, in days of the Repelling Initial_Effect.

  • blocking_initial_effect – Initial strength of the Blocking effect. The effect may decay over time.

  • blocking_box_duration – Box duration of effect in days before the decay of Blocking Initial_Effect.

  • blocking_decay_time_constant – The exponential decay length, in days of the Blocking Initial_Effect.

  • blocking_linear_times – An array of days that matches the defined linear values for Blocking Initial_Effect

  • blocking_linear_values – An array of multiplier values that matches the defined linear days for Blocking Initial_Effect.

  • blocking_expire_at_end – Set to 1 to have efficacy go to zero and let the intervention expire when the end of the map is reached. Only vaccines and bednet usage currently support this expiration feature. defaults to 0.

  • killing_initial_effect – Initial strength of the Killing effect. The effect may decay over time.

  • killing_box_duration – Box duration of effect in days before the decay of Killing Initial_Effect.

  • killing_decay_time_constant – The exponential decay length, in days of the Killing Initial_Effect.

  • age_dependence

    A dictionary defining the age dependence of net use. Must contain a list of ages in years and list of usage rate. Default is uniform across all ages. Times are in years of age Examples:

    {"Times":[], "Values":[]} or {"youth_cov":0.7, "youth_min_age":3, "youth_max_age":13}
    

  • seasonal_dependence

    A dictionary defining the seasonal dependence of net use. Time since start will reset to zero once it reaches 365. This allows you to simulate seasonal effects. Times are given in days of the year; values greater than 365 are ignored. Dictionaries can be (times, values) for linear spline or (minimum coverage, day of maximum coverage) for sinusoidal dynamics. Default is constant use during the year. Examples:

    {"Times":[], "Values":[]} or {"min_cov":0.45, "max_day":300}
    

  • dont_allow_duplicates – Set to True to prevent individual from receiving another copy of the intervention. Default is False.

Returns:

None .. note:

Previous way of setting discard config is no longer available, you can translate it to the current way by:
discard_config the old way {'halflife1': 260, 'halflife2': 2106, 'fraction1': float(table_dict['fast_fraction'])
discard_config translated = {"Expiration_Period_Distribution": "DUAL_EXPONENTIAL_DISTRIBUTION",
                            "Expiration_Period_Mean_1": discard_halflife, or halflife1
                            "Expiration_Period_Mean_2": 365 * 40, or halflife2
                            "Expiration_Period_Proportion_1": 1 or 'fraction1'}

Example:

discard_config = {"Expiration_Period_Exponential": 10 * 365}
age_dependence = {"Times": [0, 4, 10, 60],
           "Values": [1, 0.9, 0.8, 0.5]}
add_usage_dependent_bednet(campaign, start_day=12, demographic_coverage=0.25,
            age_dependence=age_dependence):

emodpy_malaria.interventions.usage_dependent_bednet.add_triggered_usage_dependent_bednet(campaign, start_day: int = 1, demographic_coverage: float = 1, node_ids: list | None = None, ind_property_restrictions: list | None = None, trigger_condition_list: list | None = None, triggered_campaign_delay: float | None = None, listening_duration: int = -1, target_age_min: float = 0, target_age_max: float = 125, target_gender: str = 'All', intervention_name: str = 'UsageDependentBednet', discard_config: dict | None = None, insecticide: str = '', repelling_initial_effect: float = 0, repelling_box_duration: int = 0, repelling_decay_time_constant: float = 1460, blocking_initial_effect: float = 0.9, blocking_box_duration: int = 0, blocking_decay_time_constant: float = 730, blocking_linear_times: list | None = None, blocking_linear_values: list | None = None, blocking_expire_at_end: int = 0, killing_initial_effect: float = 0, killing_box_duration: int = 0, killing_decay_time_constant: float = 1460, age_dependence: dict | None = None, seasonal_dependence: dict | None = None, dont_allow_duplicates: bool = False)[source]

Add an insecticide-treated net (ITN) intervention with a seasonal usage pattern to the campaign using the UsageDependentBednet class.

Note: for WaningEffect,

box_duration = 0 + decay_time_constant > 0 => WaningEffectExponential box_duration > 0 + decay_time_constant = 0 => WaningEffectBox/Constant (depending on duration) box_duration > 0 + decay_time_constant > 0 => WaningEffectBoxExponential if any of the blocking_linear_* parameters are defined, only blocking_initial_effect is used.

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

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

  • 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.

  • node_ids – The list of nodes to apply this intervention to (Node_List parameter). If not provided, intervention is distributed to all nodes.

  • 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

  • trigger_condition_list – (Optional) A list of the events that will trigger the ITN intervention. If included, start is the day when monitoring for triggers begins.

  • triggered_campaign_delay – (Optional) Delay in days before the intervention is given out after being triggered.

  • listening_duration – If run as a birth-triggered event or a trigger_condition_list, specifies the duration for the distribution to continue. Default is to continue until the end of the simulation.

  • 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.

  • 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}].

  • intervention_name – The optional name used to refer to this intervention as a means to differentiate it from others that use the same class. It’s possible to have multiple UsageDependentBednets interventions attached to a person if they have different Intervention_Name values.

  • discard_config

    A dictionary of parameters needed to define expiration distribution. No need to definite the distribution with all its parameters Default is bednet being discarded with EXPONENTIAL_DISTRIBUTION with Expiration_Period_Exponential of 10 years

    Examples:

    for Gaussian: {"Expiration_Period_Distribution": "GAUSSIAN_DISTRIBUTION",
                   "Expiration_Period_Gaussian_Mean": 20,
                   "Expiration_Period_Gaussian_Std_Dev":10}
    for Exponential: {"Expiration_Period_Distribution": "EXPONENTIAL_DISTRIBUTION",
                     "Expiration_Period_Exponential":150}
    

  • 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.

  • repelling_initial_effect – Initial strength of the Repelling effect. The effect may decay over time.

  • repelling_box_duration – Box duration of effect in days before the decay of Repelling Initial_Effect.

  • repelling_decay_time_constant – The exponential decay length, in days of the Repelling Initial_Effect.

  • blocking_initial_effect – Initial strength of the Blocking effect. The effect may decay over time.

  • blocking_box_duration – Box duration of effect in days before the decay of Blocking Initial_Effect.

  • blocking_decay_time_constant – The exponential decay length, in days of the Blocking Initial_Effect.

  • blocking_linear_times – An array of days that matches the defined linear values for Blocking Initial_Effect.

  • blocking_linear_values – An array of multiplier values that matches the defined linear days for Blocking Initial_Effect.

  • blocking_expire_at_end – Set to 1 to have efficacy go to zero and let the intervention expire when the end of the map is reached. Only vaccines and bednet usage currently support this expiration feature. defaults to 0.

  • killing_initial_effect – Initial strength of the Killing effect. The effect may decay over time.

  • killing_box_duration – Box duration of effect in days before the decay of Killing Initial_Effect.

  • killing_decay_time_constant – The exponential decay length, in days of the Killing Initial_Effect.

  • age_dependence

    A dictionary defining the age dependence of net use. Must contain a list of ages in years and list of usage rate. Default is uniform across all ages. Times are in years of age Examples:

    {"Times":[], "Values":[]} or {"youth_cov":0.7, "youth_min_age":3, "youth_max_age":13}
    

  • seasonal_dependence

    A dictionary defining the seasonal dependence of net use. Time since start will reset to zero once it reaches 365. This allows you to simulate seasonal effects. Times are given in days of the year; values greater than 365 are ignored. Dictionaries can be (times, values) for linear spline or (minimum coverage, day of maximum coverage) for sinusoidal dynamics. Default is constant use during the year. Examples:

    {"Times":[], "Values":[]} or {"min_cov":0.45, "max_day":300}
    

  • dont_allow_duplicates – Set to True to prevent individual from receiving another copy of the intervention. Default is False.

Returns:

None

Note

Previous way of setting discard config is no longer available, you can translate it to the current way by: discard_config the old way {‘halflife1’: 260, ‘halflife2’: 2106, ‘fraction1’: float(table_dict[‘fast_fraction’]) discard_config translated = {“Expiration_Period_Distribution”: “DUAL_EXPONENTIAL_DISTRIBUTION”, “Expiration_Period_Mean_1”: discard_halflife, or halflife1 “Expiration_Period_Mean_2”: 365 * 40, or halflife2 “Expiration_Period_Proportion_1”: 1 or ‘fraction1’}

Example:

discard_config = {"Expiration_Period_Exponential": 10 * 365}
age_dependence = {"Times": [0, 4, 10, 60],
           "Values": [1, 0.9, 0.8, 0.5]}
add_usage_dependent_bednet(campaign, start=12, coverage=0.25,
            age_dependence=age_dependence):
emodpy_malaria.interventions.usage_dependent_bednet.new_intervention_as_file(camp, start_day, filename='UsageDependentBednet.json')[source]