next up previous contents
Next: Password Security Up: INTERNAL OPERATION Previous: INTERNAL OPERATION

Generating Random Seeds

 

Drone generates a unique run seed for each run of the target program. Currently, Drone uses the subtractive random number generator (RNG) IRN55 suggested by Knuth [2, pp. 171-173,]; the version of the algorithm that is used by Drone is based on the routine ran3 in Numerical Recipes in C [8]. Note that Terry Jones found a potential bug in ran3, where under certain circumstances the random seed might become negative during initialization. Specifically, this might happen when *idum is subtracted from MSEED, if *idum is too large. The Drone version of this routine, Ran3, fixes that bug.

Ran3 has a period of 109 and returns an integer on the interval [0, 109). It takes a 32-bit signed integer as a seed; the absolute value is used if the seed is negative. Ran3 has not been tested as well as linear congruential generators (LCGs), such as Park and Miller's [7] ``minimal standard'', but it was chosen because it passes Knuth's tests for randomness, has a long period, and is based on a completely different algorithm from LCGs. It is assumed that many target programs are likely to use an LCG such as the minimal standard by default, so it is desirable to use a different method to generate the run seeds.

If you prefer to use another random number generator, hooks are provided in the routines GetRunSeed and InitRNG within the Drone script for you to specify your own Tcl procedures. The parameter runSeedGenerator in the control file specifies which method to use to generate run seeds; currently only Ran3 is supported. Make sure that whatever random number generator you use in Drone is not correlated with the random number generator used in the target program. Any correlations may bias your results. Also, be aware that any random number generator that you design yourself is likely to be deficient, unless you know what you are doing. See a good reference on RNGs [8, 2, 7, 3] for more information. Porting random number generators written in C or another high-level language to Tcl is easy, as long as you do not use unsigned integer arithmetic -- Tcl uses only signed integers. You should test any RNG that you write, using Knuth's [2] tests. In addition, you might want to perform tests to make sure that the random number streams used in two different runs of the target program are not correlated with each other.

Drone's internal random number generator for generating run seeds is initialized using the experimentSeed parameter, in the routine InitRNG; if this is not specified in the control file, or is set to an empty string, the experiment seed is computed by multiplying the current value of the system clock (in seconds) times Drone's process ID. An experiment may be replicated exactly simply by using the output control file, or by using the original control file with experimentSeed set to the original experiment's seed. Similarly, a new experiment may be run using the same parameters but different seeds by specifying a different experimentSeed. The routine GetRunSeed returns a run seed for each run.

The best way of doing multiple runs would be for the target program to implement a random number generator with splitting facilities [3]. This would guarantee that each run in a case uses distinct, non-overlapping random number streams. Drone does not yet implement this option. The current method, generating seeds using an internal RNG, seems to be quite adequate in general.


next up previous contents
Next: Password Security Up: INTERNAL OPERATION Previous: INTERNAL OPERATION

Drone 1.01 User's Guide
Theodore C. Belding
Wed Nov 13 03:53:22 EST 1996