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

Transit group priority - part 2 #5524

Merged
merged 14 commits into from
Dec 18, 2023

Conversation

t2gran
Copy link
Member

@t2gran t2gran commented Nov 22, 2023

Summary

Transit group priority enable routing search where the transit services can be grouped and given mutual priority over other groups. By "mutual priority" we mean that both groups are is prioritised and end up in the result. A relax function is used to say how much worse a group may be before it is dropped. Within the group, only the best options are kept.

Issue

This build on top of PR #4999
Fixes most of #3665

Todo

  • Make sure all new classes have unit-tests.
  • Fix issue reluctanceForMode uses route mode, not Trip/pattern #5248
  • Copy and log c2 values to Path, PathLeg and Itinerary+Leg for better debugging.
  • Heuristics - this is needed by both pass-through and this.
  • Cleanup - filtering, make this filters API POJOs not Filters. This will allow us to reuse it in the API and apply it more than one place.

Documentation

TODO

  • Write documentation for this feature

@t2gran t2gran added New Feature bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR Skip Changelog labels Nov 22, 2023
@t2gran t2gran added this to the 2.5 (next release) milestone Nov 22, 2023
@t2gran t2gran requested a review from a team as a code owner November 22, 2023 12:42
@t2gran t2gran marked this pull request as draft November 22, 2023 12:43
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

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

Comparison is base (00db8f4) 67.24% compared to head (5c9732c) 67.35%.
Report is 86 commits behind head on dev-2.x.

Files Patch % Lines
...n/deletionflagger/NumItinerariesFilterResults.java 30.00% 7 Missing ⚠️
...anner/framework/text/CharacterEscapeFormatter.java 82.85% 5 Missing and 1 partial ⚠️
...m/filterchain/ItineraryListFilterChainBuilder.java 79.16% 4 Missing and 1 partial ⚠️
...oradapter/transit/mappers/RaptorRequestMapper.java 0.00% 5 Missing ⚠️
...ntripplanner/routing/api/request/RouteRequest.java 0.00% 4 Missing and 1 partial ⚠️
.../opentripplanner/service/paging/PagingService.java 93.24% 2 Missing and 3 partials ⚠️
...er/model/plan/paging/cursor/PageCursorFactory.java 85.00% 2 Missing and 1 partial ⚠️
.../transferoptimization/model/OptimizedPathTail.java 75.00% 1 Missing and 2 partials ⚠️
...n/java/org/opentripplanner/framework/lang/Box.java 88.23% 0 Missing and 2 partials ⚠️
...model/plan/paging/cursor/PageCursorSerializer.java 96.22% 1 Missing and 1 partial ⚠️
... and 13 more
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5524      +/-   ##
=============================================
+ Coverage      67.24%   67.35%   +0.11%     
- Complexity     16087    16164      +77     
=============================================
  Files           1852     1858       +6     
  Lines          70980    71093     +113     
  Branches        7404     7403       -1     
=============================================
+ Hits           47733    47888     +155     
+ Misses         20779    20746      -33     
+ Partials        2468     2459       -9     

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

Signed-off-by: Thomas Gran <t2gran@gmail.com>
Signed-off-by: Thomas Gran <t2gran@gmail.com>
All patterns not matching a group is assigned to the base group(id=0).
Signed-off-by: Thomas Gran <t2gran@gmail.com>
Signed-off-by: Thomas Gran <t2gran@gmail.com>
Signed-off-by: Thomas Gran <t2gran@gmail.com>
Signed-off-by: Thomas Gran <t2gran@gmail.com>
@t2gran t2gran force-pushed the otp_transit_priority_part_2 branch 2 times, most recently from cd1f8bd to e2913f0 Compare December 12, 2023 17:23
We use the term generalizedCost in OTP, but not in Raptor. With the new c2 value, renaming
to c1 inside Raptor make the raptor code more consistent. It also becomes easier to keep
raptor cost apart from the OTP model cost - they are slightly different and the context
is important.
@t2gran t2gran marked this pull request as ready for review December 13, 2023 17:22
@jtorin jtorin self-requested a review December 14, 2023 12:38
@leonardehrenfried
Copy link
Member

Please resolve the conflicts.

Copy link
Contributor

Choose a reason for hiding this comment

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

I really like that this PR differentiaties between c1 and generalizedCost, it makes it easier to see whether you are looking at a raptor cost or a street routing cost.

I've just got a few minor nitpicks and some questions for my own understanding.

Co-authored-by: Henrik Abrahamsson <127481124+habrahamsson-skanetrafiken@users.noreply.github.com>
@jtorin
Copy link
Contributor

jtorin commented Dec 15, 2023

Just some spelling and grammar fixes.

I agree with @habrahamsson-skanetrafiken, the separation of naming between the domains is nice!

t2gran and others added 2 commits December 17, 2023 23:06
Co-authored-by: Johan Torin <jtorin@users.noreply.github.com>
@t2gran t2gran merged commit 5adb29f into opentripplanner:dev-2.x Dec 18, 2023
5 checks passed
@t2gran t2gran deleted the otp_transit_priority_part_2 branch December 18, 2023 15:17
t2gran pushed a commit that referenced this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR New Feature Skip Changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants