Simunto offers software solutions and support for working with the agent-based traffic simulation software MATSim. Simunto’s customers are supported by a web application that offers them various options for managing and configuring simulations. In providing support in this area, we were confronted with the following challenges:
With the ability to graphically edit XML configuration files, we created the added value that users no longer have to write XML directly. They can concentrate on the effective configuration and the underlying data format is irrelevant to them. Depending on the user’s level of experience, additional areas can be configured.
A schema developed for the graphical editor is used to define which configurations are available in a particular context. The schema defines the individual modules (here the example of one individual module). The individual settings are groupable and repeatable and can be validated.
{
"modules": [
{
"name": "Replanning",
"categories": ["beginner", "advanced", "expert"],
"items": [
{
"label": "Number of threads",
"type": "text",
"binding": "global.numberOfThreads",
"validation": "^\\d+$",
"validationMessage": "integers ≥ 0",
"categories": ["beginner", "advanced", "expert"]
},
{
"label": "Fraction of iterations to disable innovation",
"type": "text",
"binding": "strategy.fractionOfIterationsToDisableInnovation",
"validation": "^1\\.0$|^0\\.?\\d+$|^Infinity$",
"validationMessage": "numeric value between 0.0 and 1.0.",
"hint": "recommended values are around 0.8 and 0.9",
"categories": ["advanced", "expert"]
},
{
"label": "Replanning strategies",
"type": "group",
"binding": "strategy.strategysettings",
"categories": ["beginner", "advanced", "expert"],
"items": [
{
"label": "Strategy",
"type": "select",
"binding": "strategyName",
"selectableValues": ["ReRoute", "TimeAllocationMutator", "ChangeLegMode", "TimeAllocationMutator_ReRoute", "ChangeSingleLegMode", "ChangeSingleTripMode", "SubtourModeChoice", "ChangeTripMode", "TripSubtourModeChoice"],
"customValueAllowed": true,
"categories": ["beginner", "advanced", "expert"]
},
{
"label": "Weight",
"type": "text",
"binding": "weight",
"validation": "^\\d+\\.?\\d+$",
"validationMessage": "floating point value ≥ 0.",
"categories": ["beginner", "advanced", "expert"]
},
{
"label": "Disable after iteration",
"type": "text",
"binding": "disableAfterIteration",
"validation": "^-1$|^\\d+$",
"validationMessage": "integers ≥ 0, or -1",
"hint": "Use -1 to never disable this strategy",
"categories": ["advanced", "expert"]
},
{
"label": "Subpopulation",
"type": "text",
"binding": "subpopulation",
"categories": ["expert"]
}
]
}
]
}
]
}
The GUI is based on the schema and renders the form elements according to the definition. So the complex XML can be configured easily with settings that suit the domain.
Only the most important configuration options are visible in the beginner mode.
In the Advanced mode, additional and more complex configuration options can be used.
In the Expert mode it is then also possible to edit the XML file directly.
To minimize the load on the web server, we implemented an architecture that allows other resources to log on to the server to perform certain tasks with their own resources.
The individual runners communicate with the server via GRPC. Any number of runners can log on to the server, resulting in optimal scaling. The server can delegate tasks to specific runners and receives an answer after the task has been successfully completed by the runner.
Results of MATSim simulations are motion data of agents that are at certain locations at specific points in time. The data can be very large and should be visualized in the browser. The server prepares the geographically restricted data and sends them to the browser in an optimized binary format. The browser visualizes the movement data as well as the road network and metadata with the help of deck.gl and Mapbox. The animation of the motion data can be started, stopped and its speed adjusted. It is also possible to get further information about the underlying network and to visually track an agent.
The red elements symbolize agents who move in and around Berlin over the course of a day.
When zooming in, you can see exactly where the agents are.
The following figure shows the complete road network of Switzerland. It consists of thousands of road sections and all of them are displayed fluidly.
The animation shows multiple simulated agents move around.