Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

How scenarios are structured

Revision as of 07:57, 19 August 2012 by Kaufman.almaden.ibm.com (Talk | contribs) (Template for a Food Borne Disease Scenario)

STEM TOP BAR.gif


back to STEM Contents Page


Scenario Structure

At the beginning of a simulation, STEM allows decorators such as population models, population initializers and disease models to initialize themselves. For instance, when a disease model is initialized, it creates the disease model labels necessary to track the state of the disese in a population. A disease model depends on the population model labels created by a population model to be able to create the disease model labels. Furthermore, a population model depends on the existance of static population labels, created either by a population initializers or by dragging population data into your model from the STEM library.

Figure 1 basic scenario structure

Consequently, the order of initialization becomes important, and the order is controlled by nesting models inside models. Decorators that are deeper in the model tree are initialized before decorators higher up in the tree. See the figure below for an example. Deepest in the tree is a population initializer that creates the static population labels needed by the demographic population model one level up. The demographic population model subdivides the population into subgroups needed by the disease model in the level above.

In summary, the order is population initializers before population models, population models before disease models, and disease models before infectors/inoculators.

Download the Templates

This tutorial shows users how to compose a basic disease model scenario and a basic foodborne disease scenario using a project containing prepared templates. Please begin by downloading the template scenario project from the download page unzip it and import it into your workspace.

Template for a Basic Scenario with a Human Disease

Figure 2 pick a geography (including the human census data)




After you successfully download, extract, and import the scenario (archive file Templates.zip), open the 'Templates project' in the designer perspective. Double click on the Disease Model scenario and you should see a series of empty nested project (see Figure 2). The nested models within the scenario are named to make it easy to see what elements should be added to each model.

Figure 3 drag geographic model(s) into the folder labeled Geographic Model Group




In Figure 2 we navigated to the libraries of prebuilt models. The Models Tab contains folders with geographic information by country. In this example we pick Japan, and the prebuilt model with admin 0,1,2 data including the Human population data.

Figure 3 shows the scenario with all models expanded. The data for Japan has been dragged into the project named Geographic Model Group


Figure 4


Create a new population model (figure 4) and drag it to the model PopulationModelLevel. Figure 5 shows the population model in the PopulationModelLevel. The GeographicModelGroup has been collapsed for clarity (but it still contains the model of Japan).


Figure 5





Figure 6


Create a new disease model (Figure 6) and drag it into the model DiseaseModelLevel. Figure 7 shows the DiseaseModelLevel with the disease model added. The PopulationModelLevel model has been collapsed for clarity (but it still contains the GeographicModelGroup).


Figure 7


In order to run a simulation, models must be initialized. This is the difference between a Model and a Scenario. The model DiseaseModelLevel contains a disease model for the common cold but no members of the human population have actually been given a cold. This is done in the Scenario.

Figure 8


Figure 8 shows the Templates project in the Project Explorer view. To create an initializer (the most flexible decorator to use in order to set initial conditions for the disease state), open the decorators folder. Right click on the disease model, and click on Create new initializer. The new initializer dialog allows the user to define the initial state of every compartment in a single step. NOTE that in Figure 8 we have chosen to initialize by fraction of the population instead of by population count.


Figure 9


The disease model initializer will appear in the decorators folder. Drag it into the scenario. You must then create a new sequencer and drag that into the scenario as well.


Figure 10



Figure 10 shows the disease model initializer after it has been dragged into the scenario. The models within the scenario have been collapse for clarity (but the nested models are still there). Both the disease model initializer and the sequencer are shown.





Template for a Food Borne Disease Scenario

The second scenario template provided in the templates project contains nested models to show how a food borne disease scenario should be structured.



As an exercise try the following steps.

  • Start with an empty templates project (backup and delete your version above and reexpand the zip file)
  • create a population model for pig (see figure 11). Be sure to change the default ModelName from HumanPopulationModel to something like PigPopulationModel. Call the population pig.
  • create a population model for pork
  • STEM does not provide basic census data for pig or pork so we need to initialize them. The simplest way to do this is to create a PopulationInitializer for pig and for pork.
  • Drag the two PopulationInitializers into the GeographicModelGroup
  • Drag the two PopulationModels into the PopulationModelsLevel


Figure 11




Figure 12




Figure 13




Back to the top