OneBusAway / onebusaway-application-modules

The core OneBusAway application suite.
https://github.com/OneBusAway/onebusaway-application-modules/wiki
Other
216 stars 133 forks source link

Make begin/end threshold for displaying "minutes before/after" values easily configurable #57

Open barbeau opened 11 years ago

barbeau commented 11 years ago

Currently, time threshold values that are used to determine whether or not an estimated arrival time is displayed to the user is hard-coded, or must be defined as a parameter in a REST API request.

Here's the current logic, per Brian Ferris (see https://groups.google.com/d/msg/onebusaway-developers/pVxORUgLhe0/GBZx54MsB4AJ):

Show any bus whose predicted OR scheduled arrival/departure time is greater than or equals to (NOW - minutes before).

So the reason you saw a bus with a -8 is because it actually left 5 minutes early and was originally scheduled to leave just three minutes ago, which is within the 5 minute threshold.

A bit confusing, but the idea is that if your bus left early (5 minutes early is pretty early!) we didn't want to just show nothing in the UI, thus we considered both predicted and scheduled time when deciding to show something in the UI.

For what it's worth, this is configurable but probably not in the way that'd be immediately useful to you. You can specify a minutesBefore=X parameter to control how far into the past we look for buses that have already departed:

http://onebusaway.org/where/standard/stop.action?id=1_18120&minutesBefore=10

This threshold should be easily configurable for an entire OBA instance via data-sources.xml file, instead of being hard coded. We can also keep the ability to change this value via the REST API parameter, for backwards compatibility.

Full conversation is on OBA Dev list here:

https://groups.google.com/d/msg/onebusaway-developers/pVxORUgLhe0/VK5GWCdCLEwJ

barbeau commented 8 years ago

This could be configured similarly to https://github.com/OneBusAway/onebusaway-application-modules/pull/160.