Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a converter from NGE operations to OSRD timetable update - Part 1 #7539

Closed
23 of 32 tasks
Tracked by #7534 ...
louisgreiner opened this issue May 28, 2024 · 1 comment · Fixed by #8220
Closed
23 of 32 tasks
Tracked by #7534 ...

Implement a converter from NGE operations to OSRD timetable update - Part 1 #7539

louisgreiner opened this issue May 28, 2024 · 1 comment · Fixed by #8220
Assignees
Labels
area:front Work on Standard OSRD Interface modules kind:feature-task Work related to a feature epic module:operational-studies Multi-train simulation with structured studies management

Comments

@louisgreiner
Copy link
Contributor

louisgreiner commented May 28, 2024

4th step of meta #7535

Acceptance criteria

  • A timetable change implies an update of the NGE model

  • An action on trainruns* in NGE implies an update of the timetable

    • Create trainrun
      • Create valid trainrun with valid path => train schedule creation
    • Update trainrun
      • Update trainrun path (shorten and lengthen steps or only start, intermediary or end step) => train schedule updated
    • Delete trainrun
      • Delete trainrun => delete train schedule
  • Information converted from NGE to OSRD :

    • Name
    • Path

*a trainrun in NGE is the equivalent of a train schedule in OSRD (even tho it is not semantically 100% correct)

Old acceptance criteria (when NGE was supposed to take the output of OSRD)

  • A timetable change implies an update of the NGE model
  • An action on trainruns* in NGE implies an update of the timetable
    • Create trainrun
      • Create valid trainrun with valid path => train schedule creation (simulation not working, rolling stock must be entered in OSRD first) => once the rollingstock is given and simulation done => trainrun updated (running times, same path)
      • Create valid trainrun with incomplete path (should pass by intermediary stations) => train schedule creation (simulation not working, rolling stock must be entered in OSRD first) => once the rollingstock is given and simulation done => trainrun updated (running times, updated path)
      • Create invalid trainrun => train schedule creation (simulation not working, rolling stock must be entered in OSRD first) => once the rollingstock is given and simulation failed => trainrun deleted / updated (TBD)
    • Update trainrun
      • Update trainrun path (shorten and lengthen steps or only start, intermediary or end step) => train schedule updated and simulation done => trainrun updated (updated running times, updated path)
      • Update trainrun departure time => train schedule updated and simulation done => trainrun updated (updated running times, updated path)
      • Update trainrun label => create/update/delete label of associated train schedule
    • Delete trainrun
      • Delete trainrun => delete train schedule

*a trainrun in NGE is the equivalent of a train schedule in OSRD (even tho it is not semantically 100% correct)

Implementation plan

  • [OSRD <- NGE] Implement events handler for NGE operations (in OSRD front) => requests to update timetable
    • Enable eventListener for the NGE operationX events
    • Callback functions to update back-end (timetable)
    • Unitary and functionnal tests

Description

OSRD-NGE Concept diagram

Train schedules v2

Train schedules v2 is not released at the time on the refinement of this ticket, refinement taking in account TSv2 will have to be done during the development of this ticket.

[POSTPONE] Train frequency

Train frequency is not a concept well used in OSRD as well as it is in NGE, however this is a key concept to understand how to work with these two level of detail.

A train frequency helper will have to be implemented on OSRD side, a service that will "translate" a trainrun in NGE into a serie of train schedules in OSRD.

For example, if a trainrun, with a trainrun frequency of 1 hour, is created, it will result in the creation of X (to be defined, maybe 24) train schedules in OSRD, with a very close name (i.e., "{trainrun.name}-{hourOfDeparture}), all shifted from 1 hour, using the same rolling stock, same minute of departure, same path etc...

For you information, in the other hand, when converting a scenario from OSRD to NGE, when a serie of train schedules that have the same attributes enough to be interpreted as frequenced train schedules (same rolling stock, slight variation of name (i.e., "{trainrun.name}-{hourOfDeparture}), same path, evenly shifted in time (every hour / 2 hours...)), it will have to let to display only a single trainrun in NGE (frequency depending on the frequence pattern observed)

Payloads

See Trainrun data model and TrainrunSection data model

Create trainrun:

TrainrunSectionOperation {
    "type": "create",
    "trainrunSection": TrainrunSection
}

Update trainrun:

TrainrunOperation {
    "type": "update",
    "trainrun": Trainrun
}

Delete trainrun:

TrainrunOperation {
    "type": "delete",
    "trainrun": Trainrun
}

Timetable update

The philosophy behind the timetable update is different from the PoC, since in the PoC the whole NGE model is computed and the result is compared to the whole timetable. Here we aim to deal with unitary action from NGE and request for a timetable update only once (atomic change instead of whole timetable comparison). In addition to that, the PoC has been implemented on TSv1. For these reasons, do not stick to the PoC algorithms (even tho it can help to understand).

Labels

The creation or update of a label of a trainrun has to be persisted in OSRD train schedule.

To start with, trainrun labels can be set as train schedule labels, such as:

  • category ("IC", "EC", ...)
  • frequency (15min, 30min, ...)

Tests

Definition of ready

  • PO

    • Acceptance criteria are clear and understandable
  • Technical

    • If required documentation is available on osrd.fr
    • Implementation plan is detailed and validated by maintainers
  • General

    • WSJF values are filled
    • Validated by the PM
@louisgreiner louisgreiner self-assigned this May 28, 2024
@maelysLeratRosso maelysLeratRosso added area:front Work on Standard OSRD Interface modules kind:feature-task Work related to a feature epic module:operational-studies Multi-train simulation with structured studies management labels May 30, 2024
@louisgreiner louisgreiner changed the title Implement a converter from NGE actions to OSRD timetable update Implement a converter from NGE operations to OSRD timetable update Jul 11, 2024
@maelysLeratRosso
Copy link

maelysLeratRosso commented Jul 30, 2024

CR atelier 29/07/24

Présents : Louis, Uriel, Simon, Florian, Maëlys

Questions

  • Quand on crée un train dans NGE, dans l'attribut path de train_schedule, que mettre par défaut pour l'attribut deleted ? -> false (à la création depuis NGE, mais ne pas écraser depuis NGE s'il l'attribut est à true)
  • Quand on crée un train dans NGE, dans l'attribut schedule de train_schedule , que mettre par défaut pour les attributs locked et on_stop_signal ? -> false pour les 2 (à la création depuis NGE, mais ne pas écraser depuis NGE s'il l'attribut est à true)
  • Quand on crée un train dans NGE, que mettre par défaut dans l'attribut rolling_stock de train_schedule? "" (à la création depuis NGE, mais ne pas écraser depuis NGE s'il un autre rolling stock est renseigné dans la circulation)
  • Comment garder en mémoire dans OSRD les attributs de TrainCategory et de Frequency inscrits dans NGE ?
    • -> Court terme :
      • on place ces attributs dans des labels, auxquels un préfixe est associé pour reconnaître dans NGE quels labels utiliser (respectivement category:: et frequency::) sur la base de scoped-labels de GitLab.
      • Si aucun label n'est présent sur une circulation, utiliser une valeur par défaut dans NGE (TODO lister attributs par défaut pour les 2)
      • Si 2 labels sont présents sur une circulation pour le même préfixe, utiliser une valeur par défaut dans NGE (TODO comment discriminer ? remplacer l'ancien label par le nouveau ?)
      • La liste de labels présentés dans NGE à la création/édition d'un train est : UNION(une liste par défaut + ceux des circulations de la grille pour le préfixe associé) (TODO liste par défaut + exemple ceux de la circu)
    • -> Moyen terme : forcer l'unicité des labels pour chaque préfixe dans OSRD? (TODO remplacer l'ancien ou liste de priorité?)
    • -> Long terme : ces informations seront sans doute gardées dans la famille de train (au moins pour la fréquence)
  • Comment garder en mémoire dans OSRD les attributs de numberOfStrops inscrits dans NGE? -> Pour le moment, on ne gère pas cet attribut.

TODO sur ce PI

  • Supporter dans NGE le fait d'avoir une TrainrunSection sans horaires/temps de parcours, tout en permettant d'ajouter des valeurs (l'heure de départ de la TrainRun est obligatoire)
  • Les labels associés à la catégorie de train et à la fréquence sont transmis à NGE
  • Le chemin demandé (path) est transmis à NGE (seulement l'input)
  • Les points horairisés (schedule) sont transmis à NGE sur les 4 points horairisés de NGE
  • Ajouter la notion de CH dans les noeuds NGE pour que deux PRs avec le même trigramme ne soient pas mergés en un noeud NGE (exemple : DN/BV et DN/SG doivent être deux noeuds distincts) -> Concaténer {$trigramm/$ch} dans le BP (= Betriebspunktname = shortname = trigramme lol) de NGE
  • Afficher une erreur dans NGE si un noeud par lequel passe une circulation est renommé (duplicat ?
  • Ne pas clean les noeuds non empruntés par une circulation (on initialise l'affichage des noeuds NGE par les noeuds empruntés par les circulations, mais à la synchronisation, on ne supprime pas) (duplicat ?
  • S'il reste du temps, conserver les noeuds NGE dans localStorage (cf critères d'acceptance https://github.com/osrd-project/osrd-confidential/issues/593 et https://github.com/osrd-project/osrd-confidential/issues/597)

TODO côté métier

  • Vérifier comment gérer les temps d'arrêt qui sont renseignés modulo 60 (voir si on peut différencier dans NGE un arrêt de 10 minutes d'un arrêt de 70 minutes)

@maelysLeratRosso maelysLeratRosso self-assigned this Aug 8, 2024
@maelysLeratRosso maelysLeratRosso changed the title Implement a converter from NGE operations to OSRD timetable update Implement a converter from NGE operations to OSRD timetable update - Part 1 Aug 8, 2024
@maelysLeratRosso maelysLeratRosso changed the title Implement a converter from NGE operations to OSRD timetable update - Part 1 Implement a converter from NGE operations to OSRD timetable update Aug 9, 2024
@maelysLeratRosso maelysLeratRosso changed the title Implement a converter from NGE operations to OSRD timetable update Implement a converter from NGE operations to OSRD timetable update - Part 1 Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:front Work on Standard OSRD Interface modules kind:feature-task Work related to a feature epic module:operational-studies Multi-train simulation with structured studies management
Projects
None yet
4 participants