Strategy Modules

These are modules that can be used via the syntax

	<module name="strategy" >
		<param name="ModuleProbability_1" value="0.1" />
		<param name="Module_1" value="ChangeLegMode" />
                <param name="ModuleProbability_2" value="0.1" />
                <param name="Module_2" value="TimeAllocationMutator" />
	</module>

Strategy modules are numbered. Also, each module is given a weight which determines the probability by which the course of action represented by the module is taken. In this example, each person stands a chance of 1/2 that their transport mode is changed, and a chance of 1/2 that their time allocation is changed.  (The weights are renormalized so that they add up to one.)

A strategy module is, in the code, always a combination of a plan selector and zero or more strategy module elements. There are two cases, which are handled differently:

  • If there are zero strategy module elements, the chosen plan is made "selected" for the person, and the method returns.
  • If there is at least one strategy module element, the chosen plan is copied, that copy is added to the persons's set of plan, and the new plan is made "selected".  That new plan is then given to the strategy module elements for modification. These latter strategy modules, with at least one strategy module element, are sometimes called "innovative".

The strategy modules that are understood by MATSim are defined in the class StrategyManagerConfigLoader.  In addition, you can program your own strategy modules; see tutorial.programming in matsim/src/main/java for examples.

Unfortunately, the naming in the code is different from the naming in the config file:

  • "strategy" in config file --> StrategyManager (or "set of strategies") in code
  • "strategy module" in config file --> PlanStrategy in code
  • There is a PlanStrategyModule in the code; it corresponds to what was called strategy module element in the description above.

It is not clear which combinations of these modules can be used together. Depending on required features, special variants sometimes need to be used. This has not yet been sorted out.  Also see here.