Random Numbers

Random numbers enable a simulation to include the variability that occurs in real life.

Each place where random numbers are used within a simulation uses a separate stream of random numbers. This enables a change to be made to one aspect of a simulation, without affecting the random occurrences that will happen at other areas.

By default, when the clock is set back to the start of the simulation time, all the random streams are reset to their starting seeds. This means that a second run of the same simulation will produce the same results.

To change the random numbers that are used, select Random Sampling from the Additional drop-down on the Home tab and change the set of random numbers.

  • Antithetic Random numbers can be used for variance reduction in trials.
  • Set “Auto change” if you want a different set of random number streams used every time you re-run the simulation.

Random number sets are numbered. There are 30000 sets of random number streams available in Simul8. If required, Simul8’s internal random number generator can be replaced by any random number generator simply by supplying a DLL to generate the numbers based on commands from Simul8. Example code for a simply generator supplied. Complete source code also provided (and compiled DLL) for a Mersenne Twister generator (the “generator for the 21st century” with cycle over 2 to the power 19000!

Advanced Random Number Control

Use the advanced dialog if you want to change the random number stream used by an individual random sampling point inside the simulation. This is not normally required in building and running Simul8 simulations.

The dialog lists all the places where random numbers are sampled inside your simulation. Click on one of these to display / change the seed used for the stream used at this place.

See Also