Sets
Contents:
Sets: in EpiHiper set contain elements (nodes \(N\) and/or edges \(E\)) of the Contact Network or values \(V\) selected from the Trait Databases.
Introduction
Synopsis
Sets: in EpiHiper set contain elements (nodes \(N\) and/or edges \(E\)) of the Contact Network or values \(V\) selected from the Trait Databases.
In EpiHiper sets of are the building blocks of Initialization and Interventions where they are used to specify the targets of an Action Ensemble. Furthermore, the size (number of contained elements) can be used to define a Trigger.
Definition
Synopsis
Definition: Syntax for the definition of sets
set: id scope content [annotation]
scope: local | global
Name
|
Type
|
Description
|
|---|---|---|
id
|
An id which has to be unique within the list of sets
|
|
scope
|
local|global
|
The scope for computing the elements of a set required for correct simulation
|
content
|
The content of the set
|
|
ann:*
|
Optional annotation of the set
|
The attribute scope is used to enhance performance. Local content is faster to compute and suffices in most situations.
The normative JSON schema can be found at: set
Content
Synopsis
Content: specification of the elements contained in a set.
: (elementType [scope] operator left right)
| (elementType [scope] operator selector)
| (elementType [scope])
| (elementType table)
| (operation sets)
| (set)
elementType: node | edge | dbField
scope: local | global
operator: (== | != | <= | < | >= | >)
| (in | not in)
| (withTargetNodeIn | withSourceNodeIn | withIncomingEdgeIn)
left: (property [feature])
| (field [table])
property: (targetId | sourceId | locationId | duration | weight | active
| (targetActivity | sourceActivity | edgeTrait) feature)
| (id | susceptibilityFactor | infectivityFactor | healthState | nodeTrait feature)
right: value | valueList
value: (boolean | number | id | healthState | trait feature enum)
valueList: (boolean | number | id | healthState | trait feature enum)
selector: content
operation: union | intersection
sets: list(content)
set: idRef
We have several alternative syntaxes to specify the content. The third specifies either all nodes or all edges and the fourth specifies all nodes (PIDs) in a table. Here the attribute scope is only required if the elementType is node. Furthermore, the valid values for feature, field, and table must be defined in Traits or Trait Databases.
Name
|
Type
|
Description
|
|---|---|---|
elementType
|
string
|
The type of the element node | edge | dbField
|
scope
|
string
|
The scope (local | global) for computing the elements.
Only required if the
elementType is node |
operator
|
string
|
The operator used for comparing left and right:
== | != | <= | < | >= | > | in | not in
| withTargetNodeIn | withSourceNodeIn | withIncomingEdgeIn.
|
left
|
object
|
The left operant of the comparison
|
property
|
string
|
|
right
|
object
|
|
selector
|
object
|
setContent used to filter nodes or edges based on attributes which are lists.
|
operation
|
string
|
A set operation either union or intersection
|
sets
|
list
|
List of set content.
|
set
|
object
|
Reference to another set definition.
|
idRef
|
string
|
A reference of an id of a existing set .
|
The normative JSON schema can be found at: setContent
Examples
A set containing all edges of contacts of school children. These are contacts to other children, teachers, or other schill employes.
{
"id": "school_edges",
"scope": "local",
"content": {
"operation": "union",
"sets": [
{
"scope": "local",
"elementType": "edge",
"left": {
"edge": {
"property": "targetActivity",
"feature": "activityType"
}
},
"operator": "==",
"right": {
"value": {
"trait": "activityTrait",
"feature": "activityType",
"enum": "school"
}
}
},
{
"scope": "local",
"elementType": "edge",
"left": {
"edge": {
"property": "sourceActivity",
"feature": "activityType"
}
},
"operator": "==",
"right": {
"value": {
"trait": "activityTrait",
"feature": "activityType",
"enum": "school"
}
}
}
]
}
}