Skip to content

faq 121634823

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

How to get travel time/route for taxi mode in output?

by Lichen Luo on 2017-11-13 15:42:56


Dear all MATSimians,

I meet a problem when I tried to simulate taxi module in MATSim platform that I only get the NaN for travel time/route for taxi mode in the output plan file.(while it is OK for car leg).

After I looked into some tutorials and the book, I notice that I should set mixed traffic for taxi mode and I just follow it as well as the OpenBerlinMixedTraffic.java, but this time the JVM sent me an error with

org.matsim.core.population.routes.GenericRouteImpl cannot be cast to org.matsim.core.population.routes.NetworkRoute

at org.matsim.core.controler.PrepareForSimImpl.run(PrepareForSimImpl.java:100)

(which I assume is resulted from fail to get Route of taxis in leg.getRoute().)

I guess there need some extra code for taxi mode since it is somewhat special as not being listed in transportMode.java by default.

Since tutorial/information about neither mixed traffic nor taxi module is limited on Internet, I really have no idea what to do in this case, here I enclose the run file, logfile and config file, I will much appreciated if anyone could give me some hints about this issue.

Thank you.

Best regards,

Luo Lichen.


Comments: 1


Re: How to get travel time/route for taxi mode in output?

by Michal Maciejewski on 2017-11-13 16:38:06

Hi Luo,

Not getting taxi routes in the output plan is okay as the intention of an agent is to take a taxi from A to B, while the route from A to B is calculated on the fly by the dispatching algorithm, and should not be considered as something that comes from the agent.

If you want to learn which routes were taken for simulated taxi trips, the easiest way is to process output events. While matsim simulation is running, you can also, at any time, iterate over taxis to get all occupied trips that have been scheduled so far. I suggest to try first the former (as it is easier and more general).

Best,
Michal

Clone this wiki locally