1) Creating and Configuring

Controler – Basics
There are two types of Controlers in MATSim. The first one, implemented in
org.matsim.run.Controler is public and rather simple, as it delegates most of the work to
org.matsim.core.controler.Controler Hence, this tutorial will focus on the latter one.

Creating a Controler
 
A Controler can be instanced just like any other object:
//Create an instance of the controler
Controler controler = new Controler("configurationFile.xml")

You may want to change some settings:

controler.setOverwriteFiles(true);
//Sets, whether Outputfiles are overwritten

controler.setCreateGraphs(false);
//Sets, whether output Graphs are created – set false, if you don't need them
controler.setWriteEventsInterval(5);
//Sets, how often events are written. Set 0 to disable it completely

Now, you can run the controler

controler.run();

With these settings, create and run a Controler using
"./examples/tutorial/multipleIterations.xml".
You will find the solution in /src/tutorial/example7ControlerListener/MyMainClass.java.

 


Warning: Table 'watchdog' is read only query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Table &amp;#039;sessions&amp;#039; is read only\nquery: UPDATE sessions SET uid = 0, cache = 0, hostname = &amp;#039;38.107.179.234&amp;#039;, session = &amp;#039;&amp;#039;, timestamp = 1328356097 WHERE sid = &amp;#039;e972b2ab7dd755a2094beea8ac708f02&amp;#039;</em> in <em>/home01/vsp_access/matsimwww/includes/database.mysql.inc</em> on line <em>174</em>.', 2, '', 'http://matsim.org/node/356', '', '38.107.179.234', 1328356097) in /home01/vsp_access/matsimwww/includes/database.mysql.inc on line 174