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

core: fix allowance space search discontinuities #5399

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

eckter
Copy link
Contributor

@eckter eckter commented Oct 19, 2023

Couple of coasting problems for Mareco allowances, creating discontinuities in the search space for a solution validating said allowance.
First discontinuity was due to coastFromBeginning not starting at the startSpeed found when coastFromEnd never reaches the envelope. The solutions would then always fluctuate between braking=>coasting and coasting=>braking, but never with any solution in the middle.
Second discontinuity was due to EnvelopePart not always having an EnvelopeProfile attribute, in this case, the Braking one: coasting opportunities were not found because of that (braking opportunities are found by firstly checking if said EnvelopePart has a Braking attribute). It is now compulsory.

Comparison between doubles played a small part in this: a PR will be arriving to use areSpeedsEqual everywhere (as long as I find all the comparisons).

@Erashin Erashin force-pushed the ech/reproduce-search-space-discontinuity branch from 933e3fa to 40070b8 Compare November 13, 2023 16:39
@Erashin Erashin linked an issue Nov 13, 2023 that may be closed by this pull request
@Erashin Erashin added the area:core Work on Core Service label Nov 13, 2023
@Erashin Erashin changed the title tests: reproduce allowance search space discontinuity in regression test core: remove coastFromBeginning to avoid space search discontinuities during mareco allowance calculations Nov 13, 2023
@Erashin Erashin changed the title core: remove coastFromBeginning to avoid space search discontinuities during mareco allowance calculations core: rfix space search discontinuities Nov 15, 2023
@Erashin Erashin changed the title core: rfix space search discontinuities core: fix space search discontinuities Nov 15, 2023
@Erashin Erashin force-pushed the ech/reproduce-search-space-discontinuity branch 5 times, most recently from f1890d7 to ce36774 Compare November 17, 2023 08:34
@Erashin Erashin force-pushed the ech/reproduce-search-space-discontinuity branch from ce36774 to a2a3f4b Compare November 17, 2023 08:37
@Erashin Erashin changed the title core: fix space search discontinuities core: fix allowance space search discontinuities Nov 17, 2023
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

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

Comparison is base (1514947) 19.58% compared to head (0d8bdbc) 19.58%.
Report is 8 commits behind head on dev.

Files Patch % Lines
.../envelope/part/constraints/EnvelopeConstraint.java 0.00% 1 Missing and 2 partials ⚠️
.../java/fr/sncf/osrd/envelope/part/EnvelopePart.java 0.00% 0 Missing and 1 partial ⚠️
..._sim/allowances/mareco_impl/CoastingGenerator.java 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##                dev    #5399   +/-   ##
=========================================
  Coverage     19.58%   19.58%           
- Complexity     2326     2327    +1     
=========================================
  Files           886      886           
  Lines        106098   106105    +7     
  Branches       2576     2576           
=========================================
+ Hits          20777    20780    +3     
- Misses        83812    83813    +1     
- Partials       1509     1512    +3     
Flag Coverage Δ
core 78.71% <70.58%> (-0.03%) ⬇️

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.

@Erashin Erashin marked this pull request as ready for review November 17, 2023 08:50
@Erashin Erashin requested review from a team as code owners November 17, 2023 08:50
@Erashin Erashin requested a review from multun November 17, 2023 08:50
Copy link
Contributor Author

@eckter eckter left a comment

Choose a reason for hiding this comment

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

"PR authors can't approve their own PR", but LGTM (once the other discussion is resolved)

Good job for figuring this out

@Erashin Erashin force-pushed the ech/reproduce-search-space-discontinuity branch from a2a3f4b to 0d8bdbc Compare November 17, 2023 11:01
@Erashin Erashin requested a review from multun November 17, 2023 11:02
Copy link
Contributor

@axrolld axrolld left a comment

Choose a reason for hiding this comment

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

Also kind of a co-author of this PR but i agree with the changes ! Great job and perseverance ! 💪

@multun multun added this pull request to the merge queue Nov 20, 2023
Merged via the queue into dev with commit 61a0ebd Nov 20, 2023
5 of 6 checks passed
@multun multun deleted the ech/reproduce-search-space-discontinuity branch November 20, 2023 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core Work on Core Service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

core: mareco: search space discontinuity happen in rare cases
4 participants