Skip to content

faq 40992796

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

Extracting the time and location of each agent in a simulation

by Thibaut Dubernet on 2015-12-17 09:42:29


I want to extract the time and location of each agent during the simulation process because I want to perform some risk exposure analysis. Does anyone know how to do this? Should I use the Event handler to do this?

The second question is how to get the link MOEs for traffic simulation? Thanks.

 

(on behalf of Dapeng Li)


Comments: 1


Re: Extracting the time and location of each agent in a simulation

by Thibaut Dubernet on 2015-12-17 09:59:16

Dear Dapeng Li,

 

yes, you will need to implement event handlers for this. The details will depend of your actual simulation settings.  Here are some thoughts:

 

  •  the agents can be one of three states: activity, leg, or aborted. Aborted agents are removed from the simulation, so they are not anywhere anymore after the abort event (or "stuck" event).
  • For activities, tracking agents is reasonably easy, as the agent Id is in the activity start and end event. There is however one important pitfall: the first activity of a agent *has no start* (the agent is "already there" when the simulation starts"). There are two solutions to this problem:
    •  parse the selected plans before the simulation starts to know where the agents are initially
    • reconstruct this information once you see the first activity end event. This is more event-based, but you will "miss" the agents staying at home the whole day, if any. This might be a problem for risk exposure.
  • For traveling agents, this is trickier. The easy part are start and end (they correspond to start and end of activity). For agents traveling by car, you might be able to track link enter and link leave event. Depending on the version you use, you might have to track additionally in which vehicle agents traveling, as we removed the agent Id from those events. For agents traveling by "transit", if you have it, you will have to track vehicle entrances, and then track the vehicles. For "teleported" modes, you will need to interpolate.

For implementation, I would recommend creating a scenario with only a few agents (so as to have all modes represented), run it, and look at the output events file to see what information is available.

 

Do not hesitate to come back with more specific issues that you encounter on the way.

Clone this wiki locally