emodpy_hiv.campaign.coc module#

class emodpy_hiv.campaign.coc.CustomEvent[source]#

Bases: object

ART_STAGING = 'ARTStaging'#
ART_STAGING_0 = 'ARTStaging0'#
ART_STAGING_1 = 'ARTStaging1'#
ART_STAGING_2 = 'ARTStaging2'#
ART_STAGING_3 = 'ARTStaging3'#
ART_STAGING_4 = 'ARTStaging4'#
ART_STAGING_5 = 'ARTStaging5'#
ART_STAGING_6 = 'ARTStaging6'#
ART_STAGING_8 = 'ARTStaging8'#
ART_STAGING_9 = 'ARTStaging9'#
STI_DEBUT = 'STIDebut'#
COMMERCIAL_UPTAKE = 'Commercial_Uptake'#
COMMERCIAL_DROPOUT = 'Commercial_Dropout'#
COMMERCIAL_DELAY_FROM_DEBUT_UPTAKE = 'Commercial_DelayFromDebutToUptake'#
HCT_TESTING_LOOP = 'HCTTestingLoop'#
HCT_TESTING_LOOP_0 = 'HCTTestingLoop0'#
HCT_TESTING_LOOP_1 = 'HCTTestingLoop1'#
HCT_TESTING_LOOP_2 = 'HCTTestingLoop2'#
HCT_UPTAKE_POST_DEBUT_0 = 'HCTUptakePostDebut0'#
HCT_UPTAKE_POST_DEBUT_1 = 'HCTUptakePostDebut1'#
HCT_UPTAKE_POST_DEBUT_2 = 'HCTUptakePostDebut2'#
HCT_UPTAKE_POST_DEBUT_3 = 'HCTUptakePostDebut3'#
HCT_UPTAKE_POST_DEBUT_7 = 'HCTUptakePostDebut7'#
HCT_UPTAKE_POST_DEBUT_8 = 'HCTUptakePostDebut8'#
HCT_UPTAKE_POST_DEBUT_9 = 'HCTUptakePostDebut9'#
LINKING_TO_ART_0 = 'LinkingToART0'#
LINKING_TO_PRE_ART_0 = 'LinkingToPreART0'#
LOST_FOREVER_0 = 'LostForever0'#
LOST_FOREVER_9 = 'LostForever9'#
ON_ART_0 = 'OnART0'#
ON_ART_1 = 'OnART1'#
ON_PRE_ART = 'OnPreART'#
ON_PRE_ART_0 = 'OnPreART0'#
ON_PRE_ART_1 = 'OnPreART1'#
ON_PRE_ART_2 = 'OnPreART2'#
ON_PRE_ART_3 = 'OnPreART3'#
ON_PRE_ART_4 = 'OnPreART4'#
class emodpy_hiv.campaign.coc.CascadeState[source]#

Bases: object

LOST_FOREVER = 'CascadeState:LostForever'#
ON_ART = 'CascadeState:OnART'#
LINKING_TO_ART = 'CascadeState:LinkingToART'#
ON_PRE_ART = 'CascadeState:OnPreART'#
LINKING_TO_PRE_ART = 'CascadeState:LinkingToPreART'#
ART_STAGING = 'CascadeState:ARTStaging'#
ART_STAGING_DIAGNOSTIC_TEST = 'CascadeState:ARTStagingDiagnosticTest'#
TESTING_ON_SYMPTOMATIC = 'CascadeState:TestingOnSymptomatic'#
TESTING_ON_ANC = 'CascadeState:TestingOnANC'#
TESTING_ON_CHILD_6W = 'CascadeState:TestingOnChild6w'#
HCT_TESTING_LOOP = 'CascadeState:HCTTestingLoop'#
HCT_UPTAKE_AT_DEBUT = 'CascadeState:HCTUptakeAtDebut'#
HCT_UPTAKE_POST_DEBUT = 'CascadeState:HCTUptakePostDebut'#
emodpy_hiv.campaign.coc.timestep_from_year(year: float | int, base_year: float | int) int[source]#

Converts a year into a timestep based on a base year.

Parameters:
  • year (Union[float, int]) – The year to be converted.

  • base_year (Union[float, int]) – The base year for the conversion.

Returns:

The timestep corresponding to the given year.

Return type:

int

emodpy_hiv.campaign.coc.convert_time_value_map(time_value_map) dict[source]#

Converts a time-value map into a dictionary where each time is a key and its corresponding value is the value. This is the expected format for the TVMap in the current emodpy-hiv interventions code, ex. yearandsexdiag.new_diagnostic function.

Parameters:

time_value_map (dict) – A dictionary containing two lists, “Times” and “Values”. “Times” is a list of times (years) and “Values” is a list of corresponding values.

Returns:

A dictionary where each time from “Times” is a key and its corresponding value from “Values” is the value.

Return type:

dict

Example

>>> time_value_map = {"Times": [2002, 2010.5, 2013.95], "Values": [200, 350, 500]}
>>> convert_time_value_map(time_value_map)
{2002: 200, 2010.5: 350, 2013.95: 500}
emodpy_hiv.campaign.coc.seed_infections(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'>, seeding_node_ids: ~typing.List[int] | None = None, seeding_start_year: float = 1982, seeding_coverage: float = 0.075, seeding_target_min_age: float = 0, seeding_target_max_age: float = 200, seeding_target_gender: str = 'All', seeding_target_property_restrictions: list | None = None) None[source]#

Add a OutbreakIndividual intervention with StandardEventCoordinator to the campaign object. :param campaign: emod_api.campaign object :param seeding_node_ids: List of node IDs to seed infections in. Defaults to None, which seeds infections in all nodes. :param seeding_start_year: The year to start seeding infections. Defaults to 1982. :param seeding_coverage: The coverage of the seeding infections. Defaults to 0.075. :param seeding_target_min_age: The minimum age of the target population. Defaults to 0. :param seeding_target_max_age: The maximum age of the target population. Defaults to 200. :param seeding_target_gender: The gender of the target population. Defaults to “All”. Options are “Male”, “Female”, or “All”. :param seeding_target_property_restrictions: List of property restrictions. Defaults to None.

Returns:

None

emodpy_hiv.campaign.coc.add_csw(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'>, node_ids: ~typing.List[int] | None = None, male_uptake_coverage: float = 0.03, female_uptake_coverage: float = 0.03)[source]#

Manages commercial sex worker (CSW) uptake and dropout (with delays) for men and women.

Setting a few women to Risk=HIGH and significantly more men to Risk=HIGH makes the women the sex workers and the men the sex clients. Supply and demand cause the females to have lots of relationships with the men that are also Risk=HIGH. The women have lots of relationships because so many men want them, but the scarcity of the women allow the men to have only a few.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the CSW management is to be added.

  • node_ids (List[int], optional) – A list of node IDs where the CSW management is to be applied. Defaults to None, which applies to all nodes.

  • male_uptake_coverage (float, optional) – The coverage of CSW uptake among males. Defaults to 0.03.

  • female_uptake_coverage (float, optional) – The coverage of CSW uptake among females. Defaults to 0.03.

Returns:

None

Example

>>> add_csw(campaign, node_ids=[1, 2, 3], male_uptake_coverage=0.05, female_uptake_coverage=0.04)
emodpy_hiv.campaign.coc.add_post_debut_coinfection(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'>, coinfection_node_ids: ~typing.List[int] | None = None, coinfection_coverage: float = 0.3, coinfection_gender: str = 'All', coinfection_IP: ~typing.List[str] | str = 'Risk:HIGH')[source]#

Manages the addition of co-infections post sexual debut in the campaign.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the co-infection management is to be added.

  • coinfection_node_ids (List[int], optional) – A list of node IDs where the co-infection management is to be applied. Defaults to None, which applies to all nodes.

  • coinfection_coverage (float, optional) – The coverage of co-infection among the population. Defaults to 0.3.

  • coinfection_gender (str, optional) – The gender to which the co-infection management is to be applied. Defaults to ‘All’, which applies to all genders.

  • coinfection_IP (Union[List[str], str], optional) – The individual properties to which the co-infection management is to be applied. Defaults to “Risk:HIGH”.

Returns:

None

Example

>>> add_post_debut_coinfection(campaign, coinfection_node_ids=[1, 2, 3], coinfection_coverage=0.4, coinfection_gender='Male', coinfection_IP="Risk:MEDIUM")
emodpy_hiv.campaign.coc.add_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'>, child_testing_time_value_map: dict, child_testing_start_year: float = 2004, node_ids: ~typing.List[int] | None = None, coverage: float = 1.0, start_year: float = 1990, sigmoid_ramp_min: float = 0, sigmoid_ramp_max: float = 0.975, sigmoid_ramp_midyear: float = 2005.87, sigmoid_ramp_rate: float = 0.7136, link_to_ART_rate: float = 0.8, treatment_a_efficacy: float = 0.9, treatment_b_efficacy: float = 0.96667, sdNVP_efficacy: float = 0.66)[source]#

Manages the addition of prevention of mother-to-child transmission (PMTCT) in the campaign.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the PMTCT management is to be added.

  • child_testing_time_value_map (dict) – A dictionary containing time-value map for child testing.

  • child_testing_start_year (float, optional) – The start year for child testing. Defaults to 2004.

  • node_ids (List[int], optional) – A list of node IDs where the PMTCT management is to be applied. Defaults to None, which applies to all nodes.

  • coverage (float, optional) – The coverage of PMTCT among the population. Defaults to 1.0.

  • start_year (float, optional) – The start year for PMTCT. Defaults to 1990.

  • sigmoid_ramp_min (float, optional) – The minimum value for the sigmoid ramp. Defaults to 0.

  • sigmoid_ramp_max (float, optional) – The maximum value for the sigmoid ramp. Defaults to 0.975.

  • sigmoid_ramp_midyear (float, optional) – The midyear for the sigmoid ramp. Defaults to 2005.87.

  • sigmoid_ramp_rate (float, optional) – The rate for the sigmoid ramp. Defaults to 0.7136.

  • link_to_ART_rate (float, optional) – The rate for linking to ART. Defaults to 0.8.

  • treatment_a_efficacy (float, optional) – The efficacy of treatment A. Defaults to 0.9.

  • treatment_b_efficacy (float, optional) – The efficacy of treatment B. Defaults to 0.96667.

  • sdNVP_efficacy (float, optional) – The efficacy of Single-Dose Nevirapine (sdNVP). Defaults to 0.66.

Returns:

None

Example

>>> add_pmtct(campaign, child_testing_time_value_map={"Times": [2002, 2010.5, 2013.95], "Values": [200, 350, 500]}, node_ids=[1, 2, 3], coverage=0.8, start_year=1995, sigmoid_ramp_min=0.1, sigmoid_ramp_max=0.9, sigmoid_ramp_midyear=2005, sigmoid_ramp_rate=0.7, link_to_ART_rate=0.85, treatment_a_efficacy=0.92, treatment_b_efficacy=0.96, sdNVP_efficacy=0.7)
emodpy_hiv.campaign.coc.add_traditional_male_circumcision(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'>, traditional_male_circumcision_start_year: float = 1961, randomchoice_start_year: float = 1975, traditional_male_circumcision_coverage: float = 0.054978651, traditional_male_circumcision_reduced_acquire: float = 0.6, traditional_male_circumcision_node_ids: ~typing.List[int] | None = None)[source]#

Manages the addition of traditional male circumcision in the campaign.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the traditional male_circumcision management is to be added.

  • traditional_male_circumcision_start_year (float, optional) – The start year for traditional male_circumcision interventions. Defaults to 1961.

  • randomchoice_start_year (float, optional) – The start year for randomchoice_start_year interventions. Defaults to 1975.

  • traditional_male_circumcision_coverage (float, optional) – The coverage of traditional male_circumcision among the male population. Defaults to 0.054978651.

  • traditional_male_circumcision_reduced_acquire (float, optional) – The reduced acquire rate for traditional male_circumcision. Defaults to 0.6.

  • traditional_male_circumcision_node_ids (List[int], optional) – A list of node IDs where the traditional male_circumcision management is to be applied. Defaults to None, which applies to all nodes.

Returns:

None

Example

>>> add_traditional_male_circumcision(campaign, traditional_male_circumcision_coverage=0.06, traditional_male_circumcision_reduced_acquire=0.5, traditional_male_circumcision_node_ids=[1, 2, 3])
emodpy_hiv.campaign.coc.add_vmmc_reference_tracking(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'>, vmmc_time_value_map: dict, vmmc_reduced_acquire: float = 0.6, vmmc_target_min_age: float = 15, vmmc_target_max_age: float = 29.999999, vmmc_start_year: float = 2015, vmmc_node_ids: ~typing.List[int] | None = None, update_period: float = 30.4166666666667, distributed_event_trigger: str = 'Program_VMMC', target_disease_state: str = 'HIV_Negative')[source]#

Manages the addition of voluntary male medical circumcision (VMMC) reference tracking in the campaign.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the VMMC reference tracking is to be added.

  • vmmc_time_value_map (dict) – A dictionary containing time-value map for VMMC.

  • vmmc_reduced_acquire (float, optional) – The reduced acquire rate for VMMC. Defaults to 0.6.

  • vmmc_target_min_age (float, optional) – The minimum age for VMMC target. Defaults to 15.

  • vmmc_target_max_age (float, optional) – The maximum age for VMMC target. Defaults to 29.999999.

  • vmmc_start_year (float, optional) – The start year for VMMC. Defaults to 2015.

  • vmmc_node_ids (List[int], optional) – A list of node IDs where the VMMC reference tracking is to be applied. Defaults to None, which applies to all nodes.

  • update_period (float, optional) – The update period for VMMC reference tracking. Defaults to 30.4166666666667.

  • distributed_event_trigger (str, optional) – The trigger for distributed event. Defaults to PROGRAM_VMMC.

  • target_disease_state (str, optional) – The target disease state for VMMC reference tracking. Defaults to HIV_NEGATIVE.

Returns:

The intervention name for male circumcision.

Return type:

str

Example

>>> add_vmmc_reference_tracking(campaign, vmmc_time_value_map={"Times": [2002, 2010.5, 2013.95], "Values": [200, 350, 500]}, vmmc_node_ids=[1, 2, 3], vmmc_reduced_acquire=0.5, vmmc_target_min_age=10, vmmc_target_max_age=30, vmmc_start_year=2010, update_period=30, distributed_event_trigger=PROGRAM_VMMC, target_disease_state=HIV_NEGATIVE)
emodpy_hiv.campaign.coc.add_historical_vmmc_nchooser(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'>, historical_vmmc_distributions_by_time: ~pandas.core.frame.DataFrame, historical_vmmc_reduced_acquire: float = 0.6, historical_vmmc_property_restrictions: ~typing.List[str] | None = None, historical_vmmc_start_year: float = 2008, historical_vmmc_node_ids: ~typing.List[int] | None = None, has_intervention_name_exclusion: str = 'Any_MC', event_name='nchooser of VMMC')[source]#

Adds voluntary male medical circumcision (VMMC) with NChooser coordinator to the campaign. This is used to add historical VMMC events to the campaign.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the historical VMMC management is to be added.

  • historical_vmmc_distributions_by_time (pd.DataFrame) – A DataFrame containing the distributions of historical VMMC by time.

  • historical_vmmc_reduced_acquire (float, optional) – The reduced acquire rate for historical VMMC. Defaults to 0.6.

  • historical_vmmc_property_restrictions (List[str], optional) – A list of property restrictions for historical VMMC. Defaults to None.

  • historical_vmmc_start_year (float, optional) – The start year for historical VMMC. Defaults to 2008.

  • historical_vmmc_node_ids (List[int], optional) – A list of node IDs where the historical VMMC management is to be applied. Defaults to None, which applies to all nodes.

  • has_intervention_name_exclusion (str, optional) – The name of the intervention to look for in an individual when targeting specific disease states. It’s also the Intervention_Name of the MaleCircumcision intervention. Defaults to ANY_MC, to match the intervention name in add_traditional_vmmc() and add_vmmc_reference_tracking().

  • event_name (str, optional) – The name of the event. Defaults to ‘nchooser of VMMC’.

Returns:

None

Example

>>> data = {'year': [2010, 2010, 2011, 2011],
>>>         'min_age': [1, 15, 1, 15],
>>>         'max_age': [14.999, 49.999, 14.999, 49.999],
>>>         'n_circumcisions': [200, 1300, 290, 1490]}
>>> historical_vmmc_distributions_by_time = pd.DataFrame.from_dict(data)
>>> add_historical_vmmc_nchooser(campaign,
>>>                              historical_vmmc_distributions_by_time=historical_vmmc_distributions_by_time,
>>>                              historical_vmmc_reduced_acquire=0.5,
>>>                              historical_vmmc_property_restrictions=None,
>>>                              historical_vmmc_start_year=2007,
>>>                              historical_vmmc_node_ids=[1, 2, 3],
>>>                              has_intervention_name_exclusion=ANY_MC)
emodpy_hiv.campaign.coc.add_health_care_testing(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'>, hct_node_ids: ~typing.List[int] | None = None, hct_start_year: float = 1990, hct_reentry_rate: float = 1, hct_retention_rate: float = 0.95, hct_delay_to_next_test: int | ~typing.List[int] | None = None, hct_delay_to_next_test_node_ids: ~typing.List[int] | None = None, hct_delay_to_next_test_node_names: ~typing.List[str] | None = None, tvmap_test_for_enter_HCT_testing_loop: dict = {1990: 0, 2016: 0}, tvmap_consider_immediate_ART: dict = {1990: 0, 2016: 0})[source]#

Manages the addition of health care testing in the campaign.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the health care testing is to be added.

  • hct_node_ids (List[int], optional) – A list of node IDs where the health care testing is to be applied. Defaults to None, which applies to all nodes.

  • hct_start_year (float, optional) – The start year for health care testing. Defaults to 1990.

  • hct_reentry_rate (float, optional) – The reentry rate for health care testing. Defaults to 1.

  • hct_retention_rate (float, optional) – The retention rate for health care testing. Defaults to 0.95.

  • hct_delay_to_next_test (Union[int, List[int]], optional) – The delay to the next test in days. If it’s a list, it will add different delays(using HIVMuxer) for different node sets which are defined in hct_delay_to_next_test_node_ids. If it’s a single value, it will apply the same delay to all nodes in hct_node_ids. Defaults to None, which will apply the Zambia model default values: [730, 365, 1100].

  • hct_delay_to_next_test_node_ids (List[int], optional) – A list of node sets where the different delays will be applied. It’s used when hct_delay_to_next_test is a list. Defaults to None, which will apply the Zambia model default values: [[1, 2, 3, 4, 6, 7], [5, 9, 10], [8]].

  • hct_delay_to_next_test_node_names (List[str], optional) – A list of node set names where the different delays will be applied. It’s used when hct_delay_to_next_test is a list. Defaults to None, which will apply the Zambia model default values: [‘Default’, ‘Lusaka, Southern, Western’, ‘Northern’].

  • tvmap_test_for_enter_HCT_testing_loop (dict, optional) – A dictionary containing time-value map for testing for entering HCT testing loop in HCTUptakePostDebut state. Defaults to all_negative_time_value_map.

  • tvmap_consider_immediate_ART (dict, optional) – A dictionary containing time-value map for considering immediate ART in HCTTestingLoop state. Defaults to all_negative_time_value_map.

Returns:

None

Example

>>> add_health_care_testing(
>>>     campaign,
>>>     hct_node_ids=[1, 2, 3],
>>>     hct_start_year=1995,
>>>     hct_reentry_rate=0.9,
>>>     hct_retention_rate=0.85,
>>>     hct_delay_to_next_test=365
>>> )
emodpy_hiv.campaign.coc.add_ART_cascade(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'>, art_cascade_node_ids: ~typing.List[int] | None = None, art_cascade_start_year: float = 1990, art_cascade_pre_staging_retention: float = 0.85, art_cascade_cd4_retention_rate: float = 1, art_cascade_pre_art_retention: float = 0.75, art_cascade_immediate_art_rate: float = 0.1, art_cascade_art_reenrollment_willingness: float = 0.9, tvmap_increased_symptomatic_presentation: dict = {1990: 0, 2016: 0}, tvmap_immediate_ART_restart: dict = {1990: 0, 2016: 0}, tvmap_reconsider_lost_forever: dict = {1990: 0, 2016: 0})[source]#

Manages the addition of Antiretroviral Therapy (ART) cascade in the campaign.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the ART cascade is to be added.

  • art_cascade_node_ids (List[int], optional) – A list of node IDs where the ART cascade is to be applied. If None, the ART cascade applies to all nodes. Defaults to None.

  • art_cascade_start_year (float, optional) – The start year for the ART cascade. Defaults to 1990.

  • art_cascade_pre_staging_retention (float, optional) – The retention rate before ART staging. Defaults to 0.85.

  • art_cascade_cd4_retention_rate (float, optional) – The retention rate for CD4 count. Defaults to 1.

  • art_cascade_pre_art_retention (float, optional) – The retention rate before ART. Defaults to 0.75.

  • art_cascade_immediate_art_rate (float, optional) – The rate for immediate ART. Defaults to 0.1.

  • art_cascade_art_reenrollment_willingness (float, optional) – The willingness rate for ART reenrollment. Defaults to 0.9.

  • tvmap_increased_symptomatic_presentation (dict, optional) – A dictionary containing time-value map for increased symptomatic presentation in TestingOnSymptomatic state. Defaults to all_negative_time_value_map.

  • tvmap_immediate_ART_restart (dict, optional) – A dictionary containing time-value map for immediate ART restart in OnART state. Defaults to all_negative_time_value_map.

  • tvmap_reconsider_lost_forever (dict, optional) – A dictionary containing time-value map for reconsidering lost forever in LostForever state. Defaults to all_negative_time_value_map.

Returns:

None

Example

>>> add_ART_cascade(campaign, art_cascade_node_ids=[1, 2, 3], art_cascade_start_year=1995, art_cascade_pre_staging_retention=0.8, art_cascade_cd4_retention_rate=0.9, art_cascade_pre_art_retention=0.7, art_cascade_immediate_art_rate=0.15, art_cascade_art_reenrollment_willingness=0.85)
emodpy_hiv.campaign.coc.add_state_TestingOnANC(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'>, disqualifying_properties: ~typing.List[str], coverage: float, link_to_ART_rate: float, node_ids: ~typing.List[int] | None, sigmoid_ramp_max: float, sigmoid_ramp_midyear: float, sigmoid_ramp_min: float, sigmoid_ramp_rate: float, treatment_a_efficacy: float, treatment_b_efficacy: float, sdNVP_efficacy: float, start_day: int, property_restrictions: ~typing.List[str] | str = 'Accessibility:Yes') str[source]#

Manages the addition of Testing on Antenatal Care (ANC) in the campaign.

This state is triggered when an individual reaches ‘TwelveWeeksPregnant’. At some point in this state, it initiates the ARTStaging state. The transition to the ARTStaging state is governed by an event, identified as ART_STAGING_TRIGGER_1. The occurrence of this event is determined by a random choice mechanism with a rate equal to link_to_ART_rate.

Parameters:
  • campaign (emod_api.campaign) – The campaign object to which the Testing on ANC state is to be added.

  • disqualifying_properties (List[str]) – A list of disqualifying properties for the Testing on ANC state.

  • coverage (float) – The coverage of Testing on ANC among the population.

  • link_to_ART_rate (float) – The rate for linking to ART. This is used to determine the transition to the ARTStaging state.

  • node_ids (Union[List[int], None]) – A list of node IDs where the Testing on ANC state is to be applied. If None, the Testing on ANC state applies to all nodes.

  • sigmoid_ramp_max (float) – The right asymptote for the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention.

  • sigmoid_ramp_midyear (float) – The time of the infection point in the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention.

  • sigmoid_ramp_min (float) – The left asymptote for the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention.

  • sigmoid_ramp_rate (float) – The slope of the inflection point in the sigmoid trend over time for the HIVSigmoidByYearAndSexDiagnostic intervention. A Rate of 1 sets the slope to a 25% change in probability per year.

  • treatment_a_efficacy (float) – The efficacy of treatment A.

  • treatment_b_efficacy (float) – The efficacy of treatment B.

  • sdNVP_efficacy (float) – The efficacy of Single-Dose Nevirapine (sdNVP).

  • start_day (int) – The start day for the Testing on ANC state.

  • property_restrictions (Union[List[str], str], optional) – The property restrictions for the Testing on ANC state. Defaults to ‘Accessibility:Yes’.

Returns:

The trigger event name for the ARTStaging state.

Return type:

str

emodpy_hiv.campaign.coc.add_state_TestingOnChild6w(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'>, start_day: int, disqualifying_properties: ~typing.List[str], time_value_map: ~typing.Dict[float, float] | ~typing.Dict[str, ~typing.List[float]], node_ids: ~typing.List[int] | None, property_restrictions: ~typing.List[str] | str = 'Accessibility:Yes')[source]#

This function adds a state for testing on children at 6 weeks old in the campaign.

When an individual broadcast the ‘SixWeeksOld’ event, this state is triggered. If the test result is positive, it will then trigger the ARTStagingDiagnosticTest state using the event identified as ART_STAGING_DIAGNOSTIC_TEST_TRIGGER.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the state is added.

  • start_day (int) – The start day for the state.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from the state.

  • time_value_map (Union[Dict[float, float], Dict[str, List[float]]]) – A map of times to values for the HIVPiecewiseByYearAndSexDiagnostic intervention.

  • node_ids (Union[List[int], None]) – A list of node IDs where the state is to be applied. If None, the state is applied to all nodes.

  • property_restrictions (Union[List[str], str], optional) – The property restrictions for the state. Defaults to ‘Accessibility:Yes’.

Returns:

The trigger event name for the ARTStagingDiagnosticTest state.

Return type:

str

emodpy_hiv.campaign.coc.add_state_HCTUptakeAtDebut(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'>, disqualifying_properties: ~typing.List[str], node_ids: ~typing.List[int] | None, start_day: int, female_multiplier: float = 1) Tuple[str, str][source]#

This function manages the addition of Health Care Testing (HCT) uptake at sexual debut in the campaign.

When an individual receives the ‘STIDebut’ event, this state is activated. If the test result is positive, it triggers the HCTTestingLoop state using the event identified as HCT_TESTING_LOOP_TRIGGER. If the test result is negative, it immediately triggers the HCTUpdatePostDebut state using the event identified as HCT_UPTAKE_POST_DEBUT_TRIGGER_1.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the state is added.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from the state.

  • node_ids (Union[List[int], None]) – A list of node IDs where the state is to be applied. If None, the state is applied to all nodes.

  • start_day (int) – The start day for the state.

  • female_multiplier (float, optional) – The multiplier for female individuals in the HIVSigmoidByYearAndSexDiagnostic intervention. Defaults to 1.

Returns:

The trigger events for the HCTTestingLoop and HCTUpdatePostDebut states.

Return type:

Tuple[str, str]

emodpy_hiv.campaign.coc.add_state_HCTUptakePostDebut(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'>, disqualifying_properties: ~typing.List[str], node_ids: ~typing.List[int] | None, hct_reentry_rate: float, start_day: int, tvmap_test_for_enter_HCT_testing_loop: dict = {1990: 0, 2016: 0}) str[source]#

This function manages the addition of Health Care Testing (HCT) uptake post sexual debut in the campaign.

This state is activated by the events HCT_UPTAKE_POST_DEBUT_TRIGGER_1, HCT_UPTAKE_POST_DEBUT_TRIGGER_2, and HCT_UPTAKE_POST_DEBUT_TRIGGER_3. If the test result is positive, it triggers the HCTTestingLoop state using the event identified as HCT_TESTING_LOOP_TRIGGER. If the test result is negative, it reverts back to this state using the event identified as HCT_UPTAKE_POST_DEBUT_TRIGGER_1.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the state is added.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from the state.

  • node_ids (Union[List[int], None]) – A list of node IDs where the state is to be applied. If None, the state is applied to all nodes.

  • hct_reentry_rate (float) – The rate at which individuals reenter the HCT uptake post sexual debut state.

  • start_day (int) – The start day for the state.

  • tvmap_test_for_enter_HCT_testing_loop (dict, optional) – Time value map for HIVPiecewiseByYearAndSexDiagnostic intervention. Defaults to all_negative_time_value_map which will always trigger the Negative event.

Returns:

The trigger for the HCTTestingLoop state.

Return type:

str

emodpy_hiv.campaign.coc.add_state_HCTTestingLoop(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'>, disqualifying_properties: ~typing.List[str], node_ids: ~typing.List[int] | None, hct_retention_rate: float, start_day: int, hct_delay_to_next_test: int | ~typing.List[int], hct_delay_to_next_test_node_ids: ~typing.List[~typing.List[int]] | None = None, hct_delay_to_next_test_node_names: ~typing.List[str] | None = None, tvmap_consider_immediate_ART: dict = {1990: 0, 2016: 0}) -> (<class 'str'>, <class 'str'>, <class 'str'>)[source]#

This function manages the addition of Health Care Testing (HCT) testing loop in the campaign.

This state is triggered by the HCT_TESTING_LOOP_TRIGGER event. Initially, it goes through a hivmuxer intervention with an exponential delay, the mean of which equals hct_delay_to_next_test. Subsequently, a rapid HIV test is conducted. If the test result is positive, a ‘consider_immediate_ART’ test is triggered. If the test result is negative, a random choice intervention is triggered to decide whether the individual should remain in the loop (with rate = hct_retention_rate) or drop out and transition to the HCTUptakePostDebut state using the HCT_UPTAKE_POST_DEBUT_TRIGGER_1 event. If the ‘consider_immediate_ART’ test is positive, it triggers the transition to the OnART state using the ON_ART_TRIGGER_2 event. If the ‘consider_immediate_ART’ test is negative, it triggers the transition to the ARTStaging state using the ART_STAGING_TRIGGER_1 event.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the state is added.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from the state.

  • node_ids (Union[List[int], None]) – A list of node IDs where the state is to be applied. If None, the state is applied to all nodes.

  • hct_retention_rate (float) – The rate at which individuals remain in the HCT testing loop in the random choice intervention.

  • start_day (int) – The start day for the state.

  • hct_delay_to_next_test (Union[int, List[int]]) – The mean delay for the hivmuxer intervention in the HCT testing loop. Can be a single value or a list of values for different nodes.

  • hct_delay_to_next_test_node_ids (Union[List[List[int]], None], optional) – A 2D list specifying the node IDs for each delay period in the hivmuxer intervention. This argument must be provided if hct_delay_to_next_test is a list and should have the same length as hct_delay_to_next_test. If None, the node IDs will be the same as the previous node_ids argument. Defaults to None.

  • hct_delay_to_next_test_node_names (Union[List[str], None], optional) – A list of node names for each delay period in the hivmuxer intervention. This argument must be provided if hct_delay_to_next_test is a list and should have the same length as hct_delay_to_next_test. If None, the node names will be ‘Default’. Defaults to None.

  • tvmap_consider_immediate_ART (dict, optional) – Time value map for considering immediate ART. Defaults to all_negative_time_value_map which will always trigger the Negative event and transition to ARTStaging state.

Returns:

The triggers for the HCTUptakePostDebut, OnART, and ARTStaging states.

Return type:

Tuple[str, str, str]

Examples

This example demonstrates how to add the HCTTestingLoop state to the campaign with different delay periods for each region/node

>>> disqualifying_properties = [CascadeState.LOST_FOREVER,
>>>                             CascadeState.ON_ART,
>>>                             CascadeState.LINKING_TO_ART,
>>>                             CascadeState.ON_PRE_ART,
>>>                             CascadeState.LINKING_TO_PRE_ART,
>>>                             CascadeState.ART_STAGING]
>>> hct_retention_rate = 0.95
>>> hct_delay_to_next_test = [730, 365, 1100]
>>> hct_delay_to_next_test_node_ids = [[1, 2, 3, 4, 6, 7], [5, 9, 10], [8]]
>>> hct_delay_to_next_test_node_names = ['Default', 'Lusaka, Southern, Western', 'Northern']
>>> art_cascade_start_day = 10767
>>> add_state_HCTTestingLoop(campaign=camp,
>>>                          disqualifying_properties=disqualifying_properties,
>>>                          hct_delay_to_next_test=hct_delay_to_next_test,
>>>                          node_ids=None,
>>>                          hct_retention_rate=hct_retention_rate,
>>>                          start_day=art_cascade_start_day,
>>>                          tvmap_consider_immediate_ART=all_negative_time_value_map,
>>>                          hct_delay_to_next_test_node_ids=hct_delay_to_next_test_node_ids,
>>>                          hct_delay_to_next_test_node_names=hct_delay_to_next_test_node_names))

This example demonstrates how to add the HCTTestingLoop state to the campaign with a single delay period for all regions/nodes. >>> disqualifying_properties = [CascadeState.LOST_FOREVER, >>> CascadeState.ON_ART, >>> CascadeState.LINKING_TO_ART, >>> CascadeState.ON_PRE_ART, >>> CascadeState.LINKING_TO_PRE_ART, >>> CascadeState.ART_STAGING] >>> hct_retention_rate = 0.95 >>> hct_delay_to_next_test = 365 >>> art_cascade_start_day = 10767 >>> add_state_HCTTestingLoop(campaign=camp, >>> disqualifying_properties=disqualifying_properties, >>> hct_delay_to_next_test=hct_delay_to_next_test, >>> node_ids=None, >>> hct_retention_rate=hct_retention_rate, >>> start_day=art_cascade_start_day, >>> tvmap_consider_immediate_ART=all_negative_time_value_map)

emodpy_hiv.campaign.coc.add_state_TestingOnSymptomatic(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'>, node_ids: ~typing.List[int] | None, disqualifying_properties: ~typing.List[str], start_day: int, tvmap_increased_symptomatic_presentation: dict = {1990: 0, 2016: 0}) Tuple[str, str][source]#

This function manages the addition of Testing on Symptomatic individuals in the campaign.

This state is triggered when an individual becomes ‘NewlySymptomatic’. A HIVSigmoidByYearAndSexDiagnostic intervention is then applied. If the test result is positive, it triggers the ARTStagingDiagnosticTest state using the ART_STAGING_DIAGNOSTIC_TEST_TRIGGER event. If the test is negative, it triggers a HIVPiecewiseByYearAndSexDiagnostic test. If the result of this test is positive, it initiates the ARTStaging state through the ART_STAGING_TRIGGER_2 event. If the test result is negative, it does not trigger any further events.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the state is added.

  • node_ids (Union[List[int], None]) – A list of node IDs where the state is to be applied. If None, the state is applied to all nodes.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from the state.

  • start_day (int) – The start day for the state.

  • tvmap_increased_symptomatic_presentation (dict, optional) – Time value map for increased symptomatic presentation which is used in the HIVPiecewiseByYearAndSexDiagnostic intervention. Defaults to all_negative_time_value_map which will always trigger the Negative event(‘None’).

Returns:

The triggers for the ARTStagingDiagnosticTest and ARTStaging states.

Return type:

Tuple[str, str]

emodpy_hiv.campaign.coc.add_state_ARTStagingDiagnosticTest(campaign, node_ids: List[int] | None, disqualifying_properties: List[str], start_day: int) str[source]#

This function manages the addition of ART Staging Diagnostic Test in the campaign.

This state is triggered by the ART_STAGING_DIAGNOSTIC_TEST_TRIGGER event. Upon activation, it conducts an HIV rapid diagnostic test on individuals who present with symptoms. If the test result is positive, it triggers the transition to the ARTStaging state using the ART_STAGING_TRIGGER_1 event.

Parameters:
  • campaign – The campaign to which the state is added.

  • node_ids (Union[List[int], None]) – A list of node IDs where the state is to be applied. If None, the state is applied to all nodes.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from the state.

  • start_day (int) – The start day for the state.

Returns:

The trigger for the ARTStaging state.

Return type:

str

emodpy_hiv.campaign.coc.add_state_ARTStaging(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_retention_rate: float, pre_staging_retention: float, node_ids: ~typing.List[int] | None, disqualifying_properties: ~typing.List[str], start_day: int)[source]#

This function manages the addition of the ART Staging state in the campaign.

This state is initially triggered by the ART_STAGING_TRIGGER_1 and ART_STAGING_TRIGGER_2 events. Upon activation, it conducts a series of interventions and diagnostics, including blood draw, ART eligibility check, and CD4 count check. Depending on the results of these checks, the function can trigger transitions to several different states.

Parameters:
  • campaign (emod_api.campaign) – The campaign to which the state is added.

  • cd4_retention_rate (float) – The retention rate for CD4.

  • pre_staging_retention (float) – The retention rate before staging.

  • node_ids (Union[List[int], None]) – A list of node IDs where the state is to be applied. If None, the state is applied to all nodes.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from the state.

  • start_day (int) – The start day for the state.

Returns:

The triggers for the LinkingToART, LinkingToPreART, HCTUptakePostDebut states for individuals who are not eligible for ART from the randomchoice, and HCTUptakePostDebut state for individuals who are lost to follow-up (LTFU).

Return type:

Tuple[str, str, str, str]

emodpy_hiv.campaign.coc.add_state_LinkingToPreART(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'>, node_ids: ~typing.List[int] | None, disqualifying_properties: ~typing.List[str], start_day: int) Tuple[str, str][source]#

This function manages the addition of the LinkingToPreART state in the campaign.

The function is initially triggered by the LINKING_TO_PRE_ART_TRIGGER event. Upon activation, it conducts a HIVSigmoidByYearAndSexDiagnostic test. If the test result is positive, it triggers ON_PRE_ART_TRIGGER which will transition to the OnPreART state. If the test result is negative, it triggers HCT_UPTAKE_POST_DEBUT_TRIGGER_3 which will transition to the HCTUptakePostDebut state.

Parameters:
  • campaign (emod_api.campaign) – The campaign object to which the state is added.

  • node_ids (Union[List[int], None]) – A list of node IDs for which the state is applicable. If None, the state is applicable to all nodes.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from being in this state.

  • start_day (int) – The day on which the state starts.

Returns:

The triggers for the OnPreART and HCTUptakePostDebut states.

Return type:

Tuple[str, str]

emodpy_hiv.campaign.coc.add_state_OnPreART(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'>, node_ids: ~typing.List[int] | None, pre_art_retention: float, disqualifying_properties: ~typing.List[str], start_day: int) Tuple[str, str][source]#

This function manages the addition of the OnPreART state in the campaign.

The function is initially triggered by the ON_PRE_ART_TRIGGER event. Upon activation, it conducts a series of interventions and diagnostics, including a HIVMuxer with a delay period, a random choice for pre-ART retention or lost to follow-up, a CD4 agnostic pre-ART eligibility check, a blood draw, and a determination of ART eligibility given CD4 counts. Depending on the results of these checks, the function can transit to two different states. It could trigger the OnART state if the individual is eligible for ART with ON_ART_TRIGGER_1 event. It could also trigger the HCTUptakePostDebut state if the individual is not retained in the pre-ART state with HCT_UPTAKE_POST_DEBUT_TRIGGER_3 event.

Parameters:
  • campaign (emod_api.campaign) – The campaign object to which the state is added.

  • node_ids (Union[List[int], None]) – A list of node IDs for which the state is applicable. If None, the state is applicable to all nodes.

  • pre_art_retention (float) – The retention rate in the pre-ART state.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from being in this state.

  • start_day (int) – The day on which the state starts.

Returns:

The triggers for the OnART and HCTUptakePostDebut states.

Return type:

Tuple[str, str]

emodpy_hiv.campaign.coc.add_state_LinkingToART(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'>, node_ids: ~typing.List[int] | None, disqualifying_properties: ~typing.List[str], start_day: int, ramp_min: float = 0, ramp_max: float = 0.8507390283, ramp_midyear: float = 1997.4462231708, ramp_rate: float = 1)[source]#

This function manages the addition of the LinkingToART state in the campaign.

The function is initially triggered by the LINKING_TO_ART_TRIGGER event. Upon activation, it conducts a sigmoid HIVSigmoidByYearAndSexDiagnostic test. Depending on the result of this test, the function can transit to two different states. It could trigger the OnART state if the sigmoid diagnostic test result is positive with ON_ART_TRIGGER_1 event. It could also trigger the HCTUptakePostDebut state if the sigmoid diagnostic test result is negative with HCT_UPTAKE_POST_DEBUT_TRIGGER_2 event.

Parameters:
  • campaign (emod_api.campaign) – The campaign object to which the state is added.

  • node_ids (Union[List[int], None]) – A list of node IDs for which the state is applicable. If None, the state is applicable to all nodes.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from being in this state.

  • start_day (int) – The day on which the state starts.

  • ramp_min (float) – The minimum value of the sigmoid ramp in HIVSigmoidByYearAndSexDiagnostic intervention. Defaults to 0.

  • ramp_max (float) – The maximum value of the sigmoid ramp in HIVSigmoidByYearAndSexDiagnostic intervention. Defaults to 0.8507390283.

  • ramp_midyear (float) – The midyear value of the sigmoid ramp in HIVSigmoidByYearAndSexDiagnostic intervention. Defaults to 1997.4462231708.

  • ramp_rate (float) – The rate of the sigmoid ramp in HIVSigmoidByYearAndSexDiagnostic intervention. Defaults to 1.

Returns:

The triggers for the OnART and ‘HCTUptakePostDebut’ states.

Return type:

Tuple[str, str]

emodpy_hiv.campaign.coc.add_state_OnART(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'>, art_reenrollment_willingness: float, immediate_art_rate: float, node_ids: ~typing.List[int] | None, disqualifying_properties: ~typing.List[str], start_day: int, tvmap_immediate_ART_restart: dict = {1990: 0, 2016: 0}, tvmap_reconsider_lost_forever: dict = {1990: 0, 2016: 0})[source]#

This function manages the addition of the OnART state in the campaign.

The function is initially triggered by the ON_ART_TRIGGER_1 and ON_ART_TRIGGER_2 events. Upon activation, it conducts a series of interventions and diagnostics, including a decision(with randomchoice) on whether to initiate ART immediately or delay(with HIVMuxer), initiation of ART, a delay(with HIVMuxer) to dropping off of ART, and a decision(with randomchoice) on willingness to test the eligibility of re-enroll in ART or transit to other states.

Parameters:
  • campaign (emod_api.campaign) – The campaign object to which the state is added.

  • art_reenrollment_willingness (float) – The willingness of an individual to re-enroll in ART after dropout.

  • immediate_art_rate (float) – The rate at which ART is initiated immediately, without HIVMuxer delay.

  • node_ids (Union[List[int], None]) – A list of node IDs for which the state is applicable. If None, the state is applicable to all nodes.

  • disqualifying_properties (List[str]) – A list of properties that disqualify an individual from being in this state.

  • start_day (int) – The day on which the state starts.

  • tvmap_immediate_ART_restart (dict) – A time value map for HIVPiecewiseByYearAndSexDiagnostic intervention to consider restarting ART immediately after HIVmuxer delay. Defaults to all_negative_time_value_map which will always trigger the Negative event(HCT_UPTAKE_POST_DEBUT_TRIGGER_2) and transit to HCTUptakePostDebut state.

  • tvmap_reconsider_lost_forever (dict) – A time value map for the second HIVPiecewiseByYearAndSexDiagnostic intervention to reconsider being lost forever to ART care. Defaults to all_negative_time_value_map which will always trigger the Negative event(LostForever) and transit to LostForever state.

Returns:

The triggers for the HCTUptakePostDebut and LostForever states.

Return type:

Tuple[str, str]

emodpy_hiv.campaign.coc.add_state_LostForever(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'>, node_ids: ~typing.List[int] | None, start_day: int)[source]#

Transition individuals to the ‘LostForever’ state in the campaign.

This function is triggered by the LOST_FOREVER_TRIGGER event. Upon activation, it changes the target property key to ‘CascadeState’ and the target property value to ‘LostForever’, effectively moving individuals to the LostForever state in the campaign.

Parameters:
  • campaign (emod_api.campaign) – The campaign object to which the state transition is to be added.

  • node_ids (List[int]) – A list of node IDs where this transition is applicable.

  • start_day (int) – The starting day of the campaign when this transition becomes active.