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

stdcm waypoints and intermediate stops #3791

Merged
merged 14 commits into from
May 5, 2023
Merged

stdcm waypoints and intermediate stops #3791

merged 14 commits into from
May 5, 2023

Conversation

eckter
Copy link
Contributor

@eckter eckter commented Apr 4, 2023

This PR is a collection of small changes that make it possible to handle intermediate steps in STDCM.

  • Adapt STDCM API to handle more than the start/end points. The API is now very close to the pathfinding API in that regard, but I didn't factorize too much because I expect more data to be added soon.
  • Edges stop at the first stop encountered (mostly handled in stdcm: only simulate edges up to the next stop #3667)
  • Edges that stopped before the end of the route can lead to other edges, starting at the same point
  • Edges/nodes keep track of how many steps have been passed

Most of the diff is in the form of new tests.

This hasn't been tested on actual infras and with front-end integration yet. I do intend to test everything before it's merged.

@eckter eckter force-pushed the ech/stdcm-waypoints branch 2 times, most recently from 548e568 to 278b12c Compare April 4, 2023 14:05
@codecov
Copy link

codecov bot commented Apr 4, 2023

Codecov Report

Merging #3791 (a7a8faf) into dev (9533d2d) will increase coverage by 0.09%.
The diff coverage is 74.56%.

@@             Coverage Diff              @@
##                dev    #3791      +/-   ##
============================================
+ Coverage     69.73%   69.82%   +0.09%     
- Complexity     2036     2073      +37     
============================================
  Files           442      443       +1     
  Lines         22567    22688     +121     
  Branches       1681     1706      +25     
============================================
+ Hits          15736    15841     +105     
- Misses         6026     6039      +13     
- Partials        805      808       +3     
Flag Coverage Δ
core 79.44% <94.35%> (+0.20%) ⬆️
front 59.33% <10.90%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../src/main/java/fr/sncf/osrd/stdcm/STDCMResult.java 100.00% <ø> (ø)
.../main/java/fr/sncf/osrd/stdcm/graph/STDCMNode.java 100.00% <ø> (ø)
...implementation/RouteAvailabilityLegacyAdapter.java 96.77% <ø> (ø)
...cessing/interfaces/RouteAvailabilityInterface.java 90.00% <ø> (ø)
front/src/common/Pathfinding/Pathfinding.tsx 34.64% <3.92%> (-0.82%) ⬇️
...ain/java/fr/sncf/osrd/utils/graph/Pathfinding.java 95.27% <80.00%> (ø)
...ava/fr/sncf/osrd/stdcm/graph/STDCMEdgeBuilder.java 93.25% <83.33%> (-0.65%) ⬇️
...main/java/fr/sncf/osrd/stdcm/graph/STDCMUtils.java 84.12% <83.33%> (-1.33%) ⬇️
.../main/java/fr/sncf/osrd/stdcm/graph/STDCMEdge.java 79.31% <88.88%> (+2.83%) ⬆️
...ava/fr/sncf/osrd/stdcm/graph/STDCMPathfinding.java 96.72% <93.54%> (-1.16%) ⬇️
... and 12 more

... and 2 files with indirect coverage changes

@eckter eckter force-pushed the ech/stdcm-waypoints branch from 278b12c to e836f2a Compare April 4, 2023 15:06
@eckter eckter force-pushed the ech/stdcm-waypoints branch 7 times, most recently from c398f3c to 5094b37 Compare April 6, 2023 09:44
@eckter eckter changed the title wip: stdcm waypoints and intermediate stops stdcm waypoints and intermediate stops Apr 6, 2023
@eckter eckter marked this pull request as ready for review April 6, 2023 12:02
@eckter eckter requested review from a team as code owners April 6, 2023 12:02
@eckter eckter force-pushed the ech/stdcm-waypoints branch 3 times, most recently from 4cb506b to 7b084ed Compare April 6, 2023 15:31
Copy link
Contributor

@flomonster flomonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API lgtm. I did some test and get a 500 running the stdcm endpoint:

{
  "type": "core:assert_error",
  "assert_message": "Assertion failed",
  "cause": "INTERNAL",
  "message": "Assertion failed",
  "stack_trace": [
    "LoadedSignalingInfra.kt:169",
    "LoadedSignalingInfra.kt:184",
    "ScheduleMetadataExtractor.kt:45",
    "StandaloneSim.java:61",
    "STDCMEndpoint.java:226",
    "STDCMEndpoint.java:114",
    "FkRegex.java:153",
    "FkRegex.java:217",
    "FkChain.java:72",
    "TkFork.java:98",
    "TkFallback.java:84",
    "TkFallback.java:66",
    "TkWrap.java:58",
    "TkSlf4j.java:110",
    "BkBasic.java:123",
    "BkBasic.java:99",
    "BkSafe.java:46",
    "BkWrap.java:51",
    "BkParallel.java:81",
    "ThreadPoolExecutor.java:1136",
    "ThreadPoolExecutor.java:635",
    "Thread.java:833"
  ],
  "trace": []
}

@eckter eckter marked this pull request as draft April 7, 2023 10:36
@eckter eckter force-pushed the ech/stdcm-waypoints branch 4 times, most recently from 72268dd to 3ba2564 Compare April 24, 2023 08:27
@eckter
Copy link
Contributor Author

eckter commented Apr 25, 2023

@flomonster the assert you had is unrelated. It's still around (#3746), but now it only happens when using routes that go from buffer stop to buffer stop, which should be very uncommon.

@eckter eckter requested review from multun and flomonster April 25, 2023 07:46
@eckter eckter marked this pull request as ready for review April 25, 2023 10:12
@eckter eckter force-pushed the ech/stdcm-waypoints branch from 3cb8b08 to f133699 Compare April 25, 2023 10:12
Copy link
Contributor

@flomonster flomonster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I tested stdcm with stops everything seems to work.

@eckter eckter mentioned this pull request Apr 28, 2023
20 tasks
@eckter eckter force-pushed the ech/stdcm-waypoints branch from f133699 to a7a8faf Compare May 4, 2023 08:24
Copy link
Contributor

@multun multun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested, LGTM

@eckter eckter merged commit f6cec6d into dev May 5, 2023
@eckter eckter deleted the ech/stdcm-waypoints branch May 5, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stcdm: amend API call to add set waypoints stdcm: waypoints management in backend
6 participants