Closed koch-t closed 2 years ago
I see. Yes, we assume that the updates arrive in contiguous blocks.
+1 on handling propagation as specified in GTFS-rt spec - AFAICT this issue still exists in the current master branch in TimeTable.update()
.
Related to this - we were looking at propagating frequency-based real-time Trip Updates (#1347), and had a question on how to handle updates that can cause negative hop times.
For example, for a given trip consider:
stop_A--------stop_B--------stop_C (t1=7:00am)---(t2=?)-----(t3=7:04am)
...where tx = GTFS-rt arrival time, and (?) means no data.
Assume travel time in between stops is 5 minutes (specified in stop_times.txt). When propagating t1 to t2 to create an arrival time at stop_B, you would get t2 = 7:05am. This is a problem, since t2 > t3.
The current code that is doing validation on TripTimes appears to throw out the entire GTFS-rt TripUpdate for all stop_times if one of them creates a negative hop value.
Questions, in light of GTFS-rt spec propagation:
(cc'ing @mona77)
No, the current code implements delay propagation correctly, although the merge with master happened only recently. The mmri-rt branch was fixed last year.
As for your questions:
Hi @barbeau,
Our model for the trip update process is that we only apply fully-specified updates, and partial update messages must go through a delay propagation/inference process before they are applied. My feeling is that we should apply a very simple set of rules in that propagation/inference step and throw out any messages that can't be unambiguously turned into reasonable fully-specified updates, complaining loudly in a way that will be useful to upstream data providers and treating them as "no data".
Of course We've got another point of view to take into account here -- providing users with the best possible guess based on poor or partial input data. This is the point of view Google Transit must adopt for example. I don't think we should aim for that currently, we've got a lot of other things to work on and this fuzzy inference stuff could be a rabbit hole.
Getting fully functional RT support in place that can at least handle well-formed coherent updates should be the priority.
@JordenVerwer @abyrd Ok, thanks, that gives us a baseline for frequency-based real-time updates - we'll throw out any updates that don't apply cleanly in the initial implementation.
@JordenVerwer Could you point me to the code in master that performs the propagation (i.e., applies an update to all stops with stop_sequence > x on a trip, for an update to x)? Maybe I'm not looking in the right place.
@abyrd I can certainly appreciate the complexity that certain types of inference add - you're right, you could spend a ton of time on just that component. And I agree, getting fully functional RT support in place for well-formed updates should be the current priority.
After the 1.0 release when things settle down, though, it may be worth looking at some simple features that a "non-strict" GTFS-rt mode could provide (with the default being a "strict" mode). In my experience, data (real-time especially) is never perfect, and IMO it would be good to have some configurable flexibility in OTP.
You can find the delay propagation code in lines 455 - 461 of the Timetable class.
@JordenVerwer Thanks! I missed that the first time. So this issue should be closed, then?
I suppose so, yeah. @skywave, do you agree that the current implementation is correct?
What is the current status on this? Thanks.
As far as I know, we're still propagating as per the GTFS-RT specification. Did you have any specific reason for asking?
We should check whether currently any propagation is applied and how.
Related - @rasbrown opened PR https://github.com/opentripplanner/OpenTripPlanner/pull/3176, which implements propagation across trips within a block (optional via configuration) and is deployed in Tampa, FL as part of the OneBusAway instance there.
@rasbrown In your experience, other than https://github.com/opentripplanner/OpenTripPlanner/pull/3176, does OTP seem to propagation GTFS-realtime delays per the spec within a trip?
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days
OTP doesn't seem to propagate delay's as used in the GTFS-RT example at https://developers.google.com/transit/gtfs-realtime/trip-updates
If such a tripupdate is now given to OTP it will warn about not being able to match the update.