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