conveyal / r5

Developed to power Conveyal's web-based interface for scenario planning and land-use/transport accessibility analysis, R5 is our routing engine for multimodal (transit/bike/walk/car) networks with a particular focus on public transit
https://conveyal.com/learn
MIT License
281 stars 73 forks source link

Respect pattern bundles (common trunks) after frequency conversions #36

Closed abyrd closed 7 years ago

abyrd commented 8 years ago

When we frequency-convert a common trunk, in our current system we lose the ability to represent the synchronization on that trunk (i.e. the intentional interleaving of vehicles serving different trip patterns to provide reliably lower headways on that common trunk).

If we group the trips by trip patterns (rather than whole routes possibly containing many different patterns) when performing the frequency conversion, our Monte Carlo simulation will capture this effect to some degree, in that it will generate some schedules with excellent interleaving of the common trunk, and others with very poor interleaving (bunching of vehicles on the common trunk due to simultaneous arrival of vehicles serving different patterns). The trick is knowing whether the existing system is consciously interleaved, or whether interleaving depends on chance, and whether the future system would be consciously interleaved. If we don't know this for sure, it's best to count on the Monte Carlo randomization of schedules, though that yields a wider variance in accessibility results. (Which in this case is more truthful, since we don't know what specific schedule, if any, will be used in practice.)

If we do know for a fact that the common trunk is consciously interleaved and will continue to be so under the future scenarios, It would be possible to group the relevant patterns into a bundle, and randomize their schedules together when performing the Monte Carlo simulation, adding some constant offset to each constituent branch. However we may not want to apply perfect interleaving, because existing real-world scheduled operation does not necessarily provide perfect interleaving. We’d be assuming the system will be run better than it is today, causing artificial improvements under the scenarios.

But say we want to replicate current imperfections in interleaving to minimize erroneous, artificial improvements due only to frequency conversion. Analyzing the existing bundle to derive those offsets is not always obvious (at which stop are they measured?) and when only some (not all) of the constituent frequencies are modified by a scenario, it's not obvious how to scale those empirical offsets. When the frequency of the entire bundle is modified in a scenario the adjustment process is more straightforward, so one solution is that when a trunk is identified, we only allow adjusting the combined frequency of the whole trunk in scenarios (all constituent patterns adjusted together).

If that kind of certainty is not available, then we should just say “no idea what the schedule will be” and use Monte Carlo approach applied independently at the trip pattern level, with uncertainty appearing as variance in the results.

So to clarify, I propose only two different options: A) the scenario identifies an interleaved bundle of trip patterns (which might just be a GTFS route), along with the specific stop at which their interleaving is to be measured (or specifies perfect interleaving at that specific stop) in which case frequency modifications are only applied to the whole bundle; or B) each trip pattern is frequency-converted independently, and Monte Carlo randomization takes care of the interleaving possibilities, in which case each pattern can have its frequency adjusted independently.

mattwigway commented 8 years ago

Yep. One other clarifying note (and I'm sure @abyrd understands this but it makes sense to put it in writing) is that using Monte Carlo on a system that will be synchronized not only yields higher variance, but also introduces bias because synchronization reduces the expectation of waiting time.