-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add generalizedCostMaxLimit
field to the PageCursor
to enable using RemoveTransitIfStreetOnlyIsBetter
filter with paging
#6474
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 generalizedCostMaxLimit
field to the PageCursor
to enable using RemoveTransitIfStreetOnlyIsBetter
filter with paging
#6474
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6474 +/- ##
=============================================
+ Coverage 70.25% 71.26% +1.01%
- Complexity 18385 18486 +101
=============================================
Files 2088 2031 -57
Lines 77417 76396 -1021
Branches 7840 7807 -33
=============================================
+ Hits 54386 54445 +59
+ Misses 20262 19190 -1072
+ Partials 2769 2761 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I removed the direct mode search with paging and refactored |
bestStreetOnlyCost
field to the PageCursor
to enable using RemoveTransitIfStreetOnlyIsBetter
filter with pagingstreetOnlyCost
field to the PageCursor
to enable using RemoveTransitIfStreetOnlyIsBetter
filter with paging
...ation/src/main/java/org/opentripplanner/model/plan/paging/cursor/DefaultPageCursorInput.java
Outdated
Show resolved
Hide resolved
...ation/src/main/java/org/opentripplanner/model/plan/paging/cursor/DefaultPageCursorInput.java
Outdated
Show resolved
Hide resolved
...ation/src/main/java/org/opentripplanner/model/plan/paging/cursor/DefaultPageCursorInput.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactory.java
Outdated
Show resolved
Hide resolved
...planner/routing/algorithm/filterchain/filters/transit/RemoveTransitIfStreetOnlyIsBetter.java
Outdated
Show resolved
Hide resolved
...planner/routing/algorithm/filterchain/filters/transit/RemoveTransitIfStreetOnlyIsBetter.java
Outdated
Show resolved
Hide resolved
...main/java/org/opentripplanner/routing/algorithm/mapping/RouteRequestToFilterChainMapper.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/routing/algorithm/RoutingWorker.java
Outdated
Show resolved
Hide resolved
...ner/routing/algorithm/filterchain/filters/transit/RemoveTransitIfStreetOnlyIsBetterTest.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/routing/algorithm/RoutingWorker.java
Outdated
Show resolved
Hide resolved
…ror with case that should not happen.
streetOnlyCost
field to the PageCursor
to enable using RemoveTransitIfStreetOnlyIsBetter
filter with paginggeneralizedCostMaxLimit
field to the PageCursor
to enable using RemoveTransitIfStreetOnlyIsBetter
filter with paging
…into paging-filtering-fix
...entripplanner/routing/algorithm/raptoradapter/router/FilterTransitWhenDirectModeIsEmpty.java
Outdated
Show resolved
Hide resolved
...cation/src/test/java/org/opentripplanner/model/plan/paging/cursor/PageCursorFactoryTest.java
Outdated
Show resolved
Hide resolved
...opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterResult.java
Outdated
Show resolved
Hide resolved
...opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterResult.java
Outdated
Show resolved
Hide resolved
...opentripplanner/routing/algorithm/filterchain/filters/system/NumItinerariesFilterResult.java
Outdated
Show resolved
Hide resolved
...planner/routing/algorithm/filterchain/filters/transit/RemoveTransitIfStreetOnlyIsBetter.java
Show resolved
Hide resolved
...entripplanner/routing/algorithm/raptoradapter/router/FilterTransitWhenDirectModeIsEmpty.java
Outdated
Show resolved
Hide resolved
...entripplanner/routing/algorithm/raptoradapter/router/FilterTransitWhenDirectModeIsEmpty.java
Show resolved
Hide resolved
application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorInput.java
Outdated
Show resolved
Hide resolved
|
||
/** | ||
* The latest removed departure together with a search window duration is used to | ||
* calculate the start of the search window preceding the current window. | ||
*/ | ||
Instant latestRemovedDeparture(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document whether this is the arrival or departure time of the latest removed departure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think because the name has departure in it, it is clear enough, is that ok? The word "arrival" (or an abbreviation) is usually included in variables that deal with arrival times, for example in PageCursorFactory
the variable lat
(latest arrival time)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latestRemovedDepartureTime would be slightly more explicit as departure is sometimes a synonym to trip and a trip can be identified by an arrival time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there was a comment here from Thomas that agreed with me, but has now disappeared. Is keeping the name the same ok for you @optionsome
application/src/main/java/org/opentripplanner/model/plan/paging/cursor/PageCursorInput.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs structural changes - I will complete my review when these are done. I have not yet looked at the details.
import org.opentripplanner.model.plan.ItinerarySortKey; | ||
import org.opentripplanner.model.plan.SortOrder; | ||
import org.opentripplanner.routing.algorithm.filterchain.paging.DefaultPageCursorInput; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still have a dependency to filterchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this and modified logic related to null checking in the PageCursorFactory
and PagingService
. I noticed that the assertRequestPrerequisites
function in PagingService
is useless because of a preceding check. Should I remove it?
application/src/main/java/org/opentripplanner/routing/algorithm/RoutingWorker.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChain.java
Outdated
Show resolved
Hide resolved
…hange logic related to null checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good now all the architecture comments I had is resolved. There is just a few minor things. When these are fixed I can approve.
Summary
This PR adds the
generalizedCostMaxLimit
field to thePageCursor
. This enables using theRemoveTransitIfStreetOnlyIsBetter
filter with paging. Before this PR, this was not possible because paging only used the walk mode to create a direct itinerary which made the filter work incorrectly.Issue
N/A
Unit tests
Changed existing unit tests for compatibility and created new ones. Also performed manual testing.
Documentation
Code comments, no other documentation