Skip to content

faq 66158603

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

TripRouter seems to grossly overestimate travel time

by Andrew A Campbell on 2016-06-09 17:33:37


Greetings all,

I want to validate the routes produced by a TripRouter against what the agents actually experienced during the mobsim. To do this validation, I created a controler listener that implements the following work flow (link to code at bottom of message).

First, at the IterationEndsEvent, we retrieve the TripRouter:

 this.tripRouter = event.getServices().getInjector().getProvider(TripRouter.class).get();

Next, we iterate through the first 1,000 agents in the population. For each agent, we get each leg of their selected plans and record the actual route, distance, and travel time. Next, we use this.tripRouter to estimate a route for the same legs. We use the same origin, destination, and trip departure time. 

We find that the TripRouter overestimates travel time by about 40 - 50% depending on the scenario. The distance is also consistently overestimated, but by a much smaller amount.


Total Sums
over all 1,000 agents 

Total Percent Diff (estim-act)/act
actual TT 1825538
TT 0.45008

estim TT 2647176
Dist 0.025469

actual Dist 39369776




estim Dist 40372490




I greatly appreciate any help in understanding what is going on here. For our application, it is very important to get reasonable estimates for route (and link) travel times.

Thank you,

Andrew


RouterControlerListener_V2.java gist

https://gist.github.com/neverforgit/38a346de27dcfd329f8c1a614fb9ee4e


Validation raw data

https://gist.github.com/neverforgit/b2f2df8ba2c52e4197601bef007d70e8



Comments: 2


Re: TripRouter seems to grossly overestimate travel time

by Kai Nagel on 2016-06-10 08:07:07

Odd.  I have to say that I in general do not fully trust the routers but rather use them as "proposal generators".  If possible, I randomize the routing algorithms ("routingRandomness" in the config; also see http://dx.doi.org/10.1016/j.procs.2014.05.488), and then take the mobsim result as the "true" performance of that route (or plan in general).  Unfortunately, this does not help you, but it may help others.

There is also a problem that until very recently very often the first and last link were "swallowed" (since the vehicle would not travel the full link, and so the system did not know what to do with this information).  This may have happend, or not, in the router, and it may have happend, or not, in the mobsim.  This should be fixed in the development head, but may still contain bugs.  Could you maybe please try with a development snapshot?  (If you are using maven, you just need to adapt the pom.xml.)

Hopefully one of the routing experts will chip in with better ideas.


Re: TripRouter seems to grossly overestimate travel time

by Thibaut Dubernet on 2016-06-10 09:12:44

Dear Andrew,

Looking at your code, I see you used the values from the plan as the "actual" travel time. The plan is just the "program" the agent will follow, and travel times are thus the travel time expected by the router when the route was computed. So you compare two different expected travel times, which might vary quite a lot in the first iterations, before traffic "spread" enough on the network. And you cannot even now when this estimation was done (so it is not even a comparison of estimations at iteration i and i+1).

To do it properly, you will have to use the events to compute the travel times. There are "experienced plans" that convert those event in convenient plan form.

org.matsim.core.scoring.ExperiencedPlansServiceImpl will give you an idea of how to get and use experienced plans. Maybe you can even get an ExperiencedPlansService injected, I did not check.

 

Clone this wiki locally