onebusaway-application-modules
onebusaway-application-modules copied to clipboard
Method isTripActive able to check the delay cases in StopTimeUpdate
Hi, Please take a look at this change. Unfortunately, this method will regret all trips and mark them as inactive if the tripUpdates use a delay in the stopTimeUpdate.
Thanks for your contribution. Can you elaborate on the scenario you’re solving for and also add tests that validate it?
Ok. I added a test. Problems what it solve: In normal GTFS-realtime updates, trip predictions are considered active if:
- There’s at least one stop time update,
- And its first and last stop predictions fall within a valid time window. But sometimes a TripUpdate:
- Lacks timestamps (i.e., no arrival.time),
- Only has a delay
The previous logic would fail in such a case because it relies on arrival/departure time values.
@aaronbrethorst Take a look at.