Requesting a micro simulation or micro simulation group
With this endpoint you can request a single micro-simulation for a sub-network or a micro-simulation group with several micro-simulations with different actions.

Request
POST optima-as/optimissim/simulations
Request parameters
Not applicable.
Request content-type
application/json
Request body (payload)
JSON message describing the subnetwork and the traffic management actions for which micro simulations are requested. The message has the following structure:
- subnetId must be valid and can be obtained by → Getting information about micro simulation subnetworks.
- description (optional) string describing the single micro simulations or the micro simulation group.
-
activeScenarioIds (optional) specifying scenarios considered in the respective micro simulation as these can be obtained and managed by → Scenarios.
- For the scenarios associated to a specific subnetwork, see → Getting scenarios of a subnetwork.
- simulationPeriod (optional) defines the simulation period (in seconds) of the micro simulation. The simulation period represents the forecast horizon. It cannot be negative or larger than the forecast horizon of TRE. The warmup period specified in the settings of Optima Micro is added on top and cannot be cut short.
{
"subnetId": 42,
"description": "Accident at main station",
"microSimulations" : [
{
"description": "Change signals inbound",
"simulationPeriod": 3600,
"activeScenarioIds": [1,2]
},
{
"description": "Change signals outbound",
"simulationPeriod": 3600,
"activeScenarioIds": [32,42,55]
}
...
]
}

Response status
HTTP status | Description |
---|---|
201 Created |
If the request is issued correctly. |
400 Bad Request |
If the subnetId or activeScenarioIds are not valid, the service answers with 400 and with a proper message in the entity. |
412 Precondition Failed |
If the request contained more micro simulations in a micro simulation group than the license allows, the request is rejected and the service answers with 412 and a proper message in the entity. |
For the complete list of error codes and messages, see → Optima Micro: error codes and response status > Error codes of the Optima Micro API.
Response content-type
application/json
Response entity
JSON message containing information about the ids, configuration and status of the request.
The microSimulationGroupId and microSimulationId of the micro simulations can be used in subsequent requests to get information.
For the complete list of the possible response statuses, see → Optima Micro: error codes and response status > Response Status.

Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/optimissim/simulations
Request input
{ "subnetId": 2, "description": "Accident at main station", "microSimulations" : [ { "description": "Signals 1 - increase outbound", "simulationPeriod": 3600, "activeScenarioIds": [1,2] }, { "description": "Signals 2 - increase inbound", "simulationPeriod": 3600, "activeScenarioIds": [3,4] } ] }
Response status
HTTP status | Description |
---|---|
201 Created |
If the request is issued correctly. |
Response output
{
"microSimulationGroupId": "4cb47d75-46d6-48f4-a102-fae13ff41ccb",
"subnetId": 2,
"description": "Accident at main station",
"microSimulations": [
{
"microSimulationId": "c76b8793-d048-44f2-b0ef-f9a1af2f6d15",
"description": "Signals 1 - increase outbound",
"simulationPeriod": 3600,
"activeScenarioIds": [1,2],
"status": "ACCEPTED",
"progress": null
},
{
"microSimulationId": "c3c05427-3045-405a-a0bf-df4ae42de315",
"description": "Signals 2 - increase inbound",
"simulationPeriod": 3600,
"activeScenarioIds": [3,4],
"status": "ACCEPTED",
"progress": null
}
]
}

Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/optimissim/simulations
Request input
{ "subnetId": 5, "description": "My Sim group", "microSimulations" : [ { "description": "My single Sim - 1", "simulationPeriod": 900, "activeScenarioIds": [] }, { "description": "My single Sim - 2", "simulationPeriod": 900, "activeScenarioIds": [] }, { "description": "My single Sim - 3", "simulationPeriod": 900, "activeScenarioIds": [] } ] }
Response status
412
Response output
{ "errors": [ { "code": "OPTMICRO-008", "message": "Simulation request delayed. Requested scenarioes number not licenced, considered previous parallel requests still running. Max parallel scenario/es licenced are 4. Found 2 accepted, 0 issued and 1 received scenario/es. Requested 3 scenario/es with too much parallel requests running. Request d3871679-26ac-4fa1-a786-2aaa526ba31f delayed." } ] }