Skip to main content

Simulation Configuration

Options for Simulation Configuration

This is a list of all the attributes that can be defined in different sections of the simulation configuration.

Execution

The simulation is executed in parallel if multiple processors are available. Sometimes it's handy to switch to a sequential execution to evade problems with locks or synchronization.

Therefore use in top level config option execution the maxProcessCount property and set it to 1.

{
"execution": {
"maxProcessCount": 1
},
"globals": {
// ...
}
}

Globals

The globals options define general settings for the simulation like everything around the simulation time.

PropertyTypeDefaultRequiredConstraintsExcludes
idStringmodel_name + _ + timestampNo special characters
stepsInteger1value ≥ 0startTime; endTime
startTimeDateTimenowvalue > endTimesteps
endTimeDateTimenullvalue > startTimesteps
deltaTInteger1value > 0
deltaTUnitTimeUnitsecondsone of: milliseconds, seconds, minutes, hours, days, months, years

Here is an example:

{
"globals": {
"startPoint": "2020-01-01T00:00:00",
"endPoint": "2020-01-01T01:00:00",
"deltaT": 1,
"deltaTUnit": "seconds",
"console": true,
"output": "csv",
"options": {
"delimiter": ";",
"numberFormat": "F2"
}
}
}

startPoint: the start time of the simulation

endPoint: the end time of the simulation

deltaT: the length of a single time step

deltaTUnit: the unit of a single time step

console: if true, the simulation progress is displayed in the terminal

output: the medium into which simulation output data is stored

Note: if output is set to csv, then the key options can be used to define further details such as the delimiter and the numberFormat.


Output

PropertyTypeDefaultRequiredConstraints
outputOutputOptionnoneone of: none, CSV, MongoDB, redis, postgresql, sqlite

Output (mongoOptions, npgSqlOptions, redisOptions)

PropertyTypeDefaultRequiredConstraints
portIntegerdb specificvalue > 0
hostStringlocalhost
userString
passwordString
connectionTimeoutInteger5value > 0
databaseNameString$sim-config-id

Output (sqLiteOptions)

PropertyTypeDefaultRequiredConstraints
databaseNameString$sim-config-id
isInMemoryBooleanfalse

Output (socketOptions) exclude?

PropertyTypeDefaultRequiredConstraints
socketPathString
sendingIntervalInteger0

Output (csvOptions)

PropertyTypeDefaultRequiredConstraintsNotes
delimiterDelimiter,one of: ,, ;, \t, \w
includeHeaderBooleantrue
encodingStringUTF-8
chunkSizeIntegerexclude
appendConfigNameBooleantrue
fileSuffixStringoverwrites appendConfigName
numberFormatStringgexclude
cultureStringen-EN

Layer

PropertyTypeDefaultRequiredConstraints
nameStringclassname in AST
filePathpath exists
outputOutputOptionnone
outputFrequencyInteger1value ≥ 0

The layer section includes a list of configurations for each layer type defined in the model. Here is an example of the configuration for two layers:

{
"layers": [
{
"name": "TrafficLightLayer",
"file": "res/traffic_lights/traffic_lights_harburg_zentrum.zip"
},
{
"name": "CitizenLayer",
"file": "res/networks/harburg_zentrum_walk_graph.geojson",
"mapping": [
{
"parameter": "ParkingOccupancy",
"value": 0.779
}
]
}
]
}

name: the name of the layer type. Note: this must match the layer type's name in the model.

file: the path to a file with geodata that is used to populate the layer.

mapping: a list of additional mappings for the layer.

Raster Layer

PropertyTypeDefaultRequiredConstraints
filePathallowed file types: asc, csv, zip
outputLayerOutputOptionascoptions: asc, csv, none
info

(Optional)
** Spatio-Temporal-Layer**

  • Set von Dateien auswählen
  • Ordnung der Dateien bestimmen
  • Dateien mit Zeitangaben versehen

Empty Layer

  • Bounding Box angeben (lower left, upper right)
  • No Data Value mit bspw. -99

Vector Layer

PropertyTypeDefaultRequiredConstraints
filePathallowed file types: geoJSON, ESRI Shapefile
outputVectorLayerOutputOptionsascoptions: asc, geoJSON, ESRI Shapefile, none

Agents

PropertyTypeDefaultRequiredConstraintsExcludes
nameStringclassname provided by ASTagent must exist in model
frequencyInteger1value > 0
filePathpath existscount
outputOutputOptionGlobal Output Value
outputFrequencyInteger1value ≥ 0
outputFilterFilterList
countInteger0value ≥ 0
mappingMappingexternal variables must be mapped

The Agents section includes a configuration (an AgentMapping) for each agent type defined in the model. Here is an example:

{
"agents": [
{
"name": "Citizen",
"count": 10,
"file": "res/agent_inits/CitizenInit10k.csv",
"options": {
"delimiter": ";"
},
"mapping": [
{
"parameter" : "CanCycle",
"value" : true
},
{
"parameter": "resultTrajectory",
"value": true
}
]
}
]
}

name: the name of the agent type. Note: this must match the agent type's name in the model.

count: the number of agents of this agent type that should be spawned at the beginning of the simulation

file: the path to a csv file that contains a set of attributes and attribute values to parametrize the agents

Note: if a file is specified, the key options can be used to define further details such as the delimiter.

mapping: a list of additional mappings for the agents.

Mapping

PropertyTypeDefaultRequiredConstraintsExcludes
parameterStringmust exist in agent definition and be marked as external
valueAnymust be type of external parameterfield
fieldStringallowed if input file is specified; must exist in .csvvalue
typePrimitiveTypesread from AST
{
"mapping": [
{
"parameter": "Energy",
"value": 100,
"field": "field.name"
}
]
}