Skip to content

faq 110269247

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

running a custom routing algorithm for many iterations

by oussama smiai on 2017-06-27 13:06:30


I am running a custom routing algorithm based on the tutorial at the package  tutorial.programming.example21tutorialTUBclass.leastCostPath . I noticed that the routing algorithm is called only one for every person in the plan file. I find this behavior strange since in my config.xml file I have set the simulation to run for many iterations

<module name="controler">
 		<param name="outputDirectory" value="./output/PSF/singleAgent" />
 		<param name="firstIteration" value="0" />
 		<param name="lastIteration" value="5" />
 	</module>

I want the custom routing algorithm to be called for every person in the plans.xml file as many times as the specified number of iteration (in this case 6 times ). Is this possible ?


Comments: 1


Re: running a custom routing algorithm for many iterations

by Kai Nagel on 2017-09-02 10:47:00

This is difficult to answer without more information.  One possibility would be that the router is only (somewhat implicitly) called in "prepareForSim" ... this is the case when your initial plans file does not contain routes.  For all other iterations, routing needs to be configured as a strategy, see Section 4.5 of http://matsim.org/docs/userguide .  If you configure ReRoute with a weight > 0 and not other strategy, it should re-route every agent in every iteration. (A very unstable configuration, though.)

Clone this wiki locally