opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.2k stars 1.03k forks source link

Minimal time for transfers #174

Closed novalis closed 13 years ago

novalis commented 13 years ago

While testing OTP, I have noticed that sequences like "leave bus A at stop X at 8:20; board bus B at stop X at 8:20" are quite common in the result trip plans.

This seriously affects the reliability of our planner, because:

What do you think about adding another optional parameter to the WS API which would allow to define minimum time reserved for transfer in the trip itinerary?

novalis commented 13 years ago

The reason we didn't consider transfer times yet is that we expect either short headways (so that overall trip time won't be much affected by a missed connection) or schedules that leave reasonable connection time. But if these aren't true, then we'll need to provide a way around it.

I'm not sure it makes sense as a parameter, because it's more a feature of the system than of the individual trip. Perhaps this should be a feature of the graph builder?

In general, many of these problems might be solved with frequency-based routing, where average headways could be computed, rather than relying solely on schedules. This is especially important on routes that have high variance from schedules. We don't plan to implement this ourselves any time soon, but it would be really cool, and we've listed it for Google Summer Of Code.

--novalis

novalis commented 13 years ago

Is this different than #180?

--novalis

novalis commented 13 years ago

As I understand it, this is the same usecase as #174.

Chris, are you using a [http://code.google.com/transit/spec/transit_feed_specification.html#transfers_txt___Field_Definitions transfers.txt] file? If so, OTP will automatically respect minimum transfer times (i.e., transfer_type = 2, with a minimum transfer time required specified in seconds).

With that said, perhaps we should support a global minimum transfer time? This wouldn't make sense in all cases (particularly timed/scheduled transfers) but might be useful. I don't know if this makes sense as an API parameter, though; wouldn't you either want to use it for a given deployment or not? I.e., it should be set once on the backend rather than on every request?

--nicholasbs

novalis commented 13 years ago

Thinking about it, transfers.txt doesn't support a same-stop transfer, so two buses that stop at the same stop might have a problem.

We could have some sort of min_boarding_time parameter, maybe.

--novalis

novalis commented 13 years ago

min_boarding_time sounds really good...

We don't use transfers.txt and until now we in our tests we haven't noticed any itineraries with too little time to walk from one stop to another, walking directions between stops are doing just fine. The only problems that we have encountered are itineraries with too little time to catch another bus from the same stop (it especially concerns one bus arriving and the next leaving in the same minute).

I wonder why is it that transfers.txt couldn't support same-stop transfer? (The spec doesn't say anything about this btw). I'm going to check that out with the people on http://groups.google.pl/group/gtfs-changes

--chrisWit

novalis commented 13 years ago

This is now settable on a per-request basis as well as via transfers.txt.

--novalis