Random command



random | events / forward()   seed1()   debug
                  lecuyer     seed2()
                  prn         list

Purpose

Access internal random number generator. Random numbers are obtained (deterministically) by two different linear congruential algorithms, prn and L'Ecuyer, which use one and two seed values, respectively.

Parameters

events
Not yet implemented.
forward(fw)
Winds forward the internal random seed by computing <fw> random numbers.
lecuyer
Switch a long period random generator (L'Ecuyer) which uses two seed values.
prn
Switch a short period (2**30) random generator which uses the algorithm
seed1 = ( seed1 * 32781 ) % (2**32) 
This is the startup default.
seed1(s1)
First seed value (for L'Ecuyer) or single seed value (for prn). May be a decimal integer or a hex value (starting with 0x). Note that for prn only odd seeds may be used !
seed2(s2)
Second seed value (for L'Ecuyer). May be a decimal integer or a hex value (starting with 0x).
list
Lists current random settings.
debug
Debug switch. Lots of output !

Remark

The prn generator has a rather short period, which is easily exhausted for complex simulations, so the L'Ecuyer generator often may be the better choice.
You can query the number of calls to the generator(s) with
   random / list
If this exceeds the expected period of the generator, the simulation results may be questionable.

Examples

   random / seed1(0xB)
Set the first seed value to hexadecimal 'B' (decimal 11)
Last updated: M.Kraemer,
$Id: traxcmdrandom.html,v 1.6 2017/03/14 15:50:02 kraemer Exp $