]
table = [[[cfg, cpn, demog_pfa], 1985, 0.95, 1.5e-3, {
    'Testing1a': None,
    'Testing1b': 'Works'
}], [[cfg, cpn_outbreak, demog_pfa], 1980, 0.50, 1.0e-3, {
    'Testing2': None
}]]

# Initialize the template system
# ==============================
# Create an instance of the TemplateHelper helper class and, if desired, give it templates to work with.
# In this example, there's no need to set the campaign_template because it will be set dynamically from the table above.
templates = TemplateHelper()

# Give the header and table to the template helper
templates.set_dynamic_header_table(header, table)

# Let's use a standard DTKConfigBuilder.
config_builder = DTKConfigBuilder()
# ignore_missing is required when using templates
config_builder.ignore_missing = True

# Use the default COMPS 2.10 and the SamplesInput folder for input files
# See examples\AssetManagement\use_custom_executable.py for more information
config_builder.set_exe_collection('EMOD 2.10')

# For the experiment builder in the example, we use a ModBuilder from_combos to run
# each of the configurations for two separate run numbers.
# The first line needs to be the modifier functions coming from the templates
experiment_builder = ModBuilder.from_combos(
    templates.get_modifier_functions(),  # <-- Do this first!
Пример #2
0
            # Extract the headers
            headers = [
                k.replace('CONFIG.', '').replace('DEMOGRAPHICS.',
                                                 '').replace('CAMPAIGN.', '')
                for k in combined[0].keys()
            ]

            # Construct the table
            table = [list(c.values()) for c in combined]

            # Change some things in the config.json
            config.set_param('Config_Name', scenario_name)

            # Initialize the template
            tpl = TemplateHelper()
            tpl.set_dynamic_header_table(headers, table)
            tpl.active_templates = [
                config, campaign_tpl, demog, demog_pfa, demog_asrt, demog_acc
            ]

            # Create an experiment builder
            experiment_builder = ModBuilder.from_combos(
                tpl.get_modifier_functions())
            experiment_manager = ExperimentManagerFactory.from_cb(
                config_builder)
            COMPS_experiment_name = scenario_name
            # COMPS_experiment_name = suite_name # I want hover-over in COMPS to be the suite name

            experiment_manager.run_simulations(exp_name=COMPS_experiment_name,
                                               exp_builder=experiment_builder,
                                               suite_id=suite_id)