next up previous

3.2 Initial Seed

Now, we address establishing the initial seed. When debugging, it is important to implement the algorithm to reproduce the same stream of random numbers on successive runs. If the run is a debug run (noted, perhaps, by a parameter in the input file), the seed should be set to a constant initial value, such as a large prime number (it should be odd, as this will satisfy period conditions for any modulus). Otherwise, the initial seed should be set to a ``random'' odd value. Anderson [3] recommends setting the initial seed to the following integer:

where the variables on the right-hand side are the integer values of the date and time. Note that the year is 2 digits long, i.e. the domain of iyr is . However, we have found it preferable to introduce the maximum variation in the seed into the least significant bits by using the second of this century, rather than the most significant bits. Ergo, we prefer the following:

and, to ensure is odd (in FORTRAN):