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

Add group priority to direct search #5945

Merged

Conversation

t2gran
Copy link
Member

@t2gran t2gran commented Jul 4, 2024

Summary

The transit-group-priority feature calculate a c2 value. This is currently only done in the Raptor search, not in the AStar street search. We need this in the itinerary filters to make a fare comparison. Most street-only itineraries should just have the baseGroup applied, but FLEX should have the value calculated based on the FLEX trip.

This PR changes the transit-group-priority service so it can be used to apply the c2 value on any itinerary. The value is added, in not present, right before the itinerary filtering is performed.

Issue

This is a prerequisite for #5919

Unit tests

✅ This is mostly refactoring the code so it can be used in the RoutingWorker in addition to Rator. So there is very little new business logic.

Documentation

✅ JavaDoc is updated

Changelog

🟥 This is improving a feature developed in this release.

Bumping the serialization version id

🟥 There should no be any changes to the serialized graph.

@t2gran t2gran added Improvement A functional improvement Entur Test This is currently being tested at Entur Skip Changelog labels Jul 4, 2024
@t2gran t2gran added this to the 2.6 (next release) milestone Jul 4, 2024
@t2gran t2gran requested a review from a team as a code owner July 4, 2024 08:11
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

Attention: Patch coverage is 85.20710% with 25 lines in your changes missing coverage. Please review.

Project coverage is 69.46%. Comparing base (2a5c8be) to head (364d33e).
Report is 9 commits behind head on dev-2.x.

Files Patch % Lines
...iority/TransitGroupPriorityItineraryDecorator.java 26.31% 13 Missing and 1 partial ⚠️
...ork/grouppriority/TransitGroupPriorityService.java 92.00% 3 Missing and 1 partial ⚠️
...xt/reportapi/model/TransitGroupPriorityReport.java 0.00% 2 Missing ⚠️
...network/grouppriority/TransitGroupPriority32n.java 0.00% 2 Missing ⚠️
...java/org/opentripplanner/model/plan/Itinerary.java 97.77% 0 Missing and 1 partial ⚠️
...oradapter/transit/mappers/RaptorRequestMapper.java 0.00% 1 Missing ⚠️
.../transit/model/network/grouppriority/Matchers.java 95.45% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5945      +/-   ##
=============================================
+ Coverage      69.45%   69.46%   +0.01%     
- Complexity     17070    17090      +20     
=============================================
  Files           1937     1942       +5     
  Lines          73692    73749      +57     
  Branches        7540     7548       +8     
=============================================
+ Hits           51184    51232      +48     
- Misses         19880    19889       +9     
  Partials        2628     2628              

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

@leonardehrenfried leonardehrenfried changed the title Otp2 add group priority to direct search Add group priority to direct search Jul 4, 2024
t2gran added a commit to entur/OpenTripPlanner-LegacyHSLFork that referenced this pull request Jul 4, 2024
Copy link
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

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

I only found a tiny spelling mistake. Otherwise this is - as always - very clean.

…riority/EntityAdapter.java

Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
@t2gran t2gran merged commit 896805d into opentripplanner:dev-2.x Jul 23, 2024
5 checks passed
@t2gran t2gran deleted the otp2_add_group_priority_to_direct_search branch July 23, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Entur Test This is currently being tested at Entur Improvement A functional improvement Skip Changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants