Closed eckter closed 1 year ago
For now, the plan to implement this is as follows:
The problem is split into two parts:
We intend on implementing step 2 iteratively: at first we will only find the simplest paths, where the train always goes as fast as possible. We will then add ways to avoid occupied blocks, by shifting the departure time, adding braking sections, and eventually engineering allowances.
We will still use a greedy algorithm, which means we may miss some possible solutions. As far as we know, the only methods that would find all possible paths would have a time and space complexity we can't afford.
Now that we have an implementation of the most simple version where the train does not slow down, we can list the things that we will need to improve or change.
Things that need to be done:
Things to keep in mind, to be done eventually with no real pressure:
To add delays in places where we can't delay the departure time, we have several options. Ideally we should be able to output a valid train schedule that can be reproduced in a standalone simulation. To do this, the only real options we have to add delay are engineering allowances and extra stops.
To use either of those, we need to handle backtracking: #2168. And #2006 would make things easier.
Once we can backtrack, the method becomes quite straightforward. When we need to add delay, we first try to delay the departure time (which we can already do). If this fails, we try an engineering allowance, creating a new edge spanning over all of the allowance range. If this fails as well, we try to add a stop. If everything fails, we are at a dead-end.
Outdated: see https://github.com/DGEXSolutions/osrd/issues/3998
Optional / to do once the rest is stable:
Cleanup:
Current known bugs: