Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Triggering interventions
Interventions in STEM
STEM uses triggers, predicates and modifiers to implement interventions. A trigger contains predicate which, when satisfied, invokes one or more modifiers that changes some aspect of a running simulation. When the predicate is not satisfied any longer, the modified entities are set back to their original values.
STEM currently supports two types of predicate tests, which can be combined using boolean expressions. The tests are:
- Elapsed Time Test - Used to modify a simulation after a given period of time has elapsed in a simulation
- Label Value Test - Used to test the value of a disease or population label in a region
Observe that predicates are evaluated at each whole time step (e.g. day), and not during each incremental step when using the integrating solver (Runge Kutta).
Social Distancing Example
In the first example, we want to control an outbreak by implementing some sort of social distancing after a certain period of time has elapsed. We already have a scenario set up of an outbreak occuring in Malaysia, starting in Kuala Lumpur:
First create a new predicate by selecting the 'New predicate' button in the toolbar. Give it a name, e.g. "ElapsedTimePredicate". The editor for the predicate will open in a new window. Right click on the predicate and select "New Child", then "Elapsed Time Test":
Next, we need to specify the number of days we want to wait. Open the Properties sheet and enter '30' for the 'number of Days' property:
Now we need to determine what we want to modify in the scenario after 30 days have elapsed. Social distancing (e.g. distributing face masks, closing public buildings) reduces the transmissibility of an outbreak, so changing the transmission rate in the disease makes sense. In this case, reducing the transmission rate from 1.3 to 0.3 ensures that the reproductive number falls below 1.0 and the outbreak should be halted.
To create a modifier for a disease, right click on on the disease in the project explorer and select "Create Modifier":
The wizard for creating modifiers opens up. On the row for "Transmission Rate" (scroll down if needed), and in the column for "Select Modifier Type", press the "Single" option (the "Range" and "Sequence" options are only used in STEM Experiments). Enter 0.3 for the new value of transmission rate and then "Finish":
Finally, we need to create a trigger that will contain our predicate and modifier. Select the "New Trigger" button in the toolbar and give it a name (e.g. "SocialDistancingTrigger"). Drag the predicate and the modifier from the project explorer into the trigger: