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

Difference between revisions of "STEM Model Generator"

(Configure Model Parameters)
(Configure Model Parameters)
Line 114: Line 114:
  
 
==== Configure Model Parameters  ====
 
==== Configure Model Parameters  ====
 +
 
Model parameters - also called rate parameters - represent user-defined variables that are passed into the computational model. The values can represent many things, but are often variables to the differential equations that make up the model. Users are asked to provide values for these parameters when a new Disease/Population/etc is created in STEM. Examples include '''Transmission Rate''', '''Immunity Loss Rate''', etc.  
 
Model parameters - also called rate parameters - represent user-defined variables that are passed into the computational model. The values can represent many things, but are often variables to the differential equations that make up the model. Users are asked to provide values for these parameters when a new Disease/Population/etc is created in STEM. Examples include '''Transmission Rate''', '''Immunity Loss Rate''', etc.  
  
By default, a model inherits parameters from its ancestor models. These are show in <span style="color: #a0a0a0; font-style:italic;">light gray italics</span>. '''You cannot edit or remove parameters inherited from another model.
+
By default, a model inherits parameters from its ancestor models. These are show in <span style="color: #a0a0a0; font-style:italic;">light gray italics</span>. '''You cannot edit or remove parameters inherited from another model.'''
 +
 
 +
To add a new model parameter, click '''Add Parameter'''. To edit an existing parameter, select one from the list and click '''Edit Parameter'''.
 +
 
 +
:Image
 +
 
 +
When you click '''Add''' or '''Edit Parameter''', the '''Model Parameter Editor''' window opens. Use the form provided to set the properties for the model parameter.  
  
To add a new model parameter, click '''Add Parameter'''. To edit an existing parameter, select one from the list and click '''Edit Parameter'''.
+
<br>
  
: Image
+
{| width="881" cellspacing="1" cellpadding="1" border="1" height="138"
 +
|-
 +
| '''Property '''<br>
 +
| '''Required?'''<br>
 +
| '''Type'''<br>
 +
| '''Example'''<br>
 +
| '''Description'''<br>
 +
|-
 +
| Name<br>
 +
| Yes<br>
 +
| String (Java Identifier)<br>
 +
| transmissionRate2<br>
 +
| The parameter's name. This is the name of the Java member variable in the resulting computational model. This required property is a Java identifier and should be made of alphanumeric characters, no spaces, and cannot begin with a number.<br>
 +
|-
 +
| Display Name<br>
 +
| Yes<br>
 +
| String<br>
 +
| Transmission Rate 2<br>
 +
| The display name of the parameter.&nbsp; This should be a short, user-friendly description of the parameter.<br>
 +
|-
 +
| Data Type<br>
 +
| Yes<br>
 +
| EClassifier<br>
 +
| double<br>
 +
| The data type of the parameter.&nbsp; This will be the Java type of the resulting member variable.&nbsp; '''''Tip'''''<i>:&nbsp; For models with multiple populations, select a ValueList or ValueMatrix data types.</i><br>
 +
|-
 +
| Default Value<br>
 +
| Yes**<br>
 +
| Type-specific<br>
 +
| 0.0<br>
 +
| The default value of the parameter if a value is not provided by the user.&nbsp; A default value often accompanies the parameter in literature.&nbsp; ''**This field is required for numeric data types (like double, integer, float, etc)''.<br>
 +
|-
 +
| <br>
 +
| <br>
 +
| <br>
 +
| <br>
 +
| <br>
 +
|}
  
When you click '''Add''' or '''Edit Parameter''', the '''Model Parameter Editor''' window opens.  Use the form provided to set the properties for the model parameter.
+
<br>
  
 
==== Configure Model Compartments ====
 
==== Configure Model Compartments ====

Revision as of 14:10, 5 September 2012

About

Holder page for model generator


Installation

Important note:  the STEM Model Generator is currently intended for use in the Eclipse SDK only.  It is not intended for installation or use within the STEM application.

  • Follow the steps of the STEM/Eclipse Setup to prepare your development environment
  • Add the STEM Model Generator Update Site into Eclipse
    1. Launch your Eclipse SDK
    2. Select the Help menu and choose Install New Software
      Image
    3. When the Available Software dialog opens, click Add
    4. In Add Repository dialog, enter the following values:
      Name: STEM Developer Tools
      Location: http://download.eclipse.org/stem/update-site/prerelease/
      Image
    5. Click OK
  • Install the STEM Model Generator
    1. From the Available Software dialog, select STEM Developer Tools from the drop down
    2. Choose the STEM Model Generator Feature from the list of available software
      Note: You may have to uncheck Group items by category
      Image
    3. Click Next
    4. On the Install Details page, verify STEM Model Generator Feature is listed
      Note: If you did not install the Eclipse Modeling Framework (EMF) previously, it will be installed automatically
      Image
    5. Click Next
    6. On the Review Licenses page, review the licenses of the required software
      • If you accept all the license terms, select I accept the terms of the license agreements and click Finish
      • If you do NOT accept the terms, click Cancel
    7. The installer will now download and install the software. This process may take 5-10 minutes.
    8. If prompted with a Security Warning that you're about to install unsigned content, click OK
      Image
    9. When the install finishes, you will be prompted to restart Eclipse
      • If all your changes are saved, click Restart Now
      • Otherwise, click Not Now, save any changes, and restart Eclipse
      Image
  • After Eclipse restarts, the STEM Model Generator is ready for use

Create a new STEM Computational Model Project

Launch the STEM Model Generator Wizard

  1. Open the Eclipse SDK
  2. Open the File menu, New, and choose Other
    You can also do Control-N (Command-N on Mac OS X)
  3. In the list of Wizards, expand the STEM category and select New STEM Model Project
  4. Click Next
  5. Choose Create and configure a new STEM Model Package
    Image
  6. Click Next

Configure the Model Package

The model package is the container for all models in a given package. A model package generates an Eclipse plug-in project.

Parameter Name Data Type Example Value
Package Name String
(Java Identifier)
CattleSalmonellosis
Package Prefix String
(Java Package Identifier)
com.example.diseasemodels

The Package Name and Package Prefix are combined to create the resulting Eclipse plug-in/project identifier. For example, the model package with values above will generate an Eclipse plug-in/project with ID com.example.diseasemodels.cattlesalmonellosis.

Add/Edit a Computational Model

When you're ready to add a computational model to the package, from the Model Package page, click Add Model.

If you want to edit an existing computational model, choose it from the Contained Models list and click Edit Model.

This will launch the Computational Model Wizard.

Configure Model Properties

Model properties are the most basic settings of a STEM Computational Model. Properties include the model's name, the model's type, and which parent model it extends and inherits parameters and compartments from. All are required.

Image
Property Type Example Description
Model Name String
(Java Identifier)
CattleSalmonella The model's name.  This value will be the Java class name of the generated model. Should contain alphanumeric characters, no spaces, and cannot begin with a number.
Model Type String from list DiseaseModel The underlying model type. If you're implementing a Disease Model, select DiseaseModel. A Population Model, select PopulationModel. This value is used to find appropriate parent models.
Parent model Computational Model SIR The computational model this new model will extend. If you're not sure, select the textbook model that most closely resembles the compartment model you're implementing (SI, SIR, SEIR)

When you're finished, click Next to configure the Model Parameters

Configure Model Parameters

Model parameters - also called rate parameters - represent user-defined variables that are passed into the computational model. The values can represent many things, but are often variables to the differential equations that make up the model. Users are asked to provide values for these parameters when a new Disease/Population/etc is created in STEM. Examples include Transmission Rate, Immunity Loss Rate, etc.

By default, a model inherits parameters from its ancestor models. These are show in light gray italics. You cannot edit or remove parameters inherited from another model.

To add a new model parameter, click Add Parameter. To edit an existing parameter, select one from the list and click Edit Parameter.

Image

When you click Add or Edit Parameter, the Model Parameter Editor window opens. Use the form provided to set the properties for the model parameter.


Property
Required?
Type
Example
Description
Name
Yes
String (Java Identifier)
transmissionRate2
The parameter's name. This is the name of the Java member variable in the resulting computational model. This required property is a Java identifier and should be made of alphanumeric characters, no spaces, and cannot begin with a number.
Display Name
Yes
String
Transmission Rate 2
The display name of the parameter.  This should be a short, user-friendly description of the parameter.
Data Type
Yes
EClassifier
double
The data type of the parameter.  This will be the Java type of the resulting member variable.  Tip:  For models with multiple populations, select a ValueList or ValueMatrix data types.
Default Value
Yes**
Type-specific
0.0
The default value of the parameter if a value is not provided by the user.  A default value often accompanies the parameter in literature.  **This field is required for numeric data types (like double, integer, float, etc).






Configure Model Compartments

Run the Code Generator

Edit an existing computational model

The STEM Metamodel

Use an existing EMF Ecore/GenModel with the Model Generator

Back to the top