-
Notifications
You must be signed in to change notification settings - Fork 46
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
core: stdcm: reorganize step data to make them dynamic #11109
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #11109 +/- ##
==========================================
+ Coverage 80.86% 80.88% +0.01%
==========================================
Files 1118 1119 +1
Lines 112736 112834 +98
Branches 759 759
==========================================
+ Hits 91164 91262 +98
Misses 21517 21517
Partials 55 55
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3ee55cd
to
268d4be
Compare
* Otherwise, it returns false and the instance is supposed to be dropped. `blockRoutes` is | ||
* updated to keep track of the route used for each block. |
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.
Having to always keep the current isntance in a consistent state even when it's meant to be discarded was a lot more painful here. We need to update the step tracker to properly handle the following edges.
268d4be
to
bd324f4
Compare
TODO (?) We still use raw input steps in |
Signed-off-by: Eloi Charpentier <[email protected]>
Signed-off-by: Eloi Charpentier <[email protected]>
Signed-off-by: Eloi Charpentier <[email protected]>
Signed-off-by: Eloi Charpentier <[email protected]>
Signed-off-by: Eloi Charpentier <[email protected]>
bd324f4
to
1c0b9a0
Compare
@@ -55,36 +53,38 @@ data class STDCMEdge( | |||
|
|||
/** Returns the node at the end of this edge */ | |||
fun getEdgeEnd(graph: STDCMGraph): STDCMNode { | |||
var newWaypointIndex = waypointIndex | |||
// TODO: maybe integrate this logic to StepTracker? |
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.
// TODO: maybe integrate this logic to StepTracker? |
Fix #8974
Follow-up of #10989 (which started the wrong way).
May be reviewed commit by commit, but there's been a few changed from earlier commits that have been changed again in later ones. But they're mostly self-contained changes and each commit normally compiles and runs properly (though I've only run unit tests).
The main goal of this refactor was to remove the use of step data as a static thing, so that they can be changed dynamically when implementing overtakes. The main challenge was checking for
graph.steps
to test for, e.g., stop duration. A few data redundancy have been removed as well (like stop offsets inInfraExplorerWithEnvelope
), but they weren't too tangled up.The main change is the Introduction of a class that keeps track of the steps on the path,
StepTracker
. It includes both stops and non-stop waypoints, while keeping track of what's in the lookahead section. Eventually it may include stops that aren't part of the input.This solves two main issues: we don't need to check for the input step list anymore, we can instead rely on
StepTracker
's step list, which would include extra stops. We also don't need to manually keep track of waypoint indexes in edges/nodes (which again wouldn't match with a more dynamic stop list).There's some more minor refactoring along the way.