OpenRailAssociation / osrd

An open source web application for railway infrastructure design, capacity analysis, timetabling and simulation
https://osrd.fr
GNU Lesser General Public License v3.0
419 stars 40 forks source link

core: use nodes in stdcm priority queue and replace weight by clear comparison #7830

Closed Erashin closed 2 weeks ago

Erashin commented 3 weeks ago

Fixes #7581 and #7582.

codecov-commenter commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 28.67%. Comparing base (22d010d) to head (5acf0be). Report is 25 commits behind head on dev.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #7830 +/- ## ============================================ + Coverage 28.65% 28.67% +0.02% - Complexity 2058 2059 +1 ============================================ Files 1247 1249 +2 Lines 154280 154443 +163 Branches 3031 3040 +9 ============================================ + Hits 44202 44292 +90 - Misses 108276 108337 +61 - Partials 1802 1814 +12 ``` | [Flag](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7830/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [core](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7830/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `75.01% <100.00%> (-0.01%)` | :arrow_down: | | [editoast](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7830/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `71.99% <ø> (+0.14%)` | :arrow_up: | | [front](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7830/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `10.01% <ø> (+<0.01%)` | :arrow_up: | | [gateway](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7830/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `2.34% <ø> (-0.07%)` | :arrow_down: | | [railjson_generator](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7830/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `87.49% <ø> (ø)` | | | [tests](https://app.codecov.io/gh/OpenRailAssociation/osrd/pull/7830/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | `73.16% <ø> (+0.23%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

eckter commented 3 weeks ago

TBD: probably a regression on potentially infinite remaining time (use max with max running time). Also not sure about the default value to 0.0 in STDCMNode.remainingTime, could actually be Double.Infinity.

Exiting early should be mostly straightforward, like if (node.timeSinceDeparture + node.remainingTimeEstimation > maxRunTime) return null just after getting a node. We don't have the time since departure yet, but we already need to add it for other reasons

Also not sure about the default value to 0.0 in STDCMNode.remainingTime, could actually be Double.Infinity.

We shouldn't have no value there. Ideally there shouldn't be any default value, or null if we can't have it when initializing (with !! when getting the value).

If we do want a default value, it should be optimistic (i.e. 0)