matsim-libs icon indicating copy to clipboard operation
matsim-libs copied to clipboard

A question about analysising for the output files.

Open HawkTom opened this issue 3 years ago • 1 comments

Hello,

Now, I have a project, in which I need to analyze the output files and obtain some useful data.

I hope to obtain the map data and the state of each edge in the map at every time. More detailly, I want to obtain the data that for each time point, how long a vehicle will take to traverse a route (edge).

May I ask if it is possible to extract these data from the output files? If so, how can I obtain them.

Thanks!!!

Best, Hao

HawkTom avatar Mar 15 '21 12:03 HawkTom

Yes, this is possible by analyzing the simulation events (output_events.xml.gz). The basic idea is to remember for each vehicle the link-enter time, and then when the vehicle leaves the link again, calculate it's travel time. This information can then be aggregated in whatever way you want.

An example to collect LinkEnter- and LinkLeave-Events can be found in this example events-handler. Note that you should filter out vehicles performing an activity on a link (VehicleLeavesTrafficEventHandler).

An alternative could also be to use the TravelTimeCalculator from MATSim, which calculates for each link and each 15-min time-bin the average travel time per link.

mrieser avatar Mar 15 '21 19:03 mrieser