Instructor: R. Waraich
You will learn:
The configuration file serves the users as the primary interface to configure a MATSim run. The configuration file contains different modules, some of which are mandatory, such as network, plans and controler. There exist lots of additional modules and you can browse at matsim.org to find their documentation.
In the next chapter we will learn, how to perform simple calibration in MATSim.
After learning, how to start a simple MATSim run one needs to get into the habit, to run MATSim again and again. For example the different shares of transportation modes (car, bike, public transport, etc.) need to be calibrated.
To exemply how typically parameters in MATSim are calibrated, we look at an example where we have a hypothethical 10% population sample given and we do not have the resouces to create and run a 100% scenario (e.g. the machine has not enough RAM). To do so, the network needs to be calibrated to the popluation sample size. In the network file, each link has a length and a capacity (among other characteristics). The length defines the storage capacity of the road (how many cars have space on the road during a congestion). For all links a capperiod (capacity period) is defined, which is a time duration. The flow capacity of a road (named capacity in the network file), defines how many cars can pass the road during the capacity period. E.g. if the capperiod is set to "01:00:00" and the capacity of a certain road is set to 3600, this means that 3600 cars can pass the road in one hour at maximum.
"examples/equil/network.xml"In order to match a 10% population to a network, the network needs to be scaled down, so that it maches the population. There are two parameters available in MATSim, which can be used to perform this scaling: storageCapacityFactor and flowCapacityFactor (referred to as scaling factors from hereon). In theory, when using a 10% population both these scaling factors need to be set to 0.1. But in practice, this looks different and often the storageCapacityFactor needs to be set much higher than prescribed in theory. Furthermore, it also depends on the micro-simulation being used. By default the "QueueSim" simulation is being used, and the default values for both scaling factors are set to 1.
"examples/tutorial/config/example1-config.xml". If you think, that the configuration file has been changed sense its download, you can download its original version from here."inputPlansFile" to "examples/equil/plans2000.xml.gz".
<module name="strategy"> <param name="maxAgentPlanMemorySize" value="5" /> <!-- 0 means unlimited --> <param name="ModuleProbability_1" value="0.9" /> <param name="Module_1" value="ChangeExpBeta" /> <param name="ModuleProbability_2" value="0.1" /> <param name="Module_2" value="ReRoute_Dijkstra" /> <param name="ModuleProbability_3" value="0.1" /> <param name="Module_3" value="TimeAllocationMutator" /> </module>
"lastIteration" to 10 in the configuration fileMyControler1outputDirectory" to "./output/example1_2"
<module name="simulation"> <param name="flowCapacityFactor" value="0.1" /> <param name="storageCapacityFactor" value="0.1" /> </module>
MyControler1 again. In order to observe the difference in output of the two runs after changing the scaling factors, compare the following two leg histogram files "output/example1/ITERS/it.10/10.legHistogram_all.png" and"output/example1_2/ITERS/it.10/10.legHistogram_all.png".In order to calibrate, many runs with dozens of iterations will need to be performed. In order to improve performance and as such save time, we can perform the following steps:
"output/example1/ITERS/it.xx/xx.events.xml") . To do so, add the following line in the "controler" module (within the config file):<param name="writeEventsInterval" value="0" />
"simulation" to "JDEQSim". A documentation of this micro-simulation called JDEQSim is found here.outputDirectory" to "./output/example1""lastIteration" to 50 in the configuration fileMyControler1"output/example1/scorestats.png"Now you are ready to start with the calibration excercise (see next chapter).
Before starting this excercise, the configruation file in "examples/tutorial/config/example1-config.xml" should be prepared as described in the previous chapter. The configuration file should look as in this example file.
The goal of this excercise is to find calibrated values for the "storageCapacitiyFactor" and "flowCapacityFactor" such that, after calibration the leg histogram in the 50th iteration (located at "output/example1/ITERS/it.50/50.legHistogram_all.png") looks similar to the following figure.

Hints:
"storageCapacitiyFactor" is between 0.5 and 1.0 and the "flowCapacityFactor" between 0 and 0.5."output/example1/scorestats.png"
In this excercise, you will find out the effects of changing the probabilities of the different strategies in the "strategy" module (within the configuration file located at "examples/tutorial/config/example1-config.xml"). The duration of completing the steps described in this excercise, depends mostly only on the speed of your computer (although the questions at the end need some thought).
MyControler1 (for 50 iterations)outputDirectory" to "./output/example1_4""ModuleProbability_3" to "0.001"MyControler1 (for 50 iterations)outputDirectory" to "./output/example1_5""ModuleProbability_3" to "0.1""ModuleProbability_2" to "0.001""lastIteration" to 200 in the configuration fileMyControler1 (for 200 iterations)"output/example1/scorestats.png", "output/example1_4/scorestats.png" and "output/example1_5/scorestats.png").
What do you observe? What can we learn from this?