-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Remove transit with higher cost than best on-street itinerary filter #5222
Remove transit with higher cost than best on-street itinerary filter #5222
Conversation
Softer cost limit function based filtering will sometimes preserve transit itineraries, which contain more walking than a plain walk itinerary. Therefore, apply harder filtering logic wrt. walking.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5222 +/- ##
=============================================
+ Coverage 66.27% 66.46% +0.18%
- Complexity 15171 15225 +54
=============================================
Files 1789 1787 -2
Lines 69275 69296 +21
Branches 7351 7314 -37
=============================================
+ Hits 45910 46055 +145
+ Misses 20881 20763 -118
+ Partials 2484 2478 -6
☔ View full report in Codecov by Sentry. |
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 this is a good improvement but I would like someone from Entur to take a look as they are they are the main developers/user of these filters.
New cost function is in use here: In addition to perfectly matching biking between two stations, also plain transit and citybike + transit itineraries are available. |
That URL leads to a 400 - could you please correct it? |
Link to example search above fixed. |
This branch has conflicts |
…onlyisbetterfilter-costfunc
Can you please resolve the conflicts? |
…onlyisbetterfilter-costfunc
Does this filter do two things now?
If, so the filter should be split into two filters, it should be possible to configure these things separate. An alternative is to make one filter witch is configurable with respect to matching street modes, then the same filter can be used for different cases(walk, walk+bicycle, walk+car ...). |
Right, it indeed applies two clearly different logic. I can split it if necessary. |
I think splitting it is the easiest way to solve it and also "good enough". We discussed it at todays meeting, where I tried to explain the more "generic way" to solve it, but I think it is overkill. |
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.
Some names and doc needs to be fixed
.../java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainBuilder.java
Outdated
Show resolved
Hide resolved
.../java/org/opentripplanner/routing/algorithm/filterchain/ItineraryListFilterChainBuilder.java
Outdated
Show resolved
Hide resolved
...nner/routing/algorithm/filterchain/deletionflagger/RemoveTransitIfWalkingIsBetterFilter.java
Outdated
Show resolved
Hide resolved
...main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java
Outdated
Show resolved
Hide resolved
...main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java
Outdated
Show resolved
Hide resolved
...main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java
Outdated
Show resolved
Hide resolved
...main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java
Outdated
Show resolved
Hide resolved
...main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java
Outdated
Show resolved
Hide resolved
...main/java/org/opentripplanner/routing/api/request/preference/ItineraryFilterPreferences.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/standalone/config/routerequest/ItineraryFiltersConfig.java
Outdated
Show resolved
Hide resolved
…n/ItineraryListFilterChainBuilder.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…n/deletionflagger/RemoveTransitIfWalkingIsBetterFilter.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…ce/ItineraryFilterPreferences.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…ce/ItineraryFilterPreferences.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…ce/ItineraryFilterPreferences.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…ce/ItineraryFilterPreferences.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…ce/ItineraryFilterPreferences.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…ce/ItineraryFilterPreferences.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
…st/ItineraryFiltersConfig.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
...nner/routing/algorithm/filterchain/deletionflagger/RemoveTransitIfWalkingIsBetterFilter.java
Outdated
Show resolved
Hide resolved
…n/deletionflagger/RemoveTransitIfWalkingIsBetterFilter.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
You need to format the code. |
Summary
RemoveTransitWithHigherCostThanBestOnStreetOnly filter currently removes all transit itineraries, if their cost is any higher than the best of non-transit itineraries. This is bad because a citybike itinerary can erase all equally fast transit itineraries. This is quite anti-multimodal behavior.
This PR adds a similar two parameter cost limit function as other filters which compare itineraries use.
To avoid appearance of silly more walk + transit vs. plain walk itineraries, hard limit is still applied to walk street mode.
Documentation
Updated to describe how new filtering logic works
Unit tests
Unit tests updated.