From Sumo
Revision as of 15:20, 18 December 2014 by Namdre (talk | contribs) (consolidated page on random stuff)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Stochasticity is an important aspect of reprducing reality in a simulation scenario. There are multiple ways of adding stochasticity to a simulation. They are described below.

Random number generation (RNG)

Sumo implements the Twister algorithm for generating random numbers. This rando number generator (RNG) is initialized with a seed value which defaults to the (arbitrary) value 23423. This setup makes all applications deterministic by default as the sequence of random numbers is fixed for a given seed. The seed may be changed using the option --seed <INT>. When using the option --random the seed will be chosen based on the current system time resulting in truly random behavior.


The default car-following model Krauss supports stochastic driving behavior through the vType-attribute sigma (default 0.5). When this value is non-zero drivers will randomly vary their speed based on the RNG described above. Other car-following models also use this attribute.

Departure times

The departure times of all vehicles may be varied randomly by using the option --random-depart-offset<TIME>. When this option is used each vehicle receives a random offset to its departure time, equidistributed on [0, <TIME>].

Flows with a fixed number of vehicles

The DUAROUTER application supports the option --randomize-flows. When this option is used, each vehicle defined by a <flow>-element will be given a random departure time which is equidistributed within the time interval of the flow. (By default vehicles of a flow are spaced equally in time).

Flows with a random number of vehicles

Both DUAROUTER and SUMO support loading of <flow> elements with attribute probability. When this attribute is used (instead of vehsPerHour,number or period), a vehicle will be emitted randomly with the given probability each second. This results in a binomially distributed flow (which approximates a Poison Distribution for small probabilities. When modelling such a flow on a multi-lane road it is recommended to define a <flow for each individual lane.