Skip to content

Extra stop priority cost in optimized transfer service#3731

Merged
t2gran merged 7 commits into
opentripplanner:dev-2.xfrom
entur:otp2_stop_priority_optimized_transfer
Nov 30, 2021
Merged

Extra stop priority cost in optimized transfer service#3731
t2gran merged 7 commits into
opentripplanner:dev-2.xfrom
entur:otp2_stop_priority_optimized_transfer

Conversation

@t2gran

@t2gran t2gran commented Nov 9, 2021

Copy link
Copy Markdown
Member

Summary

This adds an extra board- and alight-cost for (none) prioritized stops. A 'stopBoardAlightCosts' is added to the generalized-cost during routing. But, this cost cannot be too high, because that would add extra cost to the transfer, and favor other alternative paths. But, when optimizing transfers, we do not have to take other paths into consideration and can "boost" the stop-priority-cost to allow transfers to take place at a preferred stop.

Issue

closes #3644

Unit tests

Code style

Documentation

This adds an extra board- and alight-cost for (none) prioritized stops. A 'stopBoardAlightCosts'
is added to the generalized-cost during routing. But,this cost cannot be too high, because that would
add extra cost to the transfer, and favor other alternative paths. But, when optimizing transfers,
we do not have to take other paths into consideration and can "boost" the stop-priority-cost to
allow transfers to take place at a preferred stop.
@t2gran t2gran added !Improvement A functional improvement or micro feature Entur On Entur Roadmap Entur Test This is currently being tested at Entur +NeTEx This issue is related to the Netex model/import. labels Nov 9, 2021
@t2gran t2gran added this to the 2.1 milestone Nov 9, 2021
@t2gran
t2gran marked this pull request as ready for review November 17, 2021 11:24
@t2gran
t2gran requested a review from a team as a code owner November 17, 2021 11:24
hannesj
hannesj previously approved these changes Nov 23, 2021

@hannesj hannesj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor nits

"transferPriorityCost": 33,
"transitTimeSeconds": 953,
"waitTimeOptimizedCost": 18,
"waitTimeOptimizedCost": -229,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it ok that this is negative

@t2gran t2gran Nov 23, 2021

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The waitTimeOptimizedCost can be negative, in-fact when there is a constrained transfer(priority, guaranteed, stay-seated), it has a negative cost, but there are also other situation that this can become negative. It can be confusing, especially since the generalized-cost is strictly positive, but there is really no good way to make it positive, except shifting the scale by a ridicules high number. I did consider this, but it is also difficult to reason about when the zero point is shifted.

Comment thread docs/Configuration.md Outdated
Co-authored-by: Hannes Junnila <hannes.junnila@gmail.com>
@t2gran
t2gran merged commit a90044d into opentripplanner:dev-2.x Nov 30, 2021
t2gran pushed a commit that referenced this pull request Nov 30, 2021
@t2gran
t2gran deleted the otp2_stop_priority_optimized_transfer branch November 30, 2022 18:05
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 Entur On Entur Roadmap !Improvement A functional improvement or micro feature +NeTEx This issue is related to the Netex model/import.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interchange not in main stations - examples

3 participants