-
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
Change to not mark past stop times as unavailable when updating trip times #2297
Conversation
If a provided trip update does not start with the first stop time of a trip, all the previous stop times is marked as unavailble. This change that behaviour to instead set the delay for these stop times to zero. This will allow these stop times to be available in routing. This resolves opentripplanner#2295
Thanks @johannilsson for the fix to this issue. It seems to me that there are some decisions to be made about overwriting existing predicted values, see discussion in the original ticket #2295. |
tripUpdate = tripUpdateBuilder.build(); | ||
updatedTripTimes = timetable.createUpdatedTripTimes(tripUpdate, timeZone, serviceDate); | ||
assertNotNull(updatedTripTimes); | ||
// Ensure that times past the updated one is still valid. | ||
assertEquals(0, updatedTripTimes.getDepartureDelay(0)); | ||
timetable.setTripTimes(trip_1_1_index, updatedTripTimes); |
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.
If delay is set to 1
upstream of this stop, shouldn't this be assertEquals(1, ...
?
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.
This check is to ensure that we don't do backward propagation. The delay is applied to second stop index with stop id B here.
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.
Ah, ok, thanks. I'd suggest changing the comment then - "past the updated one" to me implies a stop downstream of the prediction.
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.
Agreed, it should probably read "stops upstream of the updated one are still valid, but have no delay"
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.
Updated the comment as suggested. When I re-read I can see that it caused a confusion too. When I've written "past" I've been referring to the upstream stops. Thanks!
As mentioned on #2295 and above, we still need to make decisions about requiring "full trip" updates, propagating delays, etc. for GTFS-RT and probably also SIRI. I'll bring this up on the mailing list. |
@abyrd could you add a reference to the mailing list posting, as I could not find the related discussion in neither the Developers nor the Users list. Thank you. |
66629f5
to
4bcb63c
Compare
In OTP2 we now have Please reopen if that was a mistake. |
If a provided trip update does not start with the first stop time of a trip, all the previous stop times is marked as unavailable.
This change that behaviour to instead set the delay for these stop times to zero. This will allow these stop times to be available in routing.
This resolves #2295