emodpy_hiv.campaign.individual_intervention module#

class emodpy_hiv.campaign.individual_intervention.ARTDropout(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'>, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The ARTDropout intervention class removes an individual from antiretroviral therapy (ART) and interrupts their progress through the cascade of care. The individual’s infectiousness will return to a non-suppressed level, and a new prognosis will be assigned.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.AgeDiagnostic(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'>, age_thresholds: list[emodpy_hiv.campaign.individual_intervention.RangeThreshold] | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The AgeDiagnostic allows you to broadcast different events based on the individual’s age. For example, you could distribute this intervention to people who are high risk and use the intervention to have different things happen (because of the broadcasted events) based on their age.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • age_thresholds (list[RangeThreshold], optional) – Used to associate age ranges for individuals. Default value: None

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.AntiretroviralTherapy(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'>, days_to_achieve_viral_suppression: float = 183, art_survival_who_stage_threshold_for_cox: float = 3, art_survival_hazard_ratio_who_stage_3plus: float = 2.7142, art_survival_hazard_ratio_female: float = 0.6775, art_survival_hazard_ratio_cd4_slope: float = -0.00758256, art_survival_hazard_ratio_cd4_intercept: float = 0.282852, art_survival_hazard_ratio_body_weight_kg_slope: float = -0.073153, art_survival_hazard_ratio_body_weight_kg_intercept: float = 3.05043, art_survival_hazard_ratio_age_over_40yr: float = 1.4309, art_survival_baseline_hazard_weibull_shape: float = 0.34, art_survival_baseline_hazard_weibull_scale: float = 123.83, art_multiplier_on_transmission_prob_per_act: float = 0.08, art_is_active_against_mortality_and_transmission: bool = True, art_cd4_at_initiation_saturating_reduction_in_mortality: float = 350, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The AntiretroviralTherapy intervention class begins antiretroviral therapy (ART) for specified individuals. To remove an individual from ART, use ARTDropout. Please refer to the documentation for AntiretroviralTherapy at the following link: Health care systems.

Additional considerations when using this intervention:
  • The model will not allow someone who is HIV negative to be put on ART.

  • A person who has not previously been on ART is considered to be ‘starting ART’ at the time this intervention is applied; the model will track this start time/duration.

  • If a person is already on ART from another intervention, receiving a second ART intervention will have no effect.

  • If a person is on already ART and receives the ARTMortalityTable intervention, the original ART start time will be used to calculate the duration from enrollment to ART AIDS Death. The duration since starting ART will not change; it will continue to increase.

  • If a person is on ART and receives the ARTDropout intervention, the person will go off ART and the duration will be reset; if receiving a new ART intervention, this new start time/duration will be used in any calculations.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • days_to_achieve_viral_suppression (float, optional) – The number of days after ART initiation over which infectiousness declines linearly until the art_multiplier_on_transmission_prob_per_act takes full effect. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 183

  • art_survival_who_stage_threshold_for_cox (float, optional) – If the person receiving ART has a WHO Stage greater than or equal to this threshold, then use the hazard ratio determined by the parameter art_survival_hazard_ratio_who_stage_3plus. Minimum value: 0 Maximum value: 5 Default value: 3

  • art_survival_hazard_ratio_who_stage_3plus (float, optional) – The hazard ratio comparing those starting ART in WHO stage >= 3 to those in WHO stage < 3. Minimum value: 1e-06 Maximum value: 1000000.0 Default value: 2.7142

  • art_survival_hazard_ratio_female (float, optional) – The hazard ratio comparing survival female to male survival for those starting ART. Minimum value: 1e-06 Maximum value: 1000000.0 Default value: 0.6775

  • art_survival_hazard_ratio_cd4_slope (float, optional) – The slope value to sue when calculating the hazard for for the person based on their CD4 count. multiplier = exp(cd4_slope * cd4 + cd4_intercept) Minimum value: -1000000.0 Maximum value: 1000000.0 Default value: -0.00758256

  • art_survival_hazard_ratio_cd4_intercept (float, optional) – The Y-intercept to use when calculating the hazard ratio for the person based on their CD4 count. multiplier = exp(cd4_slope * cd4 + cd4_intercept) Minimum value: -1000000.0 Maximum value: 1000000.0 Default value: 0.282852

  • art_survival_hazard_ratio_body_weight_kg_slope (float, optional) – The slope to use when calculating the hazard ratio for the person’s body weight. The body weight is determined by WHO stage: * WHO Stage 0 = 65.0 kg * WHO Stage 1-2 = 62.1 kg * WHO Stage 2-3 = 57.0 kg * WHO Stage 3-4 = 50.0 kg * WHO Stage 4+ = 40.1 kg multiplier = exp(weight_slope * weight + weight_intercept) Minimum value: -1000000.0 Maximum value: 1000000.0 Default value: -0.073153

  • art_survival_hazard_ratio_body_weight_kg_intercept (float, optional) –

    The Y-intercept to use when calculating the hazard ratio for the person’s body weight.

    The body weight is determined by WHO stage:

    • WHO Stage 0 = 65.0 kg

    • WHO Stage 1-2 = 62.1 kg

    • WHO Stage 2-3 = 57.0 kg

    • WHO Stage 3-4 = 50.0 kg

    • WHO Stage 4+ = 40.1 kg

    multiplier = exp(weight_slope * weight + weight_intercept) Minimum value: -1000000.0 Maximum value: 1000000.0 Default value: 3.05043

  • art_survival_hazard_ratio_age_over_40yr (float, optional) – The hazard ratio comparing the survival time of those starting ART over 40 years of age compared to those starting ART <40 years. Minimum value: 1e-06 Maximum value: 1000000.0 Default value: 1.4309

  • art_survival_baseline_hazard_weibull_shape (float, optional) – Shape parameter for a Weibull distribution of survival time in years for a male < 40 with WHO stage of 1 or 2 starting ART (base case). Minimum value: 0 Maximum value: 10 Default value: 0.34

  • art_survival_baseline_hazard_weibull_scale (float, optional) – Scale parameter for a Weibull distribution of survival time in years for a male < 40 with WHO stage of 1 or 2 starting ART (base case). Minimum value: 1e-06 Maximum value: 1000000.0 Default value: 123.83

  • art_multiplier_on_transmission_prob_per_act (float, optional) – Multiplier acting on Base_Infectivity to determine the per-act transmission probability of a virally suppressed HIV+ individual. Minimum value: 0 Maximum value: 1 Default value: 0.08

  • art_is_active_against_mortality_and_transmission (bool, optional) – If set to true (1), ART will suppress viral load and extend prognosis. Default value: True

  • art_cd4_at_initiation_saturating_reduction_in_mortality (float, optional) – The duration from ART enrollment to on-ART HIV-cause death increases with CD4 at ART initiation up to a threshold determined by this parameter value. This is the maximum value that CD4 is allowed to have in the hazard ratio calculation for CD4. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 350

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.AntiretroviralTherapyFull(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'>, time_on_art_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution, stop_art_event: str | None = None, days_to_achieve_viral_suppression: float = 183, art_survival_who_stage_threshold_for_cox: float = 3, art_survival_hazard_ratio_who_stage_3plus: float = 2.7142, art_survival_hazard_ratio_female: float = 0.6775, art_survival_hazard_ratio_cd4_slope: float = -0.00758256, art_survival_hazard_ratio_cd4_intercept: float = 0.282852, art_survival_hazard_ratio_body_weight_kg_slope: float = -0.073153, art_survival_hazard_ratio_body_weight_kg_intercept: float = 3.05043, art_survival_hazard_ratio_age_over_40yr: float = 1.4309, art_survival_baseline_hazard_weibull_shape: float = 0.34, art_survival_baseline_hazard_weibull_scale: float = 123.83, art_multiplier_on_transmission_prob_per_act: float = 0.08, art_is_active_against_mortality_and_transmission: bool = True, art_cd4_at_initiation_saturating_reduction_in_mortality: float = 350, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The AntriretroviralTherapyFull intervention class begins antiretroviral therapy (ART) on the person receiving the intervention. This class is similar to the standard AntiretroviralTherapy, but enhances it with two key features: 1) a built-in delay timer such that when the delay expires, the person will come off of ART (ARTDropout should NOT be used with this intervention), and 2) persistence with the individual so the user can track this intervention using ReferenceTrackingEventCoordinator.

Additional considerations when using this intervention:
  • The model will not allow someone who is HIV negative to be put on ART.

  • A person who has not previously been on ART is considered to be ‘starting ART’ at the time this intervention is applied; the model will track this start time/duration.

  • If a person is already on ART from another intervention, receiving a second ART intervention will have no effect.

  • If a person is on already ART and receives the ARTMortalityTable intervention, the original ART start time will be used to calculate the duration from enrollment to ART AIDS Death. The duration since starting ART will not change; it will continue to increase.

  • If a person is on ART and receives the ARTDropout intervention, the person will go off ART and the duration will be reset; if receiving a new ART intervention, this new start time/duration will be used in any calculations.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • time_on_art_distribution (BaseDistribution, required) – The type of distribution to use when determine how long a person will be on ART. Please use the following distribution classes from emodpy_hiv.utils.distributions to define the distribution: * ConstantDistribution * UniformDistribution * GaussianDistribution * ExponentialDistribution * PoissonDistribution * LogNormalDistribution * DualConstantDistribution * WeibullDistribution * DualExponentialDistribution

  • stop_art_event (str, optional) – This event is broadcast when the person drops off ART. This could happen either via the timer running out or the intervention detected a disqualifying property. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • days_to_achieve_viral_suppression (float, optional) – The number of days after ART initiation over which infectiousness declines linearly until the ART_Multiplier_On_Transmission_Prob_Per_Act takes full effect. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 183

  • art_survival_who_stage_threshold_for_cox (float, optional) – If the person receiving ART has a WHO Stage greater than or equal to this threshold, then use the hazard ratio determined by the parameter ART_Survival_Hazard_Ratio_WHO_Stage_3Plus. Minimum value: 0 Maximum value: 5 Default value: 3

  • art_survival_hazard_ratio_who_stage_3plus (float, optional) – The hazard ratio comparing those starting ART in WHO stage >= 3 to those in WHO stage < 3. Minimum value: 1e-06 Maximum value: 1000000.0 Default value: 2.7142

  • art_survival_hazard_ratio_female (float, optional) – The hazard ratio comparing survival female to male survival for those starting ART. Minimum value: 1e-06 Maximum value: 1000000.0 Default value: 0.6775

  • art_survival_hazard_ratio_cd4_slope (float, optional) – The slope value to sue when calculating the hazard for for the person based on their CD4 count. multiplier = exp(cd4_slope * cd4 + cd4_intercept) Minimum value: -1000000.0 Maximum value: 1000000.0 Default value: -0.00758256

  • art_survival_hazard_ratio_cd4_intercept (float, optional) – The Y-intercept to use when calculating the hazard ratio for the person based on their CD4 count. multiplier = exp(cd4_slope * cd4 + cd4_intercept) Minimum value: -1000000.0 Maximum value: 1000000.0 Default value: 0.282852

  • art_survival_hazard_ratio_body_weight_kg_slope (float, optional) – The slope to use when calculating the hazard ratio for the person’s body weight. The body weight is determined by WHO stage: * WHO Stage 0 = 65.0 kg * WHO Stage 1-2 = 62.1 kg * WHO Stage 2-3 = 57.0 kg * WHO Stage 3-4 = 50.0 kg * WHO Stage 4+ = 40.1 kg multiplier = exp(weight_slope * weight + weight_intercept) Minimum value: -1000000.0 Maximum value: 1000000.0 Default value: -0.073153

  • art_survival_hazard_ratio_body_weight_kg_intercept (float, optional) –

    The Y-intercept to use when calculating the hazard ratio for the person’s body weight.

    The body weight is determined by WHO stage:

    • WHO Stage 0 = 65.0 kg

    • WHO Stage 1-2 = 62.1 kg

    • WHO Stage 2-3 = 57.0 kg

    • WHO Stage 3-4 = 50.0 kg

    • WHO Stage 4+ = 40.1 kg

    multiplier = exp(weight_slope * weight + weight_intercept) Minimum value: -1000000.0 Maximum value: 1000000.0 Default value: 3.05043

  • art_survival_hazard_ratio_age_over_40yr (float, optional) – The hazard ratio comparing the survival time of those starting ART over 40 years of age compared to those starting ART <40 years. Minimum value: 1e-06 Maximum value: 1000000.0 Default value: 1.4309

  • art_survival_baseline_hazard_weibull_shape (float, optional) – Shape parameter for a Weibull distribution of survival time in years for a male < 40 with WHO stage of 1 or 2 starting ART (base case). Minimum value: 0 Maximum value: 10 Default value: 0.34

  • art_survival_baseline_hazard_weibull_scale (float, optional) – Scale parameter for a Weibull distribution of survival time in years for a male < 40 with WHO stage of 1 or 2 starting ART (base case). Minimum value: 1e-06 Maximum value: 1000000.0 Default value: 123.83

  • art_multiplier_on_transmission_prob_per_act (float, optional) – Multiplier acting on Base_Infectivity to determine the per-act transmission probability of a virally suppressed HIV+ individual. Minimum value: 0 Maximum value: 1 Default value: 0.08

  • art_is_active_against_mortality_and_transmission (bool, optional) – If set to true (1), ART will suppress viral load and extend prognosis. Default value: True

  • art_cd4_at_initiation_saturating_reduction_in_mortality (float, optional) – The duration from ART enrollment to on-ART HIV-cause death increases with CD4 at ART initiation up to a threshold determined by this parameter value. This is the maximum value that CD4 is allowed to have in the hazard ratio calculation for CD4. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 350

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.CD4Diagnostic(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'>, cd4_thresholds: list[emodpy_hiv.campaign.individual_intervention.RangeThreshold] | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The CD4Diagnostic allows you to have different things happen to a person based on their actual CD4 count. For example, if a person was given an HIVRapidDiagnostic and tested positive, you could give that person the CD4Diagnositic. The diagnostic would broadcast different events based on their current CD4 count. If the CD4 count was high, you could broadcast an event that would give the person a delay that would have the person re-test in three months. If the CD4 count was low, you could broadcast an event that would cause them to go on ART immediately.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • cd4_thresholds (list[RangeThreshold], optional) – This parameter associates ranges of CD4 counts with events that should occur for individuals whose CD4 counts fall into those ranges. Default value: None

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.CoitalActRiskFactors(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'>, expiration_period_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution, transmission_multiplier: float = 1, expiration_event_trigger: str | None = None, acquisition_multiplier: float = 1, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The CoitalActRiskFactors intervention class provides a method of modifying an individual’s risk/probability of acquiring or transmitting an STI. If other risk multipliers are active (across other interventions), the values will be multiplied together; the resulting value will be multiplied with any active STI co-infection factors. When the intervention expires, the individual’s risk factor multiplier returns to one. Since this intervention persists, it can be used with Distributors.add_intervention_tracker(). NOTE: An individual can have multiple of these interventions with each one being multiplied times the other.

The risk multiplier for a coital act has three contributions:

  1. Coital Act Risk Factors - The factors from the use of this intervention.

  2. Co-Infection - A person can get a co-infection by using the ModifyStiCoInfectionStatus intervention. If the person has a co-infection, then the configuration paameters STI_Coinfection_Transmission_Multiplier or STI_Coinfection_Acquisition_Multiplier depending on whether the person has HIV (transmitter) or not (aquirer). The maximum value of the multiplier between the transmitter and acquirer is used.

  3. Condom Transmission Blocking - If condoms were used in this coital act, then the configuration parameter Condom_Transmission_Blocking_Probability is included.

The value of the multiplier is calculated as follows:

>>> co_inf_transmission = infected_individual.STI_Coinfection_Transmission_Multiplier if co-infected else 1
>>> co_inf_acquisition  = uninfected_individual.STI_Coinfection_Acquisition_Multiplier if co-infected else 1
>>> risk_multiplier = max( co_inf_transmission, co_inf_acquisition )
>>>
>>> risk_factor_transmission = infected_individual.CoitalActsRiskFactors.Transmission_Multiplier
>>> risk_factor_acquisition = uninfected_individual.CoitalActsRiskFactors.Acquisition_Multiplier
>>> risk_multiplier *= risk_factor_transmission * risk_factor_acquisition;
>>>
>>> risk_multiplier *= (1 - Condom_Transmission_Blocking_Probability) if using_condom else 1

This risk multiplier is then used to determine if the uninfected person becomes infected:

>>> probability_infected = risk_multiplier
>>>                      * transmission_probability
>>>                      * acquisition_probability

Acquisition Probability

There are three things that contribute to the probability that an uninfected person can acquire HIV from a coital act with an infected person. They are:

  1. Male Circumcision - If the uninfected person is male and has been circumcised, their probability of acquisition is reduced. The male individual will have the MaleCircumcision intervention and its Circumcision_Reduced_Acquire parameter will be used.

  2. Female Susceptibility By Age - If the uninfected person is female, then their current age is used to determine the a factor from the configuration parameters Male_To_Female_Relative_Infectivity_Ages and Male_To_Female_Relative_Infectivity_Multipliers. Their age is used with linear interpolation to calculate a multiplier.

  3. PrEP / Vaccine - If the uninfected person has a vaccine or PrEP, their probability of acquisition is also reduced.

>>> probability_acquire = 1.0
>>> probability_acquire *= MaleCircumcision.Circumcision_Reduced_Acquire if male and circumcised else 1
>>> probability_acquire *= get_female_susceptibility( person.age ) if female else 1
>>> probability_acquire *= vaccine_reduced_acquire if person has vaccine else 1

Transmission Probability

In EMOD, the probability of a person transmitting HIV comes down to whether nor not the person has been vaccinated and how infectious they are.

  1. Vaccine - If the infected person has a vaccine that reduces transmission, its probability of transmission reduction is used.

  2. Infectiousness - The infectiousness of a person depends on the following four factors:

    2a. Base Infectivity - The configuration parameter Base_Infectivity determines the starting amount of infectiousness. It is the starting point of the calculation and is assumed to be female-to-male transmission.

    2b. Heterogeneity - To represent the heterogeneity in people, the Base_Infectivity is multiplied by a value from a Log Normal distribution based on the configuration parameter Heterogeneous_Infectiousness_LogNormal_Scale.

    >>> median = -0.5 * Heterogeneous_Infectiousness_LogNormal_Scale**2
    >>> heterogeneity_factor = median + eGauss() * Heterogeneous_Infectiousness_LogNormal_Scale
    

    where eGauss() is a gaussian distributed random number between 0 and 1.

    2c. Stage of Infection - The mount the infection has progressed also impacts the amount of infectiousness. If the person is in the ‘acute’ stage, then we multiply the Base_Infectivity times the configuration parameter Acute_Stage_Infectivity_Multiplier. If the person is in the ‘AIDS’ stage, we multiply by the configuration parameter AIDS_Stage_Infectivity_Multiplier. If they are in the ‘latent’ stage, we do not adjust the Base_Infectivity.

    2d. ART Suppression - If a person has been given an ART intervention (AntiretroviralTherapy, AntiretroviralTherapyFull, or ARTMortalityTable) and has not dropped off of art (ARTDropout), then ART can suppress the person’s infectiousness. This amount of suppression is determined by the intervention parameters ART_Multiplier_On_Transmission_Prob_Per_Act and Days_To_Achieve_Viral_Suppression. If the person has been on ART less than Days_To_Achieve_Viral_Suppression, the ART_Multiplier_On_Transmission_Prob_Per_Act will be reduced proportionally.

These different factors are combined as follows:

>>> infectiousness = Base_Infectivity
>>> infectiousness *= heterogeneity_factor
>>>
>>> if hiv_stage == ACUTE:
>>>     infectiousness *= Acute_Stage_Infectivity_Multiplier
>>> elif hiv_stage == AIDS:
>>>     infectiousness *= AIDS_Stage_Infectivity_Multiplier
>>>
>>> suppression = ART_Multiplier_On_Transmission_Prob_Per_Act
>>> if Days_To_Achieve_Viral_Suppression > 0:
>>>     art_mult = ART_Multiplier_On_Transmission_Prob_Per_Act
>>>     days_to_achieve = Days_To_Achieve_Viral_Suppression
>>>     suppression = 1 - ((1 - art_mult) / days_to_achieve) * time_since_starting_ART
>>> infectiousness *= suppression

The transmission probability is then calculated as:

>>> probability_transmission = infectiousness * vaccine_reduced_transmission
Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • transmission_multiplier (float, optional) – Multiplier for STI transmission probability per coital act. Minimum value: 0 Maximum value: 100 Default value: 1

  • expiration_period_distribution (BaseDistribution, required) – The distribution type to use for setting the expiration of the intervention. Each intervention gets an expiration duration by doing a random draw from the distribution. Please use the following distribution classes from emodpy_hiv.utils.distributions to define the distribution: * ConstantDistribution * UniformDistribution * GaussianDistribution * ExponentialDistribution * PoissonDistribution * LogNormalDistribution * DualConstantDistribution * WeibullDistribution * DualExponentialDistribution

  • expiration_event_trigger (str, optional) – When the intervention expires, this individual-level event will be broadcast. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • acquisition_multiplier (float, optional) – Multiplier for STI acquisition probability per coital act. Minimum value: 0 Maximum value: 100 Default value: 1

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.FemaleContraceptive(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'>, waning_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, usage_expiration_event: str, usage_duration_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The FemaleContraceptive intervention is used to reduce the fertility rate of females of reproductive age (14 to 45 years old), based on a distribution set by the user. This intervention can only be distributed to females, and ignores the waning condition expiration (as women could still use a contraceptive, even if it is ineffective). Note: the Birth_Rate_Dependence configuration parameter must be set to INDIVIDUAL_PREGNANCIES or INDIVIDUAL_PREGNANCIES_BY_AGE_AND_YEAR or an error will result.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • waning_config (AbstractWaningConfig, required) – A WaningConfig object used to control the efficacy of the contraceptive, typically over time. Specify how this effect decays over time using one of the Waning Config classes in emodpy_hiv.campaign.waning_config.

  • usage_expiration_event (str, optional) – When the woman stops using the contraceptive, this event will be broadcast. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • usage_duration_distribution (BaseDistribution, required) – For the distribution of each contraceptive, a randomly selected duration from this distribution will determine when the woman stops using the contraceptive. This is independent of how long the contraceptive is effective. Please use the following distribution classes from emodpy_hiv.utils.distributions to define the distribution: * ConstantDistribution * UniformDistribution * GaussianDistribution * ExponentialDistribution * PoissonDistribution * LogNormalDistribution * DualConstantDistribution * WeibullDistribution * DualExponentialDistribution

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.HIVARTStagingByCD4Diagnostic(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'>, cd4_threshold: ~emodpy_hiv.campaign.common.ValueMap, if_pregnant: ~emodpy_hiv.campaign.common.ValueMap, if_active_tb: ~emodpy_hiv.campaign.common.ValueMap, positive_diagnosis_event: str, negative_diagnosis_event: str | None = None, individual_property_active_tb_value: str | None = None, individual_property_active_tb_key: str | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The HIVARTStagingByCD4Diagnostic intervention class checks for treatment eligibility based on CD4 count. It uses the lowest-ever recorded CD4 count for that individual, based on the history of past CD4 counts conducted using the HIVDrawBlood intervention. To specify the outcome based on age bins instead of CD4 testing, use HIVARTStagingCD4AgnosticDiagnostic.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • cd4_threshold (ValueMap, required) – It is a piecewise table of years to CD4 and the individual’s CD4 count must be below this threshold in order to get a positive ‘diagnosis’.

  • if_pregnant (ValueMap, required) – If the individual does not pass the diagnostic from the cd4_threshold or if_active_TB, and the individual is pregnant, then the individual’s CD4 is compared to the value found in the ValueMap matrix.

  • if_active_tb (ValueMap, required) – If the individual’s CD4 is not below the threshold in the cd4_threshold table and the individual has TB, then the individual’s CD4 will be compared to the CD4 value retrieved from the ValueMap matrix based on the current year. Whether a person has TB is determined by the value of an Individual Property as determined by the parameters individual_property_active_tb_key(typically ‘HasActiveTB’) and individual_property_active_tb_value(typically ‘Yes’).

  • positive_diagnosis_event (str, required) – If the test is positive, this specifies an event that will be broadcast. See Event list for events already used in EMOD or use your own custom event.

  • negative_diagnosis_event (str, optional) – If the test is negative, this specifies an event that will be broadcast. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • individual_property_active_tb_value (str, optional) – The IndividualProperty value (‘Yes’) used to determine whether the individual has TB. If you want to use this feature, you will need to define the property in the demographics Default value: None

  • individual_property_active_tb_key (str, optional) – The IndividualProperty key (‘HasActiveTB’) used to determine whether the individual has TB. If you want to use this feature, you will need to define the property in the demographics Default value: None

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.HIVARTStagingCD4AgnosticDiagnostic(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'>, child_treat_under_age_in_years_threshold: ~emodpy_hiv.campaign.common.ValueMap, child_by_who_stage: ~emodpy_hiv.campaign.common.ValueMap, child_by_tb: ~emodpy_hiv.campaign.common.ValueMap, adult_by_who_stage: ~emodpy_hiv.campaign.common.ValueMap, adult_by_tb: ~emodpy_hiv.campaign.common.ValueMap, adult_by_pregnant: ~emodpy_hiv.campaign.common.ValueMap, positive_diagnosis_event: str, negative_diagnosis_event: str | None = None, individual_property_active_tb_value: str | None = None, individual_property_active_tb_key: str | None = None, adult_treatment_age: float = 5, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The HIVARTStagingCD4AgnosticDiagnostic intervention class checks for treatment eligibility based on age. It uses the individual’s age and the adult_treatment_age argument to determine if the person should be usin the adult or child requirements. To specify the outcome based on CD4 testing, use HIVARTStagingByCD4Diagnostic.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • child_treat_under_age_in_years_threshold (ValueMap, required) – Determines the age at which children are eligible for ART regardless of CD4, WHO stage, or other factors. This parameter uses ValueMap to define Times (by year) and Values for the history and expected treatment guidelines for future years.

  • child_by_who_stage (ValueMap, required) – Determines the WHO stage at or above which children are eligible for ART. This parameter uses ValueMap to define Times (by year) and Values for the history and expected treatment guidelines for future years.

  • child_by_tb (ValueMap, required) – Determines the WHO stage at or above which children having active TB are eligible for ART. This parameter uses ValueMap to define Times (by year) and Values for the history and expected treatment guidelines for future years. Whether a child has TB is determined by the value of an Individual Property as determined by the parameters individual_property_active_tb_key(typically ‘HasActiveTB’) and individual_property_active_tb_value(typically ‘Yes’).

  • adult_by_who_stage (ValueMap, required) – Determines the WHO stage at or above which adults are eligible for ART. This parameter uses ValueMap to define Times (by year) and Values for the history and expected treatment guidelines for future years.

  • adult_by_tb (ValueMap, required) – Determines the WHO stage at or above which adults having active TB are eligible for ART. This parameter uses ValueMap to define Times (by year) and Values for the history and expected treatment guidelines for future years. Whether an adult has TB is determined by the value of an Individual Property as determined by the parameters individual_property_active_tb_key(typically ‘HasActiveTB’) and individual_property_active_tb_value(typically ‘Yes’).

  • adult_by_pregnant (ValueMap, required) – Determines the WHO stage at or above which pregnant adults are eligible for ART. This parameter uses ValueMap to define Times (by year) and Values for the history and expected treatment guidelines for future years.

  • positive_diagnosis_event (str, required) – If an individual tests positive, this specifies an event that may trigger another intervention when the event occurs. See Event list for events already used in EMOD or use your own custom event.

  • negative_diagnosis_event (str, optional) – If an individual tests negative, this specifies an event that will be broadcast and may trigger another intervention. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • individual_property_active_tb_value (str, optional) – The IndividualProperty value (‘Yes’) used to determine whether the individual has TB. Default value: None

  • individual_property_active_tb_key (str, optional) – The IndividualProperty key (‘HasActiveTB’) used to determine whether the individual has TB. Default value: None

  • adult_treatment_age (float, optional) – The age (in years) that delineates adult patients from pediatric patients for the purpose of treatment eligibility. Patients younger than this age may be eligible on the basis of their pediatric patient status. Minimum value: -1 Maximum value: 3.40282e+38 Default value: 5

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.HIVDrawBlood(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'>, positive_diagnosis_event: str, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The HIVDrawBlood intervention class represents a test where blood is drawn and the person’s CD4 or viral load are determined. It allows for a test result to be recorded and used for future health care decisions, but does not intrinsically lead to a health care event. A future health care decision will use this recorded CD4 count or viral load, even if the actual CD4/viral load has changed since last phlebotomy. The result can be updated by distributing another HIVDrawBlood intervention.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • positive_diagnosis_event (str, required) – If an individual tests positive, this specifies an event that may trigger another intervention when the event occurs. See Event list for events already used in EMOD or use your own custom event.

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.HIVMuxer(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'>, muxer_name: str, delay_period_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution, max_entries: int = 1, expiration_period: float = 3.40282e+38, broadcast_on_expiration_event: str | None = None, broadcast_delay_complete_event: str | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The HIVMuxer intervention class is a method of placing groups of individuals into a waiting pattern for the next event, and is based on DelayedIntervention. HIVMuxer adds the ability to limit the number of times an individual can be registered with the delay, which ensures that an individual is only provided with the delay one time. For example, without HIVMuxer, an individual could be given an exponential delay twice, effectively doubling the rate of leaving the delay.

Please refer to the documentation for HIVMuxer at the following link: HIVMuxer

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • muxer_name (str, required) – A name used to identify the delay and check whether individuals have entered it multiple times. If the same name is used at multiple points in the health care process, then the number of entries is combined when max_entries is applied.

  • delay_period_distribution (BaseDistribution, required) – The distribution type to use for assigning the delay period for distributing interventions. Each assigned value is a random draw from the distribution. Please use the following distribution classes from emodpy_hiv.utils.distributions to define the distribution: * ConstantDistribution * UniformDistribution * GaussianDistribution * ExponentialDistribution * PoissonDistribution * LogNormalDistribution * DualConstantDistribution * WeibullDistribution * DualExponentialDistribution

  • max_entries (int, optional) – The maximum number of times the individual can be registered with the HIVMuxer delay. Determines what should happen if an individual reaches the HIVMuxer stage of health care multiple times. For example, registering for an exponential delay two times effectively doubles the rate of leaving the delay. Setting max_entries to 1 prevents the rate from doubling. Minimum value: 0 Maximum value: 2147480000.0 Default value: 1

  • expiration_period (float, optional) – A fixed time period, in days, after which the broadcast_on_expiration_event occurs instead of the broadcast_delay_complete_event. Only applied if the expiration_period occurs earlier than the end of the delay period. For example, if loss to follow-up (LTFU) occurs at a high rate for the first 6 months of care, and then later transitions to a lower rate, then the Expiration_Period should be set to 183 days and Broadcast_On_Expiration_Event can link to another delay intervention with a longer average delay time until LTFU. If LTFU does not occur in the first 6 months, then the expiration will allow the first rate to give way to the post-6-month rate. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 3.40282e+38

  • broadcast_on_expiration_event (str, optional) – If the delay intervention expires before arriving at the end of the delay period, this specifies the event that should occur. For example, if loss to follow-up occurs at a high rate for the first 6 months of care, and then later transitions to a lower rate, then the Expiration_Period should be set to 183 days and Broadcast_On_Expiration_Event can link to another delay intervention with a longer average delay time until loss to follow up (LTFU). If LTFU does not occur in the first 6 months, then the expiration will allow the first rate to give way to the post-6-month rate. See the list of available events for possible values. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • broadcast_delay_complete_event (str, optional) – The event that should occur at the end of the delay period. See Event list for events already used in EMOD or use your own custom event. custom event. Default value: None

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 4 common parameters: intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.HIVPiecewiseByYearAndSexDiagnostic(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'>, time_value_map: ~emodpy_hiv.campaign.common.ValueMap, positive_diagnosis_event: str, negative_diagnosis_event: str | None = None, linear_interpolation: bool = False, female_multiplier: float = 1, default_value: float = 0, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The HIVPiecewiseByYearAndSexDiagnostic intervention class is used to model the roll-out of an intervention over time. Unlike HIVSigmoidByYearAndSexDiagnostic, which requires the time trend to have a sigmoid shape, this intervention allows for any trend of time to be configured using piecewise or linear interpolation. The trends over time can be configured differently for males and females. Note that the term “diagnosis” is used, but this intervention is typically used more like a trend in behavior or coverage over time.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • time_value_map (ValueMap, required) – Please use the ValueMap class from emodpy_hiv.campaign.common to define the time_value_map. The years (times) and matching probabilities for test results. This parameter uses ValueMap to define Times (by year) and Values for the history and expected treatment guidelines for future years. This creates a JSON structure containing one array of Times and one for Values, which allows for a time-variable probability that can take on any shape over time. When queried at a simulation year corresponding to one of the listed Times, it returns the corresponding Value. When queried earlier than the first listed Time, it returns the default Value. When queried in between listed Times, it either returns the Value for the most recent past time (when linear_interpolation is False) or linearly interpolates Values between Times (when linear_interpolation is True). When queried after the last Time in the list, it returns the last Value. The Times and Values must be of equal length, and can consist of a single value. Times must monotonically increase.

  • positive_diagnosis_event (str, required) – If an individual tests positive, this specifies an event that may trigger another intervention when the event occurs. See Event list for events already used in EMOD or use your own custom event.

  • negative_diagnosis_event (str, optional) – If an individual tests negative, this specifies an event that may trigger another intervention when the event occurs. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • linear_interpolation (bool, optional) – When set to False, interpolation between values in the time_value_map is zero-order (‘staircase’). When set to True, interpolation between values in the time_value_map is linear. The final value is held constant for all times after the last time specified in the time_value_map. Default value: False

  • female_multiplier (float, optional) – Allows for the probabilities in the time_value_map to be different for males and females, by multiplying the female probabilities by a constant value. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 1

  • default_value (float, optional) – The probability of positive diagnosis if the intervention is used before the earliest specified time in the time_value_map. Minimum value: 0 Maximum value: 1 Default value: 0

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.HIVRandomChoice(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'>, choice_probabilities: list[float] | None = None, choice_names: list[str] | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The HIVRandomChoice intervention class is used to change the logic in how and where treatment is applied to individuals based on specified probabilities.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • choice_probabilities (list[float], required) – An array of probabilities that the event will be selected, used with choice_names. Values in map must be normalized to sum to one.

  • choice_names (list[str], required) – An array of event names to be broadcast if randomly selected, used with choice_probabilities.

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.HIVRapidHIVDiagnostic(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'>, positive_diagnosis_event: str, base_sensitivity: float | None = None, base_specificity: float = 1, sensitivity_versus_time: ~emodpy_hiv.campaign.common.ValueMap | None = None, probability_received_result: float = 1, negative_diagnosis_event: str | None = None, enable_is_symptomatic: bool = False, days_to_diagnosis: float = 0, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The HIVRapidHIVDiagnostic intervention class builds on StandardDiagnostic by also updating the individual’s knowledge of their HIV status. This can affect their access to ART in the future as well as other behaviors. This intervention should be used only if the individual’s knowledge of their status should impact a voluntary male circumcision campaign.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • positive_diagnosis_event (str, required) – If the test is positive, this specifies an event that will be broadcast. See Event list for events already used in EMOD or use your own custom event.

  • base_sensitivity (float, optional) – Use this parameter to set a constant value for sensitivity of the diagnostic. If you want to set the sensitivity over time, use the sensitivity_versus_time parameter instead. You need to set either base_sensitivity or sensitivity_versus_time. This sets the proportion of the time that individuals with the condition being tested receive a positive diagnostic test. When set to 1, the diagnostic always accurately reflects the condition. When set to zero, then individuals who have the condition always receive a false-negative diagnostic test. Minimum value: 0 Maximum value: 1 Default value: None

  • sensitivity_versus_time (ValueMap, Optional) – Use this parameter to set the sensitivity of the diagnostic test over time. If you want to set a constant value for sensitivity, use the base_sensitivity parameter instead. You need to set either base_sensitivity or sensitivity_versus_time. This expects a ValueMap object (from emodpy_hiv.campaign.common) that contains two arrays: The ‘Times’ values are the duration from when the person became infected. ‘Values’ is the sensitivity of the diagnostic for the given age of the infection. Default value: None

  • base_specificity (float, optional) – The specificity of the diagnostic. This sets the proportion of the time that individuals without the condition being tested receive a negative diagnostic test. When set to 1, the diagnostic always accurately reflects the lack of having the condition. When set to zero, then individuals who do not have the condition always receive a false-positive diagnostic test. Minimum value: 0 Maximum value: 1 Default value: 1

  • probability_received_result (float, optional) – The probability that an individual received the results of a diagnostic test. Minimum value: 0 Maximum value: 1 Default value: 1

  • negative_diagnosis_event (str, optional) – If the test is negative, this event will be broadcast. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • enable_is_symptomatic (bool, optional) – If true, requires an infection to be symptomatic to return a positive test. Default value: True

  • days_to_diagnosis (float, optional) – The number of days from diagnosis (which is done when the intervention is distributed) until a positive response is performed. The response to a negative diagnosis is done immediately when the diagnosis is made (at distribution of the intervention). Minimum value: 0 Maximum value: 3.40282e+38 Default value: 0

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.HIVSigmoidByYearAndSexDiagnostic(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'>, positive_diagnosis_event: str, year_sigmoid: ~emodpy_hiv.campaign.individual_intervention.Sigmoid, female_multiplier: float = 1, negative_diagnosis_event: str | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The HIVSigmoidByYearAndSexDiagnostic intervention class broadcasts a positive ‘diagnosis’ event by selecting a probability of that event from a sigmoidal curve versus time. For a linear approach, use HIVPiecewiseByYearandSexDiagnostic.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • positive_diagnosis_event (str, required) – If an individual tests positive, this specifies an event that may trigger another intervention when the event occurs. See Event list for events already used in EMOD or use your own custom event.

  • year_sigmoid (Sigmoid, required) – Defines a sigmoidal curve for the probability of a positive diagnosis versus time (year).

  • female_multiplier (float, optional) – Allows for the sigmoid time-varying probability to be different for males and females, by multiplying the female probability by a constant value. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 1

  • negative_diagnosis_event (str, optional) – If an individual tests negative, this specifies an event that may trigger another intervention when the event occurs. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.IVCalendar(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'>, intervention_list: list[emodpy.campaign.base_intervention.IndividualIntervention], dropout: bool = False, calendar: list['AgeAndProbability'] | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The IVCalendar intervention class contains a list of ages when an individual will receive the actual intervention. In IVCalendar, there is a list of actual interventions where the distribution is dependent on whether the individual’s age matches the next date in the calendar. This implies that at a certain age, the list of actual interventions will be distributed according to a given probability. While a typical use case might involve the distribution of calendars due to a Births event in the context of a routine vaccination schedule, calendars may also be distributed directly to individuals at at times other than birth.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • intervention_list (list[IndividualIntervention], required) – An array of interventions that will be distributed as specified by the calendar. Each time the calendar says it is time for the intervention, this list of interventions will be distributed to the person with this intervention.

  • dropout (bool, optional) – If set to true, when an intervention distribution is missed, all subsequent interventions are also missed. If set to false, all calendar dates/doses are applied independently of each other. Default value: True

  • calendar (list['AgeAndProbability'], optional) – An array of JSON objects where each object specifies the age and probability of receiving the interventions. The parameters of the Calendar objects are Age and Probability. Default value: None

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 4 common parameters: intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. The following parameters are not valid for this intervention: cost Default value: None

class AgeAndProbability(age_days: float = 0.0, probability: float = 1.0)[source]#

Bases: object

This class defines a single entry into the calendar of when an individual is to get a collection of interventions. When IVCalendar is distributed to the individual, the ‘probability’ is used to determine if the person will get the interventions as this age. If the person gets IVCalendar after ‘age’, they will not get the interventions.

Parameters:
  • age_days (float,optional) – As a parameter of a Calendar object, this parameter determines the age (in days) that the individual must be in order to receive the list of actual interventions. Minimum value: 0 Maximum value: 125 * 365 = 45,625 Default value: 0

  • probability (float,optional) – As a parameter of a Calendar object, this parameter determines the probability of an individual receiving the list of actual interventions at the corresponding age. Minimum value: 0 Maximum value: 1 Default value: 1

to_schema_dict(campaign) ReadOnlyDict[source]#

A function that converts the Sigmoid object to a schema dictionary.

class emodpy_hiv.campaign.individual_intervention.InterventionForCurrentPartners(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'>, intervention_config: ~emodpy.campaign.base_intervention.IndividualIntervention | None = None, broadcast_event: str | None = None, prioritize_partners_by: ~emodpy_hiv.utils.emod_enum.PrioritizePartnersBy = PrioritizePartnersBy.NO_PRIORITIZATION, relationship_types: list[str] | None = None, minimum_duration_years: float = 0, maximum_partners: float = 100, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The InterventionForCurrentPartners intervention class provides a mechanism for the partners of individuals in the care system to also seek care. Partners do not need to seek testing at the same time; a delay may occur between the initial test and the partner’s test. If a relationship has been paused, such as when a partner migrates to a different node, the partner will not be contacted.

Either the intervention_config or broadcast_event parameter must be set, but not both.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • intervention_config (IndividualIntervention, optional) – The intervention definition that is immediately distributed to the partner. This parameter is required if broadcast_event is not set. Default value: None

  • broadcast_event (str, optional) – The event that is immediately broadcast to the partner. See Event list for possible built-in values, or use your own custom event. This parameter is required if intervention_config is not set. Default value: None

  • prioritize_partners_by (PrioritizePartnersBy, optional) – How to prioritize partners for the intervention, as long as they have been in a relationship longer than minimum_duration_years. Expect PrioritizePartnersBy enum from emodpy_hiv.utils.emod_enum. Possible values are: * NO_PRIORTIZATION - All partners are contacted. * CHOSEN_AT_RANDOM - Partners are randomly selected until maximum_partners have received the intervention. * LONGER_TIME_IN_RELATIONSHIP - Partners are sorted in descending order of the duration of the relationship. Partners are contacted from the beginning of this list until maximum_partners have received the intervention. * SHORTER_TIME_IN RELATIONSHIP - Partners are sorted in ascending order of the duration of the relationship. Partners are contacted from the beginning of the list until maximum_partners have received the intervention. * OLDER_AGE - Partners are sorted in descending order of their age. Partners are contacted from the beginning of this list until maximum_partners have received the intervention. * YOUNGER_AGE - Partners sorted in ascending order of the duration of the relationship. Partners are contacted from the beginning of this list until maximum_partners have received the intervention. * RELATIONSHIP_TYPE - Partners are sorted based on the order of relationship types defined in the relationship_types array. For example, ‘relationship_types’ : [‘MARITAL’, ‘INFORMAL’, ‘TRANSITORY’, ‘COMMERCIAL’], will prioritize marital first, then informal, then transitory, then commercial, with random selection between mulitple partners of the same type. Default value: PrioritizePartnersBy.NO_PRIORITIZATION

  • relationship_types (list[RelationshipTypes], optional) – An array listing all possible relationship types for which partners can qualify for the intervention. Expect RelationshipTypes enum emodpy_hiv.utils.emod_enum. Possible values are: TRANSITORY, INFORMAL, MARITAL, and COMMERCIAL. If prioritize_partners_by is set to PrioritizePartnersBy.RELATIONSHIP_TYPE, then the order of these types is used. The array may not contain duplicates, and cannot be empty. Default value: None

  • minimum_duration_years (float, optional) – The minimum amount of time, in years, between relationship formation and the current time for the partner to qualify for the intervention. Minimum value: 0 Maximum value: 200 Default value: 0

  • maximum_partners (float, optional) – The maximum number of partners that will receive the intervention. Required when Prioritize_Partners_By is not set to NO_PRIORITIZATION. Minimum value: 0 Maximum value: 100 Default value: 100

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 4 common parameters: intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.MaleCircumcision(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'>, distributed_event_trigger: str | None = None, circumcision_reduced_acquire: float = 0.6, apply_if_higher_reduced_acquire: bool = False, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The MaleCircumcision intervention class introduces male circumcision as a method to control HIV transmission. Voluntary medical male circumcision (VMMC) permanently reduces a male’s likelihood of acquiring HIV; successful distribution results in a reduction in the probability of transmission.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • distributed_event_trigger (str, optional) – The name of the event to be broadcast when the intervention is distributed to an individual. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • circumcision_reduced_acquire (float, optional) – The reduction of susceptibility to STI by voluntary male medical circumcision (VMMC). Minimum value: 0 Maximum value: 1 Default value: 0.6

  • apply_if_higher_reduced_acquire (bool, optional) – If set to False, the MaleCircumcision intervention can never be applied to someone who already has a MaleCircumcision intervention. If set to True, a male who already has a MaleCircumcision intervention, but whose pre-existing MaleCircumcision intervention has a lower efficacy parameter (circumcision_reduced_acquire) than the one about to be applied, will receive the higher-efficacy MaleCircumcision. Default value: False

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.ModifyStiCoInfectionStatus(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'>, new_sti_coinfection_status: bool)[source]#

Bases: IndividualIntervention

The ModifyStiCoInfectionStatus intervention class creates or removes STI co-infections (which influence the rate of HIV transmission). This intervention can be used to represent things like STI treatment programs or STI outbreaks.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • new_sti_coinfection_status (bool, required) – Determines whether to apply STI co-infection, or cure/remove STI co-infection. Set to True to include co-infection; set to False to remove co-infection.

class emodpy_hiv.campaign.individual_intervention.PMTCT(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'>, efficacy: float = 0.5, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The PMTCT (Prevention of Mother-to-Child Transmission) intervention class is used to define the efficacy of PMTCT treatment at time of birth. This can only be used for mothers who are not on suppressive ART and will automatically expire 40 weeks after distribution. Efficacy will be reset to 0 once it expires.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • efficacy (float, optional) – Represents the efficacy of a Prevention of Mother to Child Transmission (PMTCT) intervention, defined as the rate ratio of mother to child transmission (MTCT) between women receiving the intervention and women not receiving the intervention. A setting of 1 is equivalent to 100% blocking efficacy, and 0 reverts to the default probability of transmission, configured through the config.json parameter Maternal_Transmission_Probability. Minimum value: 0 Maximum value: 1 Default value: 0.5

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 4 common parameters: intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.RangeThreshold(event_to_broadcast: str, low: float = 0, high: float = 2000)[source]#

Bases: object

An element of a look-up table where if a value (age in AgeDiagnostic or CD4 in CD4Diagnostic) is greater-than-or-equal-to the ‘Low’ value and less-than the ‘High’ value, the ‘Event’ will be broadcasted.

Parameters:
  • low (float, optional) – The low end of the diagnostic level. For this ‘Event’ to be selected, the value must be greater-than-or-equal-to (>=) this threshold. Minimum value: 0 Maximum value: 2000 Default value: 0

  • high (float, optional) – The high end of the diagnostic level. For this ‘Event’ to be selected, the value must be less-than this threshold. Minimum value: 0 Maximum value: 2000 Default value: 2000

  • event_to_broadcast (str, required) – If ‘low’ <= value < ‘high, then this event will be broadcast. See Event list for events already used in EMOD or use your own custom event.

to_schema_dict(campaign) ReadOnlyDict[source]#

A function that converts the Sigmoid object to a schema dictionary.

class emodpy_hiv.campaign.individual_intervention.STIBarrier(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'>, usage_expiration_event: str, usage_duration_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution, relationship_type: ~emodpy_hiv.utils.emod_enum.RelationshipType = RelationshipType.TRANSITORY, condom_usage_sigmoid: ~emodpy_hiv.campaign.individual_intervention.Sigmoid | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The STIBarrier intervention is used to reduce the probability of STI or HIV transmission by applying a time-variable probability of condom usage. Each STIBarrier intervention is directed at a specific relationship type, and must be configured as a sigmoid trend over time.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • usage_expiration_event (str, optional) – When the person stops using the STIBarrier, this event will be broadcasted. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • usage_duration_distribution (BaseDistribution, required) – For the distribution of each STIBarrier, a randomly selected duration from this distribution will determine when the man stops using the intervention and revert back to condom usage based on the relationship type. Please use the following distribution classes from emodpy_hiv.utils.distributions to define the distribution: * ConstantDistribution * UniformDistribution * GaussianDistribution * ExponentialDistribution * PoissonDistribution * LogNormalDistribution * DualConstantDistribution * WeibullDistribution * DualExponentialDistribution

  • relationship_type ('RelationshipType', optional) – The relationship type to which the condom usage probability is applied. Possible values are: * TRANSITORY * INFORMAL * MARITAL * COMMERCIAL Default value: TRANSITORY

  • condom_usage_sigmoid (Sigmoid, required) – The new sigmoid to use when determining the probability that a condom is used during a coital act within the specified relationship. This overrides the Condom_Usage_Probablility for the relationship type as defined in the Demographics file. If None (default), the Condom_Usage_Probablility is not overridden. - WARNING: For STIBarrier, the ‘min’ and ‘max’ values of the sigmoid must be between 0 and 1.

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.STIIsPostDebut(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'>, positive_diagnosis_config: ~emodpy.campaign.base_intervention.IndividualIntervention | None = None, negative_diagnosis_config: ~emodpy.campaign.base_intervention.IndividualIntervention | None = None, positive_diagnosis_event: str | None = None, negative_diagnosis_event: str | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The STIIsPostDebut intervention class checks to see if the individual is post-STI debut. Note that this is not connected to IndividualProperties in the demographics file.

User can either set the diagnosis_config parameters: - positive_diagnosis_config (required) - negative_diagnosis_config (optional)

or set the diagnosis_event parameters: - positive_diagnosis_event (required) - negative_diagnosis_event (optional)

but not both.

Parameters:
  • campaign (api_campaign, optional) – An instance of the emod_api.campaign module.

  • positive_diagnosis_config (IndividualIntervention, optional) – The intervention distributed to individuals if they test positive. Default value: None

  • negative_diagnosis_config (IndividualIntervention, optional) – The intervention distributed to individuals if they test negative. Default value: None

  • positive_diagnosis_event (str, optional) – The event to be broadcast on a positive test result. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • negative_diagnosis_event (str, optional) – The event to be broadcast on a negative test result. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 5 common parameters: cost, intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.SetSexualDebutAge(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'>, setting_type: ~emodpy_hiv.utils.emod_enum.SettingType = SettingType.CURRENT_AGE, distributed_event_trigger: str | None = None, age_years: float = 125, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The SetSexualDebutAge intervention class is used to set the age of the individual when they start seeking sexual relationships. If the individual’s current age is greater than the age being set, they will immediately debut.

This intervention is typically used when setting the configuration parameter Sexual_Debut_Age_Setting_Type to FROM_INTERVENTION. This setting causes all individuals to be initialized with a very large sexual debut age (max float) so that they never debut. The intervention is used to target specific individuals and set their debut age.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • setting_type ('SettingType', optional) – Use Weibull distribution to initialize sexual debut age or an intervention. Default value: CURRENT_AGE

  • distributed_event_trigger (str, optional) – The name of the event to be broadcast when the intervention is distributed to an individual. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • age_years (float, optional) – The age (in years) at which the person receiving the intervention will start seeking sexual relationships. If the person is already order than this age, they will start seeking relationships immediately. You must set Setting_Type to USER_SPECIFIED for the parameter to become activated. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 125

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 4 common parameters: intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.Sigmoid(min: float = 0, max: float = 1, mid: float = 2000, rate: float = 1)[source]#

Bases: object

Defines a sigmoidal curve that can be used to define probabilities versus time.

Parameters:
  • min (float, optional) – The left asymptote for the sigmoid trend over time. The min value must be smaller than the max value. Minimum value: -1 Maximum value: 1 Default value: 0

  • max (float, optional) – The right asymptote for the sigmoid trend over time. The max value must be larger than the min value. Minimum value: -1 Maximum value: 1 Default value: 1

  • mid (float, optional) – The time of the infection point in the sigmoid trend over time. Minimum value: 1900 Maximum value: 2200 Default value: 2000

  • rate (float, optional) – The slope of the inflection point in the sigmoid trend over time. A Rate of 1 sets the slope to a 25% change in probability per year. Specify a negative Rate (e.g. -1) to achieve a negative sigmoid. Minimum value: -100 Maximum value: 100 Default value: 1

check_value_ranges(class_name: str, min_low: float = -1, min_high: float = 1, max_low: float = -1, max_high: float = 1, mid_low: float = 0, mid_high: float = 3.40282e+38, rate_low: float = -100, rate_high: float = 100)[source]#
to_schema_dict(campaign) ReadOnlyDict[source]#

A function that converts the Sigmoid object to a schema dictionary.

class emodpy_hiv.campaign.individual_intervention.StartNewRelationship(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'>, relationship_type: ~emodpy_hiv.utils.emod_enum.RelationshipType = RelationshipType.TRANSITORY, partner_has_ip: str = '', relationship_created_event: str = '', condom_usage_sigmoid: ~emodpy_hiv.campaign.individual_intervention.Sigmoid | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)[source]#

Bases: IndividualIntervention

The StartNewRelationship intervention class provides a method of triggering the formation of a relationship following a user-specified event. The parameters of the relationship that is formed can also be customized by the user, such as individual properties required of the partner, or modified condom usage probability within the relationship. Note: These new relationships can be made by people of any age (the intervention disregards IsPostDebut and Sexual_Debut_Age_Min). Additionally, these relationships are considered outside of the Pair Formation Algorithm (PFA), and do not impact/are not impacted by concurrency or pair formation parameters. Coital act and condom usage rate are as per the corresponding relationship type, unless modified by the user.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • relationship_type ('RelationshipType', optional) – The type of the relationship to start for this person. Possible values are: * TRANSITORY * INFORMAL * MARITAL * COMMERCIAL Default value: TRANSITORY

  • partner_has_ip (str, optional) – The IndividualProperty key:value pair that the potential partner must have. Empty string implies no filtering. See NodeProperties and IndividualProperties parameters for more information. Default value: None

  • relationship_created_event (str, optional) – The event trigger to broadcast when a new relationship is created due to the intervention. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • condom_usage_sigmoid (Sigmoid, required) – The new sigmoid to use when determining the probability that a condom is used during a coital act within the specified relationship. This overrides the Condom_Usage_Probablility for the relationship type as defined in the Demographics file. If None (default), the Condom_Usage_Probablility is not overridden. - WARNING: For StartNewRelationship, the ‘min’ and ‘max’ values of the sigmoid must be between 0 and 1.

  • common_intervention_parameters (CommonInterventionParameters, optional) – The CommonInterventionParameters object that contains the 4 common parameters: intervention_name, new_property_value, disqualifying_properties, dont_allow_duplicates. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.BroadcastEvent(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, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The BroadcastEvent intervention class is an individual-level class that immediately broadcasts the event trigger you specify. This campaign event is typically used with other classes that monitor for a broadcast event.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • broadcast_event (str, required) – The name of the event to be broadcasted. See Event list for events already used in EMOD or use your own custom event.

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 4 common parameters: disqualifying_properties, new_property_value, intervention_name, dont_allow_duplicates. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.BroadcastEventToOtherNodes(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, node_selection_type: ~emodpy_hiv.utils.emod_enum.NodeSelectionType = NodeSelectionType.DISTANCE_ONLY, max_distance_to_other_nodes_km: float = 3.40282e+38, include_my_node: bool = False, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The BroadcastEventToOtherNodes intervention class allows events to be sent from one node to another. For example, if an individual in one node has been diagnosed, drugs may be distributed to individuals in surrounding nodes.

When this intervention is updated, the event to be broadcast is cached to be distributed to the nodes. After the people have migrated, the event information is distributed to the nodes - NOTE: it does support multi-core. During the next time step, the nodes will update their node-level interventions and then broadcast the events from other nodes to ALL the people in the node. This is different from interventions that only broadcast the event in the current node for the person who had the intervention. Distances between nodes use the Longitude and Latitude defined in the demographics file, and use the Haversine Formula for calculating the great-circle distance.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • broadcast_event (str, required) – The name of the event to broadcast to the people of ‘nearby’ nodes. For example, if a house is found to have malarai, broadcast an event to the people in the nearby houses so that they can get treatment. For HIV, see Event list, and for malaria, Event list for events already used in EMOD or use your own custom event.

  • node_selection_type ('NodeSelectionType', optional) – The method by which to select nodes to receive the event. Possible values are: * DISTANCE_ONLY - Nodes located within the distance specified by Max_Distance_To_Other_Nodes_Km are selected. * MIGRATION_NODES_ONLY - Nodes that are local, regional, or connected in the migration file are selected. * DISTANCE_AND_MIGRATION - Nodes are selected using DISTANCE_ONLY and MIGRATION_NODES_ONLY criteria. Default value: DISTANCE_ONLY

  • max_distance_to_other_nodes_km (float, optional) – The maximum distance, in kilometers, to the destination node for the node to be selected. The location values used are those entered in the demographics file. Used only if Node_Selection_Type is either DISTANCE_ONLY or DISTANCE_AND_MIGRATION. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 3.40282e+38

  • include_my_node (bool, optional) – Set to True to broadcast the event to the current node. Default value: True

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 4 common parameters: intervention_name, new_property_value, dont_allow_duplicates, disqualifying_properties. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.ControlledVaccine(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'>, waning_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, vaccine_type: ~emodpy_hiv.utils.emod_enum.VaccineType = VaccineType.Generic, vaccine_take: float = 1, expired_event_trigger: str | None = None, efficacy_is_multiplicative: bool = True, duration_to_wait_before_revaccination: float = 3.40282e+38, distributed_event_trigger: str | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The ControlledVaccine intervention class is a subclass of SimpleVaccine so it contains all functionality of SimpleVaccine, but provides more control over additional events and event triggers. This intervention can be configured so that specific events are broadcast when individuals receive an intervention or when the intervention expires. Further, individuals can be re-vaccinated, using a configurable wait time between vaccinations.

Note that one of the controls of this intervention is to not allow a person to receive an additional dose if they received a dose within a certain amount of time. This applies only to ControlledVaccine interventions with the same Intervention_Name, so people can be given multiple vaccines as long as each vaccine has a different value for Intervention_Name.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • waning_config (AbstractWaningConfig, required) – The configuration of the vaccine’s efficacy and waning over time. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waninng_config.

  • vaccine_type (VaccineType, optional) – The type of vaccine to distribute in a vaccine intervention. Possible values are: * Generic - The vaccine can reduce transmission, acquisition, and mortality. * TransmissionBlocking - The vaccine will reduce pathogen transmission. * AcquisitionBlocking - The vaccine will reduce the acquisition of the pathogen by reducing the force of infection experienced by the vaccinated individual. * MortalityBlocking - The vaccine reduces the disease-mortality rate of a vaccinated individual. Default value: Generic

  • vaccine_take (float, optional) – The rate at which delivered vaccines will successfully stimulate an immune response and achieve the desired efficacy. For example, if it is set to 0.9, there will be a 90 percent chance that the vaccine will start with the specified efficacy, and a 10 percent chance that it will have no efficacy at all. Minimum value: 0 Maximum value: 1 Default value: 1

  • expired_event_trigger (str, optional) – The name of the event to be broadcast when the intervention expires. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • efficacy_is_multiplicative (bool, optional) – The overall vaccine efficacy when individuals receive more than one vaccine. When set to True, the vaccine efficacies are multiplied together; when set to False, the efficacies are additive. Default value: True

  • duration_to_wait_before_revaccination (float, optional) – The length of time, in days, to wait before revaccinating an individual. After this time has passed, the individual can be revaccinated. If the first vaccine has not expired, the individual can receive the effect from both doses of the vaccine. Minimum value: 0 Maximum value: 3.40282e+38 Default value: 3.40282e+38

  • distributed_event_trigger (str, optional) –

    The name of the event to be broadcast when the intervention is distributed to an individual. See Event list for events already used in EMOD or use your own custom event.

    Default value: None

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 5 common parameters: cost, new_property_value, intervention_name, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.DelayedIntervention(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'>, delay_period_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution, intervention_to_distribute_at_delay_completion: ~emodpy.campaign.base_intervention.IndividualIntervention | list[emodpy.campaign.base_intervention.IndividualIntervention], common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The DelayedIntervention intervention class introduces a delay between when the intervention is distributed to the individual and when they receive the actual intervention. This is due to the frequent occurrences of time delays as individuals seek care and receive treatment. This intervention allows configuration of the distribution type for the delay.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • delay_period_distribution (BaseDistribution, required) – The distribution type to use for assigning the delay period for distributing interventions. 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

  • intervention_to_distribute_at_delay_completion (Union[IndividualIntervention, list[IndividualIntervention]], required) – An Individual Intervention or an array of nested Individual Interventions to be distributed at the end of the delay period. Either intervention_to_broadcast_at_delay_completion or event_to_broadcast_at_delay_completion must be set.

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 4 common parameters: intervention_name, new_property_value, dont_allow_duplicates, disqualifying_properties. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.IndividualImmunityChanger(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'>, prime_transmit: float = 0, prime_mortality: float = 0, prime_acquire: float = 0, boost_transmit: float = 0, boost_threshold_transmit: float = 0, boost_threshold_mortality: float = 0, boost_threshold_acquire: float = 0, boost_mortality: float = 0, boost_acquire: float = 0, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The IndividualImmunityChanger intervention class acts essentially as a MultiEffectVaccine, with the exception of how the behavior is implemented. Rather than attaching a persistent vaccine intervention object to an individual’s intervention list (as a campaign-individual-multieffectboostervaccine does), the IndividualImmunityChanger directly alters the immune modifiers of the individual’s susceptibility object and is then immediately disposed of. Any immune waning is not governed by Waning effect classes, as MultiEffectVaccine is, but rather by the immunity waning parameters in the configuration file.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • prime_transmit (float, optional) – Specifies the priming effect on transmission immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. Minimum value: 0 Maximum value: 1 Default value: 0

  • prime_mortality (float, optional) – Specifies the priming effect on mortality immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. Minimum value: 0 Maximum value: 1 Default value: 0

  • prime_acquire (float, optional) – Specifies the priming effect on acquisition immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_transmit (float, optional) – Specifies the boosting effect on transmission immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. This does not replace current immunity, it builds multiplicatively on top of it. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_threshold_transmit (float, optional) – Specifies how much transmission immunity is required before the vaccine changes from a prime to a boost. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_threshold_mortality (float, optional) – Specifies how much mortality immunity is required before the vaccine changes from a prime to a boost. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_threshold_acquire (float, optional) – Specifies how much acquisition immunity is required before the vaccine changes from a prime to a boost. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_mortality (float, optional) – Specifies the boosting effect on mortality immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. This does not replace current immunity, it builds multiplicatively on top of it. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_acquire (float, optional) – Specifies the boosting effect on acquisition immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. This does not replace current immunity, it builds multiplicatively on top of it. Minimum value: 0 Maximum value: 1 Default value: 0

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 1 common parameters: cost. The following parameters are not valid for this intervention: intervention_name dont_allow_duplicates new_property_value disqualifying_properties Default value: None

class emodpy_hiv.campaign.individual_intervention.IndividualNonDiseaseDeathRateModifier(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_to_modifier: ~emodpy_hiv.campaign.common.ValueMap, expiration_event: str | None = None, expiration_duration_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The IndividualNonDiseaseDeathRateModifier intervention class provides a method of modifying an individual’s non-disease mortality rate over time, until an expiration event is reached. For example, this intervention could be given to people who have access to health care to model that they have a different life expectancy than those who do not. Different distribution patterns can be designated, and linear interpolation will be used to calculate values between time points.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • duration_to_modifier (ValueMap, required) – An array of Times and Values used to specify different modifiers over the duration of the intervention. Linear interpolation is used to find the values between time points. If the duration exceeds the max time, then the last modifier value will be used.

  • expiration_event (str, optional) – When the person stops using the intervention (intervetion expires), this event will be broadcasted. See Event list for events already used in EMOD or use your own custom event. Default value: None

  • expiration_duration_distribution (BaseDistribution, optional) – For the distribution of each intervention, a randomly selected duration from this distribution will determine when the person stops using the intervention. This is independent of how long the intervention is effective. Please use the following distribution classes from emodpy.utils.distributions to define the distribution: * ConstantDistribution * UniformDistribution * GaussianDistribution * ExponentialDistribution * PoissonDistribution * LogNormalDistribution * DualConstantDistribution * WeibullDistribution * DualExponentialDistribution Default value: None

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 5 common parameters: cost, new_property_value, intervention_name, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.MigrateIndividuals(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'>, nodeid_to_migrate_to: int = 0, is_moving: bool = False, duration_before_leaving_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution | None = None, duration_at_node_distribution: ~emodpy_hiv.utils.distributions.BaseDistribution | None = None, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The MigrateIndividuals intervention class is an individual-level intervention used to force migration and is separate from the normal migration system. However, it does require that human migration is enabled by setting the configuration parameters Migration_Model to FIXED_RATE_MIGRATION and Migration_Pattern to SINGLE_ROUND_TRIP.

As individuals migrate, there are three ways to categorize nodes:

  • Home: the node where the individuals reside; each individual has a single home node.

  • Origin: the “starting point” node for each leg of the migration. The origin updates as individuals move between nodes.

  • Destination: the node the individual is traveling to. The destination updates as individuals move between nodes.

For example, Individual 1 has a home node of Node A. They migrate from Node A to Node B. Node A is both the home node and the origin node, and Node B is the destination node. If Individual 1 migrates from Node B to Node C, Node A remains the home node, but now Node B is the origin node, and Node C is the destination node. If Individual 1 migrates from Node C back to Node A, Node C is the origin node, and Node A becomes the destination node and still remains the home node.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • 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 to indicate the individual is 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

  • duration_before_leaving_distribution (BaseDistribution, optional) – The distribution type to use for assigning the duration of time an individual waits before migrating to the 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 Default value: None

  • duration_at_node_distribution (BaseDistribution, optional) – 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 Default value: None

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 4 common parameters: intervention_name, new_property_value, dont_allow_duplicates, disqualifying_properties. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.MultiEffectBoosterVaccine(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'>, transmit_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, mortality_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, acquire_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, vaccine_take: float = 1, prime_transmit: float = 0, prime_mortality: float = 0, prime_acquire: float = 0, boost_transmit: float = 0, boost_threshold_transmit: float = 0, boost_threshold_mortality: float = 0, boost_threshold_acquire: float = 0, boost_mortality: float = 0, boost_acquire: float = 0, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The MultiEffectBoosterVaccine intervention class is derived from MultiEffectVaccine and preserves many of the same parameters. Upon distribution and successful take, the vaccine’s effect in each immunity compartment (acquisition, transmission, and mortality) is determined by the recipient’s immune state. If the recipient’s immunity modifier in the corresponding compartment is above a user-specified threshold, then the vaccine’s initial effect will be equal to the corresponding priming parameter. If the recipient’s immune modifier is below this threshold, then the vaccine’s initial effect will be equal to the corresponding boost parameter. After distribution, the effect wanes, just like a MultiEffectVaccine. The behavior is intended to mimic biological priming and boosting.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • transmit_config (AbstractWaningConfig, required) – The configuration for multi-effect vaccine transmission. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waninng_config.

  • mortality_config (AbstractWaningConfig, required) – The configuration for multi-effect vaccine mortality. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waninng_config.

  • acquire_config (AbstractWaningConfig, required) – The configuration for multi-effect vaccine acquisition. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waninng_config.

  • vaccine_take (float, optional) – The rate at which delivered vaccines will successfully stimulate an immune response and achieve the desired efficacy. For example, if it is set to 0.9, there will be a 90 percent chance that the vaccine will start with the specified efficacy, and a 10 percent chance that it will have no efficacy at all. Minimum value: 0 Maximum value: 1 Default value: 1

  • prime_transmit (float, optional) – Specifies the priming effect on transmission immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. Minimum value: 0 Maximum value: 1 Default value: 0

  • prime_mortality (float, optional) – Specifies the priming effect on mortality immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. Minimum value: 0 Maximum value: 1 Default value: 0

  • prime_acquire (float, optional) – Specifies the priming effect on acquisition immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_transmit (float, optional) – Specifies the boosting effect on transmission immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. This does not replace current immunity, it builds multiplicatively on top of it. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_threshold_transmit (float, optional) – Specifies how much transmission immunity is required before the vaccine changes from a prime to a boost. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_threshold_mortality (float, optional) – Specifies how much mortality immunity is required before the vaccine changes from a prime to a boost. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_threshold_acquire (float, optional) – Specifies how much acquisition immunity is required before the vaccine changes from a prime to a boost. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_mortality (float, optional) – Specifies the boosting effect on mortality immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. This does not replace current immunity, it builds multiplicatively on top of it. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_acquire (float, optional) – Specifies the boosting effect on acquisition immunity for naive individuals (without natural or vaccine-derived immunity) for a multi-effect booster vaccine. This does not replace current immunity, it builds multiplicatively on top of it. Minimum value: 0 Maximum value: 1 Default value: 0

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 5 common parameters: cost, new_property_value, intervention_name, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.MultiEffectVaccine(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'>, transmit_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, mortality_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, acquire_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, vaccine_take: float = 1, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The MultiEffectVaccine intervention class implements vaccine campaigns in the simulation. Vaccines can effect all of the following:

  • Reduce the likelihood of acquiring an infection

  • Reduce the likelihood of transmitting an infection

  • Reduce the likelihood of death

After distribution, the effect wanes over time.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • transmit_config (AbstractWaningConfig, required) – The configuration for multi-effect vaccine transmission. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waninng_config.

  • mortality_config (AbstractWaningConfig, required) – The configuration for multi-effect vaccine mortality. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waninng_config.

  • acquire_config (AbstractWaningConfig, required) – The configuration for multi-effect vaccine acquisition. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waninng_config.

  • vaccine_take (float, optional) – The rate at which delivered vaccines will successfully stimulate an immune response and achieve the desired efficacy. For example, if it is set to 0.9, there will be a 90 percent chance that the vaccine will start with the specified efficacy, and a 10 percent chance that it will have no efficacy at all. Minimum value: 0 Maximum value: 1 Default value: 1

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 5 common parameters: cost, new_property_value, intervention_name, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.MultiInterventionDistributor(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'>, intervention_list: list[emodpy.campaign.base_intervention.IndividualIntervention], common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The MultiInterventionDistributor intervention class allows you to input a list of interventions, rather than just a single intervention, to be distributed simultaneously to the same individuals.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • intervention_list (list[IndividualIntervention], required) – The list of individual interventions that is distributed by MultiInterventionDistributor.

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 4 common parameters: intervention_name, new_property_value, dont_allow_duplicates, disqualifying_properties. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.OutbreakIndividual(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'>, incubation_period_override: int = -1, ignore_immunity: bool = True, genome: int = 0, antigen: int = 0)#

Bases: IndividualIntervention

The OutbreakIndividual intervention class introduces contagious diseases that are compatible with the simulation type to existing individuals using the individual targeted features configured in the appropriate event coordinator. To instead add new infection individuals, use Outbreak.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • incubation_period_override (int, optional) – The incubation period, in days, that infected individuals will go through before becoming infectious. This value overrides the incubation period set in the configuration file. Note for HIV simulations only: If set to 0, infection is assumed to be part of an outbreak event and a random duration until death is determined. For all other simulation types: Set to -1 to honor the configuration parameter settings. Minimum value: -1 Maximum value: 2147480000.0 Default value: -1

  • ignore_immunity (bool, optional) – Individuals will be force-infected (with a specific strain) regardless of actual immunity level when set to True. Default value: True

  • 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

class emodpy_hiv.campaign.individual_intervention.PropertyValueChanger(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_property_value: str, target_property_key: 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: IndividualIntervention

The PropertyValueChanger intervention class assigns new individual property values to individuals You must update one property value and have the option to update another using New_Property_Value. This parameter is generally used to move patients from one intervention state in the health care cascade (InterventionStatus/CascadeState) to another, though it can be used for any individual property. Individual property values are user-defined in the demographics file (see NodeProperties and IndividualProperties for more information). Note that the HINT feature does not need to be enabled to use this intervention. To instead change node properties, use NodePropertyValueChanger.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • target_property_value (str, required) – The user-defined value of the individual property that will be assigned to the individual.

  • target_property_key (str, required) – The name of the individual property type whose value will be updated by the intervention.

  • revert (float, optional) – The number of days to keep the value (Target_Property_Value) of the property (Target_Property_Key) set by the intervenion for the individual. When the time has expired, the intervention will reset the property 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 individuals have to move to a new group. 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 an individual’s property value changes to the Target_Property_Value. Minimum value: 0 Maximum value: 1 Default value: 1

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 4 common parameters: intervention_name, new_property_value, dont_allow_duplicates, disqualifying_properties. The following parameters are not valid for this intervention: cost Default value: None

class emodpy_hiv.campaign.individual_intervention.SimpleBoosterVaccine(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'>, waning_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, vaccine_type: ~emodpy_hiv.utils.emod_enum.VaccineType = VaccineType.Generic, vaccine_take: float = 1, prime_effect: float = 1, efficacy_is_multiplicative: bool = True, boost_threshold: float = 0, boost_effect: float = 1, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The SimpleBoosterVaccine intervention class is derived from SimpleVaccine and preserves many of the same parameters. The behavior is much like SimpleVaccine, except that upon distribution and successful take, the vaccine’s effect is determined by the recipient’s immune state. If the recipient’s immunity modifier in the corresponding channel (acquisition, transmission, or mortality) is above a user-specified threshold, then the vaccine’s initial effect will be equal to the corresponding priming parameter. If the recipient’s immune modifier is below this threshold, then the vaccine’s initial effect will be equal to the corresponding boosting parameter. After distribution, the effect wanes, just like SimpleVaccine. In essence, this intervention provides a SimpleVaccine intervention with one effect to all naive (below- threshold) individuals, and another effect to all primed (above-threshold) individuals; this behavior is intended to mimic biological priming and boosting.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • waning_config (AbstractWaningConfig, required) – The configuration of the vaccine’s efficacy and waning over time. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waninng_config.

  • vaccine_type (VaccineType, optional) – The type of vaccine to distribute in a vaccine intervention. Possible values are: * Generic - The vaccine can reduce transmission, acquisition, and mortality. * TransmissionBlocking - The vaccine will reduce pathogen transmission. * AcquisitionBlocking - The vaccine will reduce the acquisition of the pathogen by reducing the force of infection experienced by the vaccinated individual. * MortalityBlocking - The vaccine reduces the disease-mortality rate of a vaccinated individual. Default value: Generic

  • vaccine_take (float, optional) – The rate at which delivered vaccines will successfully stimulate an immune response and achieve the desired efficacy. For example, if it is set to 0.9, there will be a 90 percent chance that the vaccine will start with the specified efficacy, and a 10 percent chance that it will have no efficacy at all. Minimum value: 0 Maximum value: 1 Default value: 1

  • prime_effect (float, optional) – Specifies the priming effect on [acquisition/transmission/mortality] immunity for naive individuals (without natural or vaccine-derived immunity). Minimum value: 0 Maximum value: 1 Default value: 1

  • efficacy_is_multiplicative (bool, optional) – The overall vaccine efficacy when individuals receive more than one vaccine. When set to True, the vaccine efficacies are multiplied together; when set to False, the efficacies are additive. Default value: True

  • boost_threshold (float, optional) – Specifies how much immunity is required before the vaccine changes from a priming effect to a boosting effect. Minimum value: 0 Maximum value: 1 Default value: 0

  • boost_effect (float, optional) – Specifies the boosting effect on [acquisition/transmission/mortality] immunity for previously exposed individuals (either natural or vaccine-derived). This does not replace current immunity, it builds multiplicatively on top of it. Minimum value: 0 Maximum value: 1 Default value: 1

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 5 common parameters: cost, new_property_value, intervention_name, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.SimpleVaccine(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'>, waning_config: ~emodpy_hiv.campaign.waning_config.AbstractWaningConfig, vaccine_type: ~emodpy_hiv.utils.emod_enum.VaccineType = VaccineType.Generic, vaccine_take: float = 1, efficacy_is_multiplicative: bool = True, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The SimpleVaccine intervention class implements vaccine campaigns in the simulation. Vaccines can have an effect on one of the following:

  • Reduce the likelihood of acquiring an infection

  • Reduce the likelihood of transmitting an infection

  • Reduce the likelihood of death

To configure vaccines that have an effect on more than one of these, use MultiEffectVaccine instead.

Parameters:
  • campaign (api_campaign, required) – An instance of the emod_api.campaign module.

  • waning_config (AbstractWaningConfig, required) – The configuration of the vaccine’s efficacy and waning over time. Specify how this effect decays over time using one of the Waning Config classes in emodpy.campaign.waning_config.

  • vaccine_type (VaccineType, optional) – The type of vaccine to distribute in a vaccine intervention. Possible values are: * Generic - The vaccine can reduce transmission, acquisition, and mortality. * TransmissionBlocking - The vaccine will reduce pathogen transmission. * AcquisitionBlocking - The vaccine will reduce the acquisition of the pathogen by reducing the force of infection experienced by the vaccinated individual. * MortalityBlocking - The vaccine reduces the disease-mortality rate of a vaccinated individual. Default value: Generic

  • vaccine_take (float, optional) – The rate at which delivered vaccines will successfully stimulate an immune response and achieve the desired efficacy. For example, if it is set to 0.9, there will be a 90 percent chance that the vaccine will start with the specified efficacy, and a 10 percent chance that it will have no efficacy at all. Minimum value: 0 Maximum value: 1 Default value: 1

  • efficacy_is_multiplicative (bool, optional) – The overall vaccine efficacy when individuals receive more than one vaccine. When set to True, the vaccine efficacies are multiplied together; when set to False, the efficacies are additive. Default value: True

  • common_intervention_parameters (CommomInterventionParameters, optional) – The CommonInterventionParameters object that Additional parameters that contains the 5 common parameters: cost, new_property_value, intervention_name, disqualifying_properties, dont_allow_duplicates. Default value: None

class emodpy_hiv.campaign.individual_intervention.StandardDiagnostic(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'>, positive_diagnosis_config: ~emodpy.campaign.base_intervention.IndividualIntervention | None = None, negative_diagnosis_config: ~emodpy.campaign.base_intervention.IndividualIntervention | None = None, positive_diagnosis_event: str | None = None, negative_diagnosis_event: str | None = None, treatment_fraction: float = 1, enable_is_symptomatic: bool = False, days_to_diagnosis: float = 0, base_specificity: float = 1, base_sensitivity: float = 1, common_intervention_parameters: ~emodpy_hiv.campaign.common.CommonInterventionParameters | None = None)#

Bases: IndividualIntervention

The StandardDiagnostic intervention class identifies infected individuals, regardless of disease state, based on specified diagnostic sensitivity and specificity. Diagnostics are a key component of modern disease control efforts, whether used to identify high-risk individuals, infected individuals, or drug resistance. The individual receives the diagnostic test immediately when the intervention is distributed, but there may be a delay in receiving a positive result. This intervention class distributes a specified intervention to a fraction of individuals who test positive.

  • You can use either the XXX_diagnosis_config or XXX_diagnosis_event parameters, but not both.

  • You must specifiy a response for a postive diagnosis, but not for a negative diagnosis.

Parameters:
  • campaign (api_campaign, required) –

    • An instance of the emod_api.campaign module.

  • positive_diagnosis_config (IndividualIntervention, optional) –

    • The intervention distributed to individuals if they test positive.

    • Must be defined if not using postive_diagnosis_event.

    • Cannot have both positive_diagnosis_config and positive_diagnosis_event.

    • Default value: None

  • negative_diagnosis_config (IndividualIntervention, optional) –

    • The intervention distributed to individuals if they test negative.

    • If using postive_diagnosis_config, you can use negative_diagnosis_config, but not negative_diagnosis_event.

    • Can use this or negative_diagnosis_event, but not both.

    • Default value: None

  • positive_diagnosis_event (str, optional) –

    • If the test is positive, this specifies an event that can trigger another intervention when the event occurs.

    • Must be defined if not using positive_diagnosis_config.

    • Cannot have both positive_diagnosis_config and positive_diagnosis_event.

    • For HIV, see Event list, and for malaria, Event list for events already used in EMOD or use your own custom event.

    • Default value: None

  • negative_diagnosis_event (str, optional) –

    • This parameter defines the event to be broadcasted on a negative test result.

    • Cannot have both negative_diagnosis_config and negative_diagnosis_event.

    • if using positive_diagnosis_config, you can use negative_diagnosis_config, but not negative_diagnosis_event.

    • For HIV, see Event list, and for malaria, Event list for events already used in EMOD or use your own custom event.

    • Default value: None

  • treatment_fraction (float, optional) –

    • The fraction of positive diagnoses that are given the positive_diagnosis_config or positive_diagnosis_event, whichever is defined. This does not affect the distribution of the negative diagnosis.

    • Minimum value: 0

    • Maximum value: 1

    • Default value: 1

  • enable_is_symptomatic (bool, optional) –

    • If True, requires an infection to be symptomatic to return a positive test.

    • Default value: True

  • days_to_diagnosis (float, optional) –

    • The number of days from the test, which is done when the intervention is distributed, until the positive_diagnosis_config or positive_diagnosis_event (whichever is defined) are distributed if the test had a positive diagnosis. The negative_diagnosis_config or negative_diagnosis_event is distributed immediately if the test is negative.

    • Minimum value: 0

    • Maximum value: 3.40282e+38

    • Default value: 0

  • base_specificity (float, optional) –

    • The specificity of the diagnostic. This sets the proportion of the time that individuals without the condition being tested receive a negative diagnostic test. When set to 1, the diagnostic always accurately reflects the lack of having the condition. When set to zero, then individuals who do not have the condition always receive a false-positive diagnostic test.

    • Minimum value: 0

    • Maximum value: 1

    • Default value: 1

  • base_sensitivity (float, optional) –

    • The sensitivity of the diagnostic. This sets the proportion of the time that individuals with the condition being tested receive a positive diagnostic test. When set to 1, the diagnostic always accurately reflects the condition. When set to zero, then individuals who have the condition always receive a false-negative diagnostic test.

    • Minimum value: 0

    • Maximum value: 1

    • Default value: 1

  • common_intervention_parameters (CommomInterventionParameters, optional) –

    • The CommonInterventionParameters object that contains the 5 common additional parameters: cost, new_property_value, intervention_name, disqualifying_properties, dont_allow_duplicates.

    • Default value: None