Extra stop priority cost in optimized transfer service#3731
Merged
t2gran merged 7 commits intoNov 30, 2021
Conversation
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
marked this pull request as ready for review
November 17, 2021 11:24
hannesj
previously approved these changes
Nov 23, 2021
| "transferPriorityCost": 33, | ||
| "transitTimeSeconds": 953, | ||
| "waitTimeOptimizedCost": 18, | ||
| "waitTimeOptimizedCost": -229, |
Contributor
There was a problem hiding this comment.
Is it ok that this is negative
Member
Author
There was a problem hiding this comment.
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.
Co-authored-by: Hannes Junnila <hannes.junnila@gmail.com>
hannesj
approved these changes
Nov 23, 2021
leonardehrenfried
approved these changes
Nov 30, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
✅