Skip to content

Account for boarding restrictions when calculating direct transfers - #4421

Merged
hannesj merged 2 commits into
opentripplanner:dev-2.xfrom
realCity:feature/direct-transfer
Sep 1, 2022
Merged

Account for boarding restrictions when calculating direct transfers#4421
hannesj merged 2 commits into
opentripplanner:dev-2.xfrom
realCity:feature/direct-transfer

Conversation

@flaktack

Copy link
Copy Markdown
Contributor

Summary

When calculating transfers between stops the list of transfers is pruned so that only the best option is kept for each pattern. In some cases it may be impossible to transfer to a pattern because the pruning doesn't take into account if a pattern may be boarded at the best stop, thereby removing worse stops where boarding would have been possible.

  1. A new OTPFeature.ConsiderPatternsForDirectTransfers is added to allow disabling the pruning.
  2. The pruning is extended to take into account boarding restrictions.

Issue

#4040

Unit tests

Existing unit tests are extended.

Documentation

Configuration.md is extended with the new OTPFeature: ConsiderPatternsForDirectTransfers.

@flaktack flaktack added the !Bug Apply to issues describing a bug and PRs witch fixes it. label Aug 29, 2022
@flaktack flaktack added this to the 2.2 milestone Aug 29, 2022
@flaktack
flaktack requested a review from a team as a code owner August 29, 2022 10:12
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #4421 (53bf4f2) into dev-2.x (ae10043) will increase coverage by 0.01%.
The diff coverage is 75.00%.

@@              Coverage Diff              @@
##             dev-2.x    #4421      +/-   ##
=============================================
+ Coverage      58.09%   58.11%   +0.01%     
- Complexity     11070    11076       +6     
=============================================
  Files           1454     1454              
  Lines          58760    58771      +11     
  Branches        6771     6773       +2     
=============================================
+ Hits           34138    34154      +16     
+ Misses         22586    22579       -7     
- Partials        2036     2038       +2     
Impacted Files Coverage Δ
.../graph_builder/module/DirectTransferGenerator.java 84.61% <60.00%> (-2.06%) ⬇️
...planner/graph_builder/module/NearbyStopFinder.java 87.00% <83.33%> (-0.76%) ⬇️
...main/java/org/opentripplanner/util/OTPFeature.java 85.45% <100.00%> (+0.26%) ⬆️
...ph_builder/module/ned/MissingElevationHandler.java 93.70% <0.00%> (-1.58%) ⬇️
...planner/transit/raptor/api/debug/RaptorTimers.java 100.00% <0.00%> (ø)
...er/transit/raptor/service/HeuristicSearchTask.java 72.72% <0.00%> (+0.50%) ⬆️
...lanner/routing/vehicle_parking/VehicleParking.java 82.70% <0.00%> (+0.75%) ⬆️
...pplanner/graph_builder/module/osm/OSMDatabase.java 77.37% <0.00%> (+0.95%) ⬆️
...tripplanner/transit/model/network/StopPattern.java 80.80% <0.00%> (+1.01%) ⬆️
...router/performance/PerformanceTimersForRaptor.java 85.00% <0.00%> (+2.64%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@leonardehrenfried

Copy link
Copy Markdown
Member

I think this is a good change and makes the results more correct. I'm inclined to say that this should be the default. Have you actually found a place in your data where this matters though?

If a pattern is not boardable at the nearest stop then valid transfers
at further stops would be dropped.
@flaktack
flaktack force-pushed the feature/direct-transfer branch from 53bf4f2 to 1c9d5b9 Compare August 30, 2022 07:08
@flaktack

Copy link
Copy Markdown
Contributor Author

I've updated the code to work with reverseDirection searches.

I think this is a good change and makes the results more correct. I'm inclined to say that this should be the default. Have you actually found a place in your data where this matters though?

Yes -- the purpose of the ConsiderPatternsForDirectTransfers feature is to make it easier to disable the optimization if it is suspected of causing problems.

@hannesj
hannesj merged commit 00e710e into opentripplanner:dev-2.x Sep 1, 2022
t2gran pushed a commit that referenced this pull request Sep 1, 2022
@flaktack
flaktack deleted the feature/direct-transfer branch November 22, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants