-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add ability to start a Raptor search from on-board a trip in MC range raptor #7241
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
base: dev-2.x
Are you sure you want to change the base?
Changes from all commits
b185eba
01e20d4
225424c
c4d0ade
3d8648a
0bfbec1
9d70bf7
960feaa
3c64fd3
fe27a70
4ee6bba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| package org.opentripplanner.raptor.api.model; | ||
|
|
||
| /** | ||
| * An 'access' that happens on-board, meaning that one is already on the vehicle when the path | ||
| * starts. This access is defined by a specific trip within a specific route, starting at a specific | ||
| * stop in the pattern. | ||
| */ | ||
| public interface RaptorOnBoardAccess extends RaptorAccessEgress { | ||
| /** | ||
| * The index of the boarded route | ||
| */ | ||
| int routeIndex(); | ||
|
|
||
| /** | ||
| * The index of the boarded trip within the route | ||
| */ | ||
| int tripScheduleIndex(); | ||
|
|
||
| /** | ||
| * The position in the route pattern of the first stop in the journey, where the access path just | ||
| * arrived at. Since this is an on-board access, this stop represents the most recently visited | ||
| * stop on the currently boarded trip. | ||
| * The next stop position after this is the first you can alight. | ||
| */ | ||
| int stopPositionInPattern(); | ||
|
|
||
| /** | ||
| * The first stop in the journey, where the access path just arrived at. Since this is an on-board | ||
| * access, this stop represents the most recently visited stop on the currently boarded trip. | ||
| * The next stop position after this is the first you can alight. | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| int stop(); | ||
|
|
||
| /** | ||
| * Since this is an on-board access, the duration until ({@link #stop}) is 0 seconds. | ||
| * {@inheritDoc} | ||
| */ | ||
| @Override | ||
| default int durationInSeconds() { | ||
| return 0; | ||
| } | ||
|
|
||
| @Override | ||
| default int earliestDepartureTime(int requestedDepartureTime) { | ||
| return requestedDepartureTime; | ||
| } | ||
|
|
||
| @Override | ||
| default int latestArrivalTime(int requestedArrivalTime) { | ||
| return requestedArrivalTime; | ||
| } | ||
|
|
||
| @Override | ||
| default boolean hasOpeningHours() { | ||
| return false; | ||
| } | ||
|
|
||
| @Override | ||
| default boolean stopReachedByWalking() { | ||
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * An on-board access does not support riding other transit before the specified boarding | ||
| */ | ||
| @Override | ||
| default int numberOfRides() { | ||
| return 0; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package org.opentripplanner.raptor.api.view; | ||
|
|
||
| /** | ||
| * | ||
| * @param routeIndex The index of the boarded route | ||
| * @param tripScheduleIndex The index of the boarded trip within the route | ||
| * @param stopPositionInPattern The position in the route pattern of the first stop in the journey, | ||
| * where the access path just arrived at. Since this is an on-board | ||
| * access, this stop represents the most recently visited stop on the | ||
| * currently boarded trip. The next stop position after this is the | ||
| * first you can alight. | ||
| */ | ||
| public record OnBoardTripConstraint( | ||
| int routeIndex, | ||
| int tripScheduleIndex, | ||
| int stopPositionInPattern | ||
| ) {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,17 @@ public interface RangeRaptorWorker<T extends RaptorTripSchedule> { | |
| */ | ||
| void findTransitForRound(); | ||
|
|
||
| /** | ||
| * Find on-board access for round (accesses on-board an already started trip) | ||
| */ | ||
| void findOnBoardAccessForRound(int iterationDepartureTime); | ||
|
|
||
| /** | ||
| * Perform on-board (accesses on-board an already started trip) transit search for boardings and | ||
| * alight events for the current round. | ||
| */ | ||
| void findOnBoardAccessTransitForRound(); | ||
|
Comment on lines
+30
to
+36
Member
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. The names are a bit confusing, maybe we should make a follow up PR and try to improve some of the naming. The method names follow the naming conventions as existing methods so we should change all methods at the same time.
Author
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. Agreed to do this, along with rewording the other methods in this worker for consistency in a follow-up PR. A follow up PR is preferred to keep that refactor isolated and easy to review. |
||
|
|
||
| /** | ||
| * Apply transfers for the current round. | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.