New Feature —  Detecting Delays – Good Service – Medium

In the last week, the New York City subway system has suffered a couple major delays during peak hours. On Wednesday morning, it was the L train.

Later that afternoon, it was the M train.

Judging from the tweets, what’s worse than having train delays is not knowing when and where they occur. While is pretty good at detecting abnormal headways due to bunching or service after residual delays, it did not do a very good job at detecting delays as they were happening.

A lot of times when you see this, it’s already too late.

In my previous post, I explained how uses countdown clock data (i.e. GTFS-RT) as provided publicly by the MTA, to figure out train headways. What if we use the same information to figure out if trains are not moving?

To illustrate what I mean, remember that uses the differences in estimated arrival times to figure out the headway between each train.

Visual of how calculates headways. Times and trains for illustration purposes only, not to scale.

Using this same information, we can deduce that there’s a delay if the train arrival times keep moving forward.

Estimated arrival times of each train gradually postpone when delays occur.

Now, we keep track of the train that is at the front of each line and if the current estimated arrival time for that train to arrive at the final station exceeds 5 minutes of its initial estimate, then we flag it as a delay.

Putting this code into action, I have been testing this feature for the last week. Yesterday, it was able to catch a delay on the Culver line, affecting the F and G trains.

Notice the small type + 15, which indicate how long the train has been delayed. It is shown separately from the detected headway as it is a different metric.
These screenshots were taken on Monday, October 8, 2018 at 11:49am. So the delay was detected on the F at around 11:38am, and 11:45am for the G.

I was able to detect this delay five minutes before it was post on the MTA website.

This feature not only detects stalled trains, but also when trains are running slower than normal. Either scenario would result in the estimated arrival time being pushed back. By being more proactive about delays, we can plan our trips better.

Source link
Show More
Back to top button

Pin It on Pinterest

Share This

Share this post with your friends!