Skip to content
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

johannilsson
Copy link
Contributor

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

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
@abyrd
Copy link
Member

abyrd commented Jul 14, 2016

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.

@abyrd abyrd added this to the 1.0.0 release milestone Jul 14, 2016
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);
Copy link
Contributor

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, ...?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Member

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"

Copy link
Contributor Author

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!

@abyrd abyrd modified the milestones: 1.1.0, 1.0.0 release Sep 9, 2016
@abyrd
Copy link
Member

abyrd commented Sep 11, 2018

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.

@hbruch
Copy link
Contributor

hbruch commented Jun 10, 2019

@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.

@abyrd abyrd removed this from the 1.1.0 milestone Oct 13, 2020
@johannilsson johannilsson requested a review from a team as a code owner November 27, 2020 11:30
@t2gran t2gran requested a review from a team as a code owner November 2, 2022 11:13
@leonardehrenfried leonardehrenfried added the OTP1 Fix or backport to the 1.x version of OTP label Dec 6, 2022
@leonardehrenfried
Copy link
Member

In OTP2 we now have RealtimeState which replaces this concept. Therefore I'm closing this.

Please reopen if that was a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug OTP1 Fix or backport to the 1.x version of OTP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants