Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.69 KB

create-sims-emod.rst

File metadata and controls

30 lines (20 loc) · 1.69 KB

Create simulations

To create simulations using you must use the emodpy:emodpy with . Included with emodpy is the :py~emodpy.emod_task.EMODTask class, inheriting from the :py~idmtools.entities.itask.ITask abstract class, and used for the running and configuration of simulations and experiments.

@startuml abstract class ITask ITask <|-- EMODTask @enduml

For more information about the architecture of job (simulation/experiment) creation and how leverages plugin architecture, see reference.

The following Python excerpt shows an example of using :py~emodpy.emod_task.EMODTask class and from_default method to create a task object using default config, campaign, and demographic values from :py~emodpy.defaults.emod_sir.EMODSir class and to use the from local directory:

task = EMODTask.from_default(default=EMODSir(), eradication_path=os.path.join(BIN_PATH, "Eradication"))

Another option, instead of using from_default, is to use the from_files method:

task = EMODTask.from_files(config_path=os.path.join(INPUT_PATH, "config.json"),
                           campaign_path=os.path.join(INPUT_PATH, "campaign.json"),
                           demographics_paths=os.path.join(INPUT_PATH, "demographics.json"),
                           eradication_path=eradication_path)

For complete examples of the above see the following Python scripts:

  • (from_default) :pyemodpy.examples.create_sims_from_default_run_analyzer
  • (from_files) :pyemodpy.examples.create_sims_eradication_from_github_url