Action Ensemble
Contents:
Action ensemble: a description of discrete state changes to the system during Initialization and Interventions
Introduction
Synopsis
Action ensemble: a description of discrete state changes to the system during Initialization and Interventions
An action ensemble describes changes to the systems state performed during Initialization and Interventions. These changes may modify node or edge attributes as well as user defined Variables. An action ensemble is applied to a target provided as context by an initialization or an intervention. Actions are scheduled with an optional delay to ensure proper random order of execution of simultaneous actions with equal priority.
Definition
Synopsis
Definition: syntax for the definition of an action ensemble
: [once] [foreach] [sampling] [annotation]
once: list(action)
foreach: list(action)
action: operations [priority] [delay] [condition] [annotation]
operations: list(operation)
operation: target operator (value | observable | variable | sizeof)
target: (type
(duration | weight | active | edgeTrait)
| (susceptibilityFactor | infectivityFactor | healthState | nodeTrait))
| (variable)
type: node | edge
operator: = | *= | /= | += | -=
priority: x (default: 1)
delay: 0 <= n (default: 0)
condition: Boolean
sampling: type (probability | percent | count)
[sampled] [nonsampled] [annotation]
type: individual | group | absolute
probability: number | variable
percent: number | variable
count: number | variable
sampled: [foreach] [sampling] [annotation]
nonsampled: [foreach] [sampling] [annotation]
Name
|
Type
|
Description
|
|---|---|---|
once
|
list(action)
|
Actions which are executed once independent from
the target set.
|
foreach
|
list(action)
|
Actions which are executed for each element in the target set.
|
action
|
object
|
An action to be performed.
|
target
|
object
|
|
operator
|
string
|
The operator used for calculating the assigned value:
\(\qquad\) = | *= | /= | += | -=
The operations argument is given by a value, an observable,
a variable, or the function sizeof.
|
priority
|
\(x \in \mathbb{R}\)
|
Order of action execution:
lowest priority first, random order if equal priority
|
delay
|
\(n \in \mathbb{N}_0\)
|
Optional delay of execution of the action in ticks.
|
condition
|
object
|
Boolean expression which must evaluate to true at the
time of execution.
|
sampling
|
object
|
Optional sampling of the elements in the target set in context.
|
type
|
string
|
The type of sampling (individual | group | absolute).
|
probability
|
\(0 \le x \in \mathbb{R} \le 1\)
|
The probability for individual or group sampling
given by a number or variable.
|
percent
|
\(0 \le x \in \mathbb{R} \le 100\)
|
The percent for individual or group sampling
given by a number or variable.
|
count
|
\(n \in \mathbb{N}_0\)
|
The count of element for absolute sampling
given by a number or variable.
|
sampled
|
object
|
Action ensemble for the sampled subset of the target set.
|
nonsampled
|
object
|
Action ensemble for the non-sampled subset of the target set.
|
ann:*
|
Optional annotation of the set.
|
The normative schema is: actionEnsemble
Examples
80% of individuals with a positive antigen test start isolation immediately (delay = 0). The remaining 20% start with 1 day delay.
"sampling": {
"type": "individual",
"percent": {
"number": 80
},
"sampled": {
"foreach": [
{
"delay": 0,
"operations": [
{
"target": {
"node": {
"property": "nodeTrait",
"feature": "to_start_isolation"
}
},
"operator": "=",
"value": {
"trait": "nodeTrait",
"feature": "to_start_isolation",
"enum": "true"
}
}
]
},
{
"delay": 1,
"operations": [
{
"target": {
"node": {
"property": "nodeTrait",
"feature": "to_start_isolation"
}
},
"operator": "=",
"value": {
"trait": "nodeTrait",
"feature": "to_start_isolation",
"enum": "false"
}
}
]
}
]
}
}