Skip to content

faq 31981570

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

How to change the agent's routes dynamically?

by Kai Nagel on 2015-07-27 09:47:20.779


Begin forwarded message:
From: Rolando Armas <rolandoarmas@gmail.com>
Subject: [Matsim-users] Re-routing on simulation
Date: 24 Jul 2015 04:19:45 CEST
To: <Matsim-users@lists.sourceforge.net>

Hi matsim users.

I would like to change the agent's routes dynamically (during the simulation). The general idea is that each agent has a route, but in some points of the network, we want to have a chance to induce detours and update the route, the question is how can we do that?.


Regards,

Rolando.  

Comments: 1


Re: How to change the agent's routes dynamically?

by Kai Nagel on 2015-07-27 09:57:22.817

Have a look at the RunWithinDayReplanningFromPlansExample under http://matsim.org/javadoc .  The example (in MyWithinDayMobsimListener) relocates the destination, but the approach also works for the same destination.  

Note that you need some behavioral model of what you want to do.  The tutorial code shows an example where re-routing is based on TravelTimeCollector, which uses a real-time view of the traffic system and computes optimal routes for that.  There are theoretical arguments why this can fail, but in practice it seems to work rather well. 

The underlying infrastructure of all this was provided by Christoph Dobler.

 

Clone this wiki locally