7. Configuration File Formats¶
Note
These configuration files was in maestro v1 / coe called multi-model (*.mm.json
) and co-simulation configuration (*.coe.json
) files. Maestro v2 just accept any json files during its (sg1
) import phase and merges them into one object for processing.
These properties are new to maestro V2
faultInjectInstances
: Used for fault injectionfaultInjectConfigurationPath
: Used for fault injectionfaultInjectInstances
: Used for fault injectionmodelTransfers
: Used for model swapping during simulationmodelSwaps
: Used for model swapping during simulation
For more on fault injection see the paper “Fault Injecting Co-simulations for Safety” at https://ieeexplore.ieee.org/document/9660728
For more on model swapping se the paper “fmiSwap: Run-time Swapping of Models for Co-simulation and Digital Twins” at https://arxiv.org/pdf/2304.07328.pdf
{
"modelSwaps": {
"controller": {
"swapInstance": "crtlInstance3",
"stepCondition": "(true)",
"swapCondition": "(controller.valve ==true)",
"swapConnections": {
"{x3}.crtlInstance3.valve": [
"{x2}.tank.valvecontrol"
],
"{x2}.tank.level": [
"{x3}.crtlInstance3.level"
]
}
}
},
"modelTransfers": {
"controller": "controller",
"tank": "tank"
}
}
7.1. Legacy Configuration / INTO-CPS Multi-model and coe config File Format¶
Note
This file is a multi-model (*.mm.json
) file and originally developed for maestro v1
{
"fmus": {
"{control}": "watertankcontroller-c.fmu",
"{tank}": "singlewatertank-20sim.fmu"
},
"connections": {
"{control}.c.valve": [
"{tank}.t.valvecontrol"
],
"{tank}.t.level": [
"{control}.c.level"
]
},
"parameters": {
"{control}.c.maxlevel": 2,
"{control}.c.minlevel": 1
}
}
The multi model shown above contains the following:
fmus
: This is a mapping from fmu name specified in{}
to a either path from the FMUs folder or a URI using a custom format*connections
: The is a mapping between triples to a list of triples. The triples takes the form (fmu name, instance name, scalar variable name). The domain of the map must only contain scalar variables with causality output where the scalar variables in the list in the range of the map all must be of causality inputparameters
: The is also a mapping from triples but with causality parameter. The range must contain the value that should be used instead of the value specified in the model description.
Note
This file is a co-simulation configuration (*.coe.json
) file and originally developed for maestro v1.
{
"startTime": 0,
"endTime": 30,
"multimodel_path": "Multi-models/mm/mm.mm.json",
"liveGraphColumns": 1,
"liveGraphVisibleRowCount": 1,
"graphs": [],
"livestreamInterval": 0,
"livestream": {
"{Controller}.cont": [
"valve"
],
"{WaterTank}.wt": [
"level"
]
},
"logVariables": {
"{WaterTank}.wt": [
"level"
],
"{Controller}.cont": [
"valve"
]
},
"visible": false,
"loggingOn": false,
"overrideLogLevel": null,
"enableAllLogCategoriesPerInstance": false,
"algorithm": {
"type": "fixed-step",
"size": 0.1
},
"postProcessingScript": "",
"multimodel_crc": null,
"parallelSimulation": false,
"stabalizationEnabled": false,
"global_absolute_tolerance": 0,
"global_relative_tolerance": 0.01,
"simulationProgramDelay": false
}
The following shows the coe config aka simulation configuration. Note that these properties are only used by the app and not maestro:
multimodel_path
liveGraphColumns
liveGraphVisibleRowCount
graphs
postProcessingScript
multimodel_crc
The following properties are used in maestro using sg1 import/ web api:
startTime
: the simulation start timeendTime
: the simulation end time (could be left out)livestreamInterval
: the live stream max report interval. This is used to skip updates if the simulation perform many updates withing a very short time framelivestream
: this is a mapping from tuples of fmu name and instance to a list of scalar variables that should be transmitted over the web socket while simulating (similar to the output.csv but just live | only for the webapi)logVariables
: this is a mapping from tuples of fmu name and instance to a list of scalar variables that should be logged (included in the output.csv)visible
: fmu visible flagloggingOn
: fmu logging on flagoverrideLogLevel
: override the maestro log levelenableAllLogCategoriesPerInstance
: automatically enable all log categories in all fmusalgorithm
: the algorithm to be used, default is type=’fixed-step’ with size=<decimal number>parallelSimulation
: run the simulation steps in parallel when ever possible. Eg in jaccobian all instances can get/set/doStep in parallelstabalizationEnabled
: if algebraic loops exists then attempt stabilisation (will use global_absolute_tolerance, global_relative_tolerance)global_absolute_tolerance
: for stabilisationglobal_relative_tolerance
: for stabilisationsimulationProgramDelay
: slow down simulation doStep to make sure its not faster than the step time itselfreportProgress
: Not used in maestroV2