-
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
Convert transferSlack configuration to duration #5897
Merged
leonardehrenfried
merged 23 commits into
opentripplanner:dev-2.x
from
ibi-group:transferslack
Jul 5, 2024
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
c3c298e
Add test for transferSlack parsing
leonardehrenfried 208a6fe
Convert tranferSlack to duration or int
leonardehrenfried 5f46bea
Also set slack in APIs
leonardehrenfried e99b562
Fix mapping in API layer
leonardehrenfried 5874b94
Add minTransferTime to integration test
leonardehrenfried 60f407e
Add Javadoc
leonardehrenfried e5ea70d
Update and clarify documentation on board, alight and transfer slack
leonardehrenfried 535546f
Update documentation
leonardehrenfried 242f8bc
Merge remote-tracking branch 'upstream/dev-2.x' into transferslack
leonardehrenfried 0784c7a
Fix code after rebase
leonardehrenfried 409041e
Fix typo
leonardehrenfried 9004bad
Fix small grammaer and punctuation errors
leonardehrenfried 6213bb1
Apply suggestions from code review
leonardehrenfried 22b5d36
Regenerate documentation
leonardehrenfried 657e625
Apply review suggestions
leonardehrenfried 4fac03c
Update src/main/java/org/opentripplanner/standalone/config/routereque…
leonardehrenfried 8fc0d9f
Update compiled documentation
leonardehrenfried c321509
Update slack docs
leonardehrenfried 98d28ee
Merge remote-tracking branch 'upstream/dev-2.x' into transferslack
leonardehrenfried ac2cb37
Re-apply update
leonardehrenfried 6478829
Apply suggestions from code review
leonardehrenfried 9ee2076
Update slack documentation
leonardehrenfried 468bb83
Add Javadoc
leonardehrenfried File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,9 @@ and in the [transferRequests in build-config.json](BuildConfiguration.md#transfe | |
|
||
| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since | | ||
|--------------------------------------------------------------------------------------------------------------|:----------------------:|------------------------------------------------------------------------------------------------------------------------------------------------|:----------:|------------------|:-----:| | ||
| [alightSlack](#rd_alightSlack) | `duration` | The minimum extra time after exiting a public transport vehicle. | *Optional* | `"PT0S"` | 2.0 | | ||
| [alightSlack](#rd_alightSlack) | `duration` | The time safety margin when alighting from a vehicle. | *Optional* | `"PT0S"` | 2.0 | | ||
| arriveBy | `boolean` | Whether the trip should depart or arrive at the specified date and time. | *Optional* | `false` | 2.0 | | ||
| [boardSlack](#rd_boardSlack) | `duration` | The boardSlack is the minimum extra time to board a public transport vehicle. | *Optional* | `"PT0S"` | 2.0 | | ||
| [boardSlack](#rd_boardSlack) | `duration` | The time safety margin when boarding a vehicle. | *Optional* | `"PT0S"` | 2.0 | | ||
| [drivingDirection](#rd_drivingDirection) | `enum` | The driving direction to use in the intersection traversal calculation | *Optional* | `"right"` | 2.2 | | ||
| elevatorBoardCost | `integer` | What is the cost of boarding a elevator? | *Optional* | `90` | 2.0 | | ||
| elevatorBoardTime | `integer` | How long does it take to get on an elevator, on average. | *Optional* | `90` | 2.0 | | ||
|
@@ -38,7 +38,7 @@ and in the [transferRequests in build-config.json](BuildConfiguration.md#transfe | |
| [searchWindow](#rd_searchWindow) | `duration` | The duration of the search-window. | *Optional* | | 2.0 | | ||
| [streetRoutingTimeout](#rd_streetRoutingTimeout) | `duration` | The maximum time a street routing request is allowed to take before returning the results. | *Optional* | `"PT5S"` | 2.2 | | ||
| [transferPenalty](#rd_transferPenalty) | `integer` | An additional penalty added to boardings after the first. | *Optional* | `0` | 2.0 | | ||
| [transferSlack](#rd_transferSlack) | `integer` | The extra time needed to make a safe transfer in seconds. | *Optional* | `120` | 2.0 | | ||
| [transferSlack](#rd_transferSlack) | `duration` | The extra time needed to make a safe transfer. | *Optional* | `"PT2M"` | 2.0 | | ||
| turnReluctance | `double` | Multiplicative factor on expected turning time. | *Optional* | `1.0` | 2.0 | | ||
| [unpreferredCost](#rd_unpreferredCost) | `cost-linear-function` | A cost function used to calculate penalty for an unpreferred route. | *Optional* | `"0s + 1.00 t"` | 2.2 | | ||
| waitReluctance | `double` | How much worse is waiting for a transit vehicle than being on a transit vehicle, as a multiplier. | *Optional* | `1.0` | 2.0 | | ||
|
@@ -192,22 +192,34 @@ and in the [transferRequests in build-config.json](BuildConfiguration.md#transfe | |
**Since version:** `2.0` ∙ **Type:** `duration` ∙ **Cardinality:** `Optional` ∙ **Default value:** `"PT0S"` | ||
**Path:** /routingDefaults | ||
|
||
The minimum extra time after exiting a public transport vehicle. | ||
The time safety margin when alighting from a vehicle. | ||
|
||
This time slack is added to arrival time of the vehicle before any transfer or onward travel. | ||
|
||
The sole reason for this is to avoid missed connections when there are minor schedule variations. This | ||
parameter is intended to be set by agencies not individual users. In general it is better to use | ||
`boardSlack` - see its documentation for details. However, for specific modes, like airplane and | ||
subway, that need more time than others, this is also configurable per mode with `alightSlackForMode`. | ||
|
||
The slack is added to the time when going from the transit vehicle to the stop. | ||
|
||
<h3 id="rd_boardSlack">boardSlack</h3> | ||
|
||
**Since version:** `2.0` ∙ **Type:** `duration` ∙ **Cardinality:** `Optional` ∙ **Default value:** `"PT0S"` | ||
**Path:** /routingDefaults | ||
|
||
The boardSlack is the minimum extra time to board a public transport vehicle. | ||
The time safety margin when boarding a vehicle. | ||
|
||
The board time is added to the time when going from the stop (offboard) to onboard a transit | ||
vehicle. | ||
The board slack is added to the passenger's arrival time at a stop before boarding evaluating which | ||
vehicles can be boarded. | ||
|
||
This is the same as the `transferSlack`, except that this also applies to to the first | ||
transit leg in the trip. This is the default value used, if not overridden by the `boardSlackList`. | ||
The sole reason for this is to avoid missed connections when there are minor schedule variations. This | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, connection to me refers more to a transfer than potentially the only boarding but I'm not a native speaker. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, however please see above. |
||
parameter is intended to be set by agencies not individual users. For specific modes, like airplane and | ||
subway, that need more time than others, this is also configurable per mode with `boardSlackForMode`. | ||
|
||
Agencies can use this parameter to ensure that the trip planner does not instruct passengers to arrive | ||
at the last second. | ||
This slack is added at every boarding including the first vehicle and transfers except for in-seat | ||
transfers and guaranteed transfers. | ||
|
||
|
||
<h3 id="rd_drivingDirection">drivingDirection</h3> | ||
|
@@ -351,15 +363,17 @@ significant time or walking will still be taken. | |
|
||
<h3 id="rd_transferSlack">transferSlack</h3> | ||
|
||
**Since version:** `2.0` ∙ **Type:** `integer` ∙ **Cardinality:** `Optional` ∙ **Default value:** `120` | ||
**Since version:** `2.0` ∙ **Type:** `duration` ∙ **Cardinality:** `Optional` ∙ **Default value:** `"PT2M"` | ||
**Path:** /routingDefaults | ||
|
||
The extra time needed to make a safe transfer in seconds. | ||
The extra time needed to make a safe transfer. | ||
|
||
The extra buffer time/safety margin added to transfers to make sure the connection is safe, time | ||
wise. We recommend allowing the end-user to set this, and use `board-/alight-slack` to enforce | ||
agency policies. This time is in addition to how long it might take to walk, board and alight. | ||
|
||
An expected transfer time in seconds that specifies the amount of time that must pass | ||
between exiting one public transport vehicle and boarding another. This time is in | ||
addition to time it might take to walk between stops plus `boardSlack` and | ||
`alightSlack`. | ||
It is useful for passengers on long distance travel, and people with mobility issues, but can be set | ||
close to zero for everyday commuters and short distance searches in high transit frequency areas. | ||
|
||
|
||
<h3 id="rd_unpreferredCost">unpreferredCost</h3> | ||
|
@@ -1181,7 +1195,7 @@ include stairs as a last result. | |
}, | ||
"waitReluctance" : 1.0, | ||
"otherThanPreferredRoutesPenalty" : 300, | ||
"transferSlack" : 120, | ||
"transferSlack" : "2m", | ||
"boardSlackForMode" : { | ||
"AIRPLANE" : "35m" | ||
}, | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
6 changes: 2 additions & 4 deletions
6
...va/org/opentripplanner/apis/transmodel/mapping/preferences/TransferPreferencesMapper.java
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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 wasn't properly concentrating today during the developer meeting discussion, but isn't this the description of transferSlack, not alightSlack? I thought alightSlack was mostly meant just for random procedures you have to do after you alight from a vehicle like with airplanes. Although, this is the generic one and I'm not even completely sure what this is for. Maybe if you are traveling on wheelchair this could be useful you if you need assistance or if the vehicles are crowded and getting off a vehicle takes time.
Referring to connection feels a bit weird. This feels more like a safety margin that you get to the destination in 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 agree with you a wrote something to that effect previously but @abyrd and @t2gran dictated this to me word for word.
I'm feeling that I should just revert the change to the documentation and we pick that up later.
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.
It's possible that I misinterpreted the purpose of the different parameters. I tried to verify with everyone that any strong statements were accurate. I'm happy to rewrite it if it's incorrect.
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.
To me the description is good. The following sentence could be better:
It should emphasise "minor schedule variations". Note! It is probably a better simulation of real life to have 20s boardSlack and 10s alightSlack, than 30s/0s. But, due to technical difficulties in presenting this to the end user, most deployments uses just boardSlack. I do not recommend using this for user-specific needs like wheelchair.
We can refrase to, if less confusing: