-
Notifications
You must be signed in to change notification settings - Fork 17
front: handle times update on reduced nodes #590
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
base: mrd/new-nodes-management-system
Are you sure you want to change the base?
front: handle times update on reduced nodes #590
Conversation
Signed-off-by: Clara Ni <[email protected]>
14aff1d to
e5de33f
Compare
louisgreiner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The left (source) -> right (target) works
The left (target) <- right (source) not; I'm trying to find a solution if you don't find it first :-)
You can test with this also:
reticulaire(3).json
Also, do not forget to remove the last commit
|
|
||
| export class NonStopTrainrunIterator extends TrainrunIterator { | ||
| /** Iterate on the trainrun sections until we find a node which is a stop of the trainrun and not collapsed */ | ||
| export class NextVisibleStopIterator extends TrainrunIterator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we name it NextExpandedStopIterator? To re-use the "expanded"/"collapsed" paradigm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done !!
louisgreiner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further testing, happens this actually does not work for right times updates :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea to add the stop time prop!
This makes the easy case work (rightIsTarget = true) but not the other situation still.
Also, I think you have forgotten to add the stop time stuff in onNodeLeftArrivalTimeChanged()? I quickly tried to test but I'm not sure of what I'm saying rn
ps: you have formatting issues, npm run format
fad0e73 to
48bc480
Compare
`TrainrunsectionHelper.getTravelTime()` computes the new travel time of a trainrunSection, either by using the `travelTimeFactor` and the current travel time of the section, or by using the total trainrun travel time and the sum of the new travel times computed up to that point. This logic can be split into 2 independent functions, which will be used depending on whether the considered section is the last one to compute or not. Signed-off-by: Clara Ni <[email protected]>
48bc480 to
4206b78
Compare
|
@louisgreiner it's fixed ! |
louisgreiner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ! Working smoothly.
I think you've forgot to add the stop stuff calculation in onNodeLeftArrivalTimeChanged(), since you've added it in the 3 other inputs. However, I can't produce a case that makes it bug.
Also, do not forget to remove the wip comment and we're good to go!
| ); | ||
| } else if (!this.lockStructure.travelTimeLock && this.lockStructure.leftLock) { | ||
| const extraHour = this.timeStructure.travelTime - (this.timeStructure.travelTime % 60); | ||
| // pas sûre d'avoir compris comment fonctionnait l'extraHour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // pas sûre d'avoir compris comment fonctionnait l'extraHour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| export class NonStopTrainrunIterator extends TrainrunIterator { | ||
| /** Iterate on the trainrun sections until we find a node which is a stop of the trainrun and not collapsed */ | ||
| export class NextVisibleStopIterator extends TrainrunIterator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
up
Until now, a time structure has represented one or several trainrun sections without any stops, so it could be described by its departure and arrival times (right and left) and its travel time. Since we are now going to handle several trainrun sections that include stops, we need to add a new property to store the total stop time in the time structure. Signed-off-by: Clara Ni <[email protected]>
4206b78 to
fae5b60
Compare
I have not forgotten it, I think I really don't need to do this modification since I only have to add the travel time in this special case (the stop time is not needed here) 😉 I have drop the last commit "wip" 👍 |
…masked The behavior is pretty much the same as when a node is a non-stop node, except when updating the travel time, because we need to take into account the stop times of the reduced nodes. Signed-off-by: Clara Ni <[email protected]>
…ion tab Signed-off-by: Clara Ni <[email protected]>
fae5b60 to
e991210
Compare
Description
This PR allows to handle times updates correctly when a node is collapsed.
I will add more details later.
Issues
OpenRailAssociation/osrd#13347
Checklist
documentation/