OneBusAway + OTP = Real-Time Trip Planning

385 views
Skip to first unread message

Brian Ferris

unread,
Mar 1, 2011, 3:22:39 AM3/1/11
to opentripp...@googlegroups.com
I'm sure most of you are already subscribed to transit-developers, but
I promised I'd post this here as well, so sorry for the duplication...

The description says it all. Throw OneBusAway real-time and
OpenTripPlanner trip planning in a blender, and what you get is an
open-source real-time trip planner. This is the real-deal: itinerary
planning where the current location of the bus is taken into account
during the search phase (as opposed to tacking it on afterwards). I
know there has been talk on the list about making a real-time trip
planner a reality, so I wanted to give you all a heads-up on my
progress.

Right now, we're pushing hard to get this into the OneBusAway mobile
apps first, but we do have a basic web interface that we use for
debugging. You can check it out at:

http://soak.onebusaway.org/where/standard/plan.action

(Real-time is off by default. Enable it under 'Show Options'. No
geocoder connected yet, so select a To or From box and click on the
map to set your start and end location. This will all probably crash
about five minutes after I send this email ; )

Source code is up at:

https://code.google.com/p/onebusaway/

Some technical details for those who care:

Since OBA and OTP both have their own transit data models and I can't
afford the memory to keep both around, I wrote an adapter that allows
the OBA transit graph to implement the OTP graph data structures.
This made it easier for me to implement the real-time aspects (since
that's what OBA is all about), but the downside is that this isn't
immediately usable in the OTP webapps without some additional work
that hasn't yet been done.

Again, still a ton of work to be done here, but wanted to give people
a heads up that I was working on this.

Brian

David Turner

unread,
Mar 1, 2011, 2:27:23 PM3/1/11
to opentripp...@googlegroups.com
Awesome! I just tried out the demo, and it looks great. I can't wait
to try it out in person next time I'm in Seattle.

Marco Caminiti

unread,
Mar 3, 2011, 5:24:59 AM3/3/11
to opentripp...@googlegroups.com
Hi,
I'm working to make a real-time OTP. For now I'm using a JMS message exchange. Let me explain: I assumed that when a bus arrives at a station X sends a JMS message with the arrival time and another with the departure time.

In the OTP application, each instance of the ArrayTripPattern have a listen 
JMS to all buses of its pattern. In this way when they get the messages can upgrade the memory accordingly, spreading the possible delay to all subsequent stations to X.

After seeing that there is a web service that provides real-time data bus:

http://webservices.nextbus.com/service/

I wanted to ask your opinion on a different method for managing real-time.

1. Building the graph without adding to the schedules of public transportation.
2. Every time an instance of ArrayTripPattern must calculate the travel time then made a request to the WS nextBus for real-time data.

As this second method weights compared to JMS messages?

thanks,
Marco


David Turner

unread,
Mar 3, 2011, 12:38:32 PM3/3/11
to opentripp...@googlegroups.com
On Thu, 2011-03-03 at 11:24 +0100, Marco Caminiti wrote:

> I wanted to ask your opinion on a different method for managing
> real-time.
>
> 1. Building the graph without adding to the schedules of public
> transportation.
> 2. Every time an instance of ArrayTripPattern must calculate the
> travel time then made a request to the WS nextBus for real-time data.
>
> As this second method weights compared to JMS messages?

This second method seems like it could slow down trip planning
significantly, but it's what Jerry used for his realtime trip planner in
San Francisco. Let us know how it goes!

Marco Caminiti

unread,
Mar 3, 2011, 4:34:57 PM3/3/11
to opentripp...@googlegroups.com, David Turner
Hi David,
I have already modified the application using JMS but after having seen NextBus and
OneBusAway web service I had come some doubt on my solution. I tried now to add the extended-api and I have to add yet JMS listeners to write delays into popups.

Tantks for the replay, and I'm ready to accept other suggestions.
best regards
Marco

Brian Ferris

unread,
Mar 4, 2011, 4:10:43 AM3/4/11
to opentripp...@googlegroups.com
Just to outline the approach I'm using, I am receiving real-time on a
per-vehicle basis, as opposed to a per-stop basis. Each vehicle has a
schedule deviation value associated with it (ahead or behind schedule)
that I use in adjusting arrival and departure times, propagating the
schedule deviation to take into account time made up in layovers, etc.
I've been collecting a lot of historical arrival data in my system
that I'm hoping to use to build a more accurate model of schedule
deviation propagation (a bus 2 minutes late now is likely to be 4
minutes late in the future, etc).

Brian

Marco Caminiti

unread,
Mar 4, 2011, 5:28:28 AM3/4/11
to opentripp...@googlegroups.com, Brian Ferris
If I understand you predict the arrival/departure time at stops starting from measurements of the vehicle in places different from stops?

In future I want to have three modules:

1. the fist predict traffic on the edge, for the vehicle "CAR", and predict in any way the arrival/departure time at the stops for the public vehicle

2. A module that send message of this prediction to update the OTP memory

3. the planner OTP

At this time I can't predict traffic (I haven't traffic data) thus I have simulate only the case in which the bus arrive at the stops with a traffic simulator (SUMO PLAYER)




Reply all
Reply to author
Forward
0 new messages