Ejemplo n.º 1
0
        force_apply=True  # Set to True to re-download and call "apply" again
    )
]

#
# ***************************** END PRINCIPAL SECTION OF THIS EXAMPLE ****************************
#

# dtk analyze compatibility
site = sites[0]
analyzers = site.analyzers

# Restrict to only those params that are initially active
params = [p for p in params if p['Dynamic']]

plotters = [LikelihoodPlotter(), OptimToolPlotter()]

# Setting up our model configuration from templates

dir_path = os.path.dirname(os.path.realpath(__file__))
template_files_dir = os.path.join(dir_path, 'Templates')
static_files_dir = os.path.join(dir_path, 'Static')

demog = DemographicsTemplate.from_file(
    os.path.join(static_files_dir, 'Rakai_Demographics_With_Properties.json'))
demog_pfa = DemographicsTemplate.from_file(
    os.path.join(template_files_dir, 'PFA_Overlay.json'))
demog_acc = DemographicsTemplate.from_file(
    os.path.join(template_files_dir, 'Accessibility_and_Risk_IP_Overlay.json'))
demog_asrt = DemographicsTemplate.from_file(
    os.path.join(template_files_dir, 'Risk_Assortivity_Overlay.json'))
Ejemplo n.º 2
0
referenceData = 'C:/Users/jkurlander/Dropbox (IDM)/Malaria Team Folder/projects/atsb/Reference_data/HLCIntervention.csv'
hfca = 'Kangaba'
sites = [ATSBEntoCalibSite(species, hfca=hfca, throwaway=throwaway,
                          reference_fname = referenceData)]

# WaningEffectMapPiecewise (Seasonal), WaningEffectConstant, WaningEffectExponential, WaningEffectBoxExponential
Class = "WaningEffectConstant"
expname = 'Mali ATSB Calibration ' + str(Class) + ' HLC'
max_iterations = 5
max_diff = 0.5
max_frac_diff = 0.05

# The default plotters used in an Optimization with OptimTool
# plotters = [LikelihoodPlotter(combine_sites=True),
plotters = [SiteDataPlotter(num_to_plot=20, combine_sites=True),
            OptimToolPlotter()  # OTP must be last because it calls gc.collect()
]


#############################################################################################################
ref = sites[0].analyzers[0].reference.copy()
duration = 1#int(max(ref.reset_index()['Month'])/12) + 1

params = [

      {
            #% of mosquitoes killed per day
           'Name': 'KillingProfile',
           'Dynamic': True,
           'Guess': 0.0337,
           'Min': 0.0,
# This config builder will be modify by the different sites defined below
cb = CMSConfigBuilder.from_files(
    model_file='base/core-model-with-age-groups.emodl',
    config_file='base/with-age-groups.cfg')

try:
    cb.set_collection_id('CMS 0.82 Pre-release')
except SimulationAssets.InvalidCollection:
    cb.set_experiment_executable('../inputs/compartments/compartments.exe')
    cb.set_dll_root('../inputs/compartments')

# List of sites we want to calibrate on
sites = [CMSSite()]

# The default plotters used in an Optimization with OptimTool
plotters = [OptimToolPlotter()]

params = [{
    'Name': 'initial_S_A04',
    'Dynamic': True,
    'Guess': 4879554,
    'Min': 4800000,
    'Max': 4900000
}, {
    'Name': 'initial_I_A04',
    'Dynamic': True,
    'Guess': 7608,
    'Min': 2000,
    'Max': 10000
}]