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 toorg.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.