OpenRailAssociation / osrd

An open source web application for railway infrastructure design, capacity analysis, timetabling and simulation
https://osrd.fr
439 stars 39 forks source link

stdcm: refacto: have core return a train schedule *input* instead of the output directly #7653

Open eckter opened 3 months ago

eckter commented 3 months ago

Currently, the core api for stdcm returns this:

class STDCMSuccess(
    var simulation: SimulationResponse,
    var path: PathfindingBlockResponse,
    @Json(name = "departure_time") var departureTime: ZonedDateTime
) : STDCMResponseV2

We directly return the simulation response in a format that's identical to the one returned by the simulation endpoint.

What we could do instead would be to return a train schedule, as in, the input for a simulation call. Editoast would then be in charge of sending a new request to core to get the actual results.

This would let us cache and re-use lots of components and generally makes more sense.

This refactoring is briefly mentioned in https://github.com/osrd-project/osrd-confidential/issues/331, it came up in a workshop when discussion this issue.

Erashin commented 1 month ago

This clashes with currently planned developments. To keep in mind, might be done in the future at some point.