Beispiel #1
0
def add_simple_rcd(campaign):
    simple_rcd_event = add_drug_campaign(
        campaign,
        campaign_type='rfMSAT',
        drug_code='AL',
        diagnostic_type='BLOOD_SMEAR_PARASITES',
        diagnostic_threshold=0,
        start_days=[2],
        coverage=0.7,
        trigger_coverage=0.01,
        listening_duration=1000)

    campaign.add(simple_rcd_event)
Beispiel #2
0
def add_bednets(campaign):
    # simple bednet from example
    # bednet_distribution = Bednet(campaign,
    #                              start_day=100,
    #                              coverage=1.0,
    #                              killing_eff=1.0,
    #                              blocking_eff=1.0,
    #                              usage_eff=1.0,
    #                              node_ids=[1])
    # campaign.add(bednet_distribution)

    kariba_itn_age_dependence = {
        'youth_cov': 0.65,
        'youth_min_age': 5,
        'youth_max_age': 20
    }

    kariba_itn_seasonal_dependence = {'min_cov': 0.5, 'max_day': 60}

    kariba_itn_discard_rates = {
        "Expiration_Period_Distribution": "DUAL_EXPONENTIAL_DISTRIBUTION",
        "Expiration_Period_Mean_1": 260,
        "Expiration_Period_Mean_2": 2106,
        "Expiration_Period_Proportion_1": 0.6
    }

    # Typical blocking and killing efficacy/waning are now code defaults!
    fancier_bednet_distribution = UDBednet(
        campaign,
        start_day=100,
        coverage=0.6,
        age_dependence=kariba_itn_age_dependence,
        seasonal_dependence=kariba_itn_seasonal_dependence,
        discard_config=kariba_itn_discard_rates,
        node_ids=[1])

    fancier_bednet_distribution_with_birth_trigger = UDBednet(
        campaign,
        start_day=100,
        coverage=0.6,
        age_dependence=kariba_itn_age_dependence,
        seasonal_dependence=kariba_itn_seasonal_dependence,
        discard_config=kariba_itn_discard_rates,
        triggers=["Births"],
        node_ids=[1])
    #fixme This was generating a bug.  Test looking into this.

    campaign.add(fancier_bednet_distribution)
    campaign.add(fancier_bednet_distribution_with_birth_trigger)
Beispiel #3
0
def set_random_campaign_file(campaign_filename="campaign.json", campaign_template_filename= "campaign_template.json", debug = False): 
    durations = generate_durations(NUM_OF_BUCKETS, MAX_DURATION)
    if sum(durations) != MAX_DURATION:
        print( "total duration is {0}, expected {1}.\n".format(sum(durations), MAX_DURATION))
    ip.durations = durations
    rates = generate_rates(NUM_OF_BUCKETS,MAX_RATE)
    ip.daily_import_pressures = rates
    ip.nodes = [ 3, 5, 7 ]
    print( "Calling ip.new_intervention_as_file." )
    #camp_filename = ip.new_intervention_as_file(1, campaign_filename)
    event = ip.new_intervention(1, durations, rates, [ 3, 5, 7 ] )
    camp.add( event )
    camp.save( campaign_filename )

    if debug:
        print("durations are : {}.\n".format(durations))
        print("daily inport pressures are : {}.\n".format(rates))
    return campaign_filename 
Beispiel #4
0
def add_drug_interventions(campaign):
    mda_event = add_drug_campaign(campaign,
                                  campaign_type='MDA',
                                  drug_code='DP',
                                  start_days=[50],
                                  coverage=0.5)

    msat_event = add_drug_campaign(campaign,
                                   campaign_type='MSAT',
                                   drug_code='AL',
                                   diagnostic_type='BLOOD_SMEAR_PARASITES',
                                   diagnostic_threshold=0,
                                   start_days=[75],
                                   coverage=0.8)

    # healthseeking_event = add_healthseeking()
    #fixme couldn't find this function

    campaign.add(mda_event)
    campaign.add(msat_event)
def build_camp():
    """
    Build a campaign input file for the DTK using emod_api.
    Right now this function creates the file and returns the filename. If calling code just needs an asset that's fine.
    """
    import emod_api.campaign as camp
    import emodpy_covid.interventions.covid_vaccine as cv  # will move to emodpy_covid
    import emodpy_covid.interventions.complex_import as ci  # will move to emodpy_measles

    # This isn't desirable. Need to think about right way to provide schema (once)
    cv.schema_path = manifest.schema_file
    ci.schema_path = manifest.schema_file
    print(f"Telling emod-api to use {manifest.schema_file} as schema.")

    # importation pressure
    event = cv.SimpleSample1(timestep=0)
    camp.add(event, first=True)

    # routine immunization
    event = cv.SimpleSample2(timestep=365, coverage=0.5)
    camp.add(event)

    event = ci.ComplexImportationEvent(dips=[1. / 10],
                                       durs=[20 * 365],
                                       timestep=0)
    camp.add(event)

    # We are saving and reloading. Maybe there's an even better way? But even an outbreak seeding does not belong in the EMODTask.
    filename = "campaign.json"
    camp.save(filename)
    print(f"Check for valid campaign file at: {filename}.")

    return filename
def build_camp():
    """
    Build a campaign input file for the DTK using emod_api.
    Right now this function creates the file and returns the filename. If calling code just needs an asset that's fine.
    """
    import emod_api.campaign as camp
    import emodpy_measles.interventions.measles_vaccine as mv  # will move to emodpy_measles
    import emodpy_measles.interventions.complex_import as ci  # will move to emodpy_measles
    import emodpy_measles.interventions.simple_sia as sia  # will move to emodpy_measles
    import emodpy_measles as meas

    # This isn't desirable. Need to think about right way to provide schema (once)
    mv.schema_path = manifest.schema_file
    ci.schema_path = manifest.schema_file
    sia.schema_path = manifest.schema_file

    print(f"Telling emod-api to use {manifest.schema_file} as schema.")

    # importation pressure
    event = ci.ComplexImportationEvent(dips=[1. / 10],
                                       durs=[20 * 365],
                                       timestep=0)
    camp.add(event, first=True)

    # routine immunization
    event = mv.SimpleMCV1(timestep=0, coverage=0.5)
    camp.add(event)

    # SIAs
    SIAs = meas.ConstructHistoricalCampaigns()
    SIA_count = 0
    for SIA in SIAs:
        if (SIA.region == 'north') or (SIA.region) == 'all':
            SIA_count += 1
            event = sia.SimpleSIA(Event_Name=f'SIA_{SIA_count}',
                                  timestep=SIA.startday.toordinal() -
                                  SIA.startday.toordinal())
            camp.add(event)
    # We are saving and reloading. Maybe there's an even better way? But even an outbreak seeding does not belong in the EMODTask.
    filename = "campaign_kb_example.json"
    camp.save(filename)
    print(f"Check for valid campaign file at: {filename}.")

    return filename
Beispiel #7
0
def add_irs(campaign):
    irs_spray_event = IRSHousingModification(campaign,
                                             start_day=200,
                                             coverage=0.8,
                                             node_ids=[2])
    campaign.add(irs_spray_event)