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

editoast: infra/{id}/pathfinding starts in both directions #5904

Merged
merged 5 commits into from
Dec 5, 2023
Merged

Conversation

Tristramg
Copy link
Contributor

Closes #5543

  • The first commit searches in both directions and fixes the functional aspects
  • The second commit adds a bound to avoid searching routes for too long (this endpoint searches k-shortest path, and the second shortest could be significantly longer)
  • The last commit is removing the parameter

@Tristramg Tristramg requested review from a team as code owners November 29, 2023 09:46
Copy link

codecov bot commented Nov 29, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (69d6902) 25.74% compared to head (d06fb09) 25.80%.

Files Patch % Lines
...or/tools/routeEdition/components/EditRoutePath.tsx 0.00% 5 Missing ⚠️
...editor/tools/routeEdition/components/Endpoints.tsx 0.00% 2 Missing and 1 partial ⚠️
editoast/src/views/infra/pathfinding.rs 98.98% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #5904      +/-   ##
============================================
+ Coverage     25.74%   25.80%   +0.06%     
  Complexity     2117     2117              
============================================
  Files           926      926              
  Lines        122479   122526      +47     
  Branches       2665     2665              
============================================
+ Hits          31534    31620      +86     
+ Misses        89372    89333      -39     
  Partials       1573     1573              
Flag Coverage Δ
core 79.01% <ø> (ø)
editoast 73.96% <99.09%> (+0.11%) ⬆️
front 8.43% <11.11%> (+<0.01%) ⬆️
gateway 2.75% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

We have a 400 error.

{
  "status": 400,
  "type": "editoast:JsonError",
  "context": {
    "cause": "Json deserialize error: unknown field `direction`, expected `track` or `position` at line 1 column 84"
  },
  "message": "Json deserialize error: unknown field `direction`, expected `track` or `position` at line 1 column 84"
}

editoast/src/views/infra/pathfinding.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Lgtm for the front part :)

Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Actually front looks good but got the same error as @flomonster when trying to search for routes

Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Ok my bad, after rebuilding editoast, its seems ok :)

image

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.

I still have a problem, some valid existing routes can't be recomputed.
I've checked that this isn't due to the geographical max distance.

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

editoast computes k-shortest path. When we are along a simple line,
the next shortest path can be significant longer than the initial solution.
This commit limits any subsequent path to be at most twice as long as the best solution.

From an implementation point of view, we need to track the total length at each step.
This is a bit cumbersome, but we can’t access with the pathfinding crate to cost data.
@multun multun added this pull request to the merge queue Dec 5, 2023
Merged via the queue into dev with commit cd1c7fe Dec 5, 2023
17 checks passed
@multun multun deleted the bug_5543 branch December 5, 2023 12:12
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.

Infinite computing when creating new route
6 participants