Interventions
Contents:
Introduction
Synopsis
Interventions: changes to the state independent from the contagion model.
An intervention describes changes to the system state independent from the contagion model. The intervention happens when a Trigger evaluates to true. The trigger may be defined locally in the intervention itself or externally. External triggers refer to the interventions they trigger by the the unique id. When an intervention is triggered a user defined Action Ensemble is applied to a target Sets (nodes \(N\) and/or edges \(E\)) of the Contact Network. Note, it is possible that the target set may be empty. In that case only action specified under once in the Action Ensemble are applied.
Definition
Synopsis
Definition: Syntax for the definition of interventions
intervention: (id | trigger) target actionEnsemble [annotation]
target: setContent [annotation]
An intervention mus either have unique id so that it can be referenced by an externally defined trigger or it a locally defined trigger.
Name
|
Type
|
Description
|
|---|---|---|
id
|
An id which has to be unique within the list of interventions
|
|
trigger
|
object
|
The Trigger which must be true in oder for the action ensemble
to be applied.
|
target
|
object
|
|
actionEnsemble
|
object
|
The Action Ensemble applied to the target set .
|
ann:*
|
Optional annotation of the intervention
|
Examples
Intervention to maintain the day of the week. This intervention is triggered at every tick. Note the variable \(week\_day\) is reset every seven days:
"variables": [
{
"id": "week_day",
"initialValue": 0,
"scope": "local",
"reset": 7
}
],
"interventions": [
{
"ann:id": "maintain_week_day",
"ann:label": "update the week_day",
"trigger": {
"value": true
},
"target": {
"set": {
"idRef": "%empty%"
}
},
"once": [
{
"operations": [
{
"target": {
"variable": {
"idRef": "week_day"
}
},
"operator": "+=",
"value": {
"number": 1
}
}
]
}
]
}
]