SimulationRoute
Logic of the Routes in the /simulation path.
Functions
Route that pauses the simulation by calling the it.unibo.alchemist.core.Simulation.pause method. The HTTP Response sent to the client can be of type: 200 (OK) if the operation succeed; 409 (Conflict) if the simulation is already paused, or is in an invalid state to call the pause operation; 500 (Server Error) if the Simulation was not loaded correctly.
Route that plays the simulation by calling the it.unibo.alchemist.core.Simulation.play method. The HTTP Response sent to the client can be of type: 200 (OK) if the operation succeed; 409 (Conflict) if the simulation is already running, or is in an invalid state to call the play operation; 500 (Server Error) if the Simulation was not loaded correctly.
Route that retrieve the simulation status and return it to the client mapping it with the toStatusSurrogate function. The HTTP Response sent to the client can be of type: 200 (OK) if the status is correctly retrieved; 500 (Server Error) if the Simulation was not loaded correctly.