Skip to main content

Model context example

This is a comprehensive example of a model context file. It is designed to illustrate the full schema and some of the elements are never actually used together.

Learn more

For shorter language-specific examples, see:

For a reference on the schema, read Model context schema.

Model context file example
{
"version": "v2",
"defaults": {
"variables": {
"dialect": "xy",
"resetDecision": false,
"save": true,
"sensitivity": false,
"reportPer": 1,
"reportOffset": 0
},
"operations": {
"timeoutSeconds": 30,
"inert": false
}
},
"variables": {
"variable": {
"dialect": "point_in_time",
"resetDecision": true,
"save": true,
"sensitivity": false,
"reportPer": 2,
"reportOffset": 0
},
"sensitivityVariable": {
"resetDecision": false,
"save": false,
"sensitivity": true,
"reportPer": 1,
"reportOffset": 0
}
},
"operations": {
"operation": {
"timeoutSeconds": 20,
"inert": false
}
},
"mappedFiles": {
"key": "path/to/file"
},
"externalFunctions": {
"key": {
"wire": {
"route": {
"function": {
"name": "create"
},
"service": "user",
"version": 2
},
"arguments": "[\"name\",\"email\"]"
}
}
},
"restorations": {
"rewind": {
"arguments": [
1,
"hello"
],
"name": "operation",
"destructible": false
},
"assembly": [
{
"snapshot": {
"variables": [
"variableOne",
"variableTwo"
]
}
},
{
"replay": {
"operations": [
{
"operationType": "stop_before",
"targetType": "execute",
"targetKey": "operation"
},
{
"operationType": "stop_after",
"targetType": "set",
"targetKey": "variable"
},
{
"operationType": "include",
"targetType": "execute",
"targetKey": "operation"
},
{
"operationType": "exclude",
"targetType": "set",
"targetKey": "variable"
}
]
}
}
],
"log": "full"
},
"protections": {
"guards": [
{
"role": {
"regex": "state.players.doctor.*",
"grant": "ALLOW",
"domain": "variable",
"role": "doctor"
}
},
{
"overwrite": {
"regex": "state.internal.precondition",
"initial": "-1"
}
},
{
"relative": {
"operator": "eq",
"value": "42",
"key": "state.internal.other"
}
},
{
"input": {
"regex": "state.internal.precondition",
"operator": "lt",
"operand": "0"
}
},
{
"privilege": {
"regex": "*",
"grant": "DISALLOW",
"read": "PARTICIPANT",
"write": "PARTICIPANT",
"execute": "PARTICIPANT"
}
}
]
},
"dependencies": [
{
"pypi": {
"package": "package",
"version": "1.0.0"
}
},
{
"apt": {
"package": "package",
"version": "1.0.0",
"repository": "repository"
}
}
],
"language": "vensim",
"control": {
"vensim": {
"sensitivityControl": {
"algorithm": "M",
"parameters": [
"Constant=RANDOM_UNIFORM(2,4)"
],
"numberOfSimulations": 1,
"noiseSeed": 1234
}
}
},
"minimumLogLevel": "INFO",
"workerImage": "worker_image_name",
"redirectStandardOut": true,
"startDebugger": false,
"modelVersion": 3,
"inceptionGracePeriodSeconds": 30
}