next up previous contents index
Next: Verbosity Up: Options for all programs Previous: Listing options   Contents   Index

Random Number Seed

Many of the simulation programs make use of a pseudo-random number generator that requires a seed. If none is provided, the number of seconds since some date in the past is used. The -s option allows you to specify a seed for the random number generator. You can use this to repeat simulations to see if the same answers are obtained. If you don't use this option, the random number seed is set to the number of seconds since some arbitrary past date (for example, 1 January 1970 for Sun Workstations). The random number seed is printed to the output files of the programs on the first line. This means that if you don't specify a random number seed, each file should have a unique identifier associated with it. This identifier will also be written to the log file.

If you run a shell script loop on a really fast machine, each turn of the loop may take less than one second. This can be important if you are using the default random number seed, in that separate invocations of the program in a loop might get the same random number seed. For example, consider the pseudo code to produce 1,000 simulated data sets:




$i = 1$
while $( i < 1000 )$ {
Rcross -A -V -o qtlcart.cro.$i
$i = i + 1$
}




It is possible that each loop in the above code could take a fraction a second, and groups of output files would then be identical. You would want to put a sleep command in the loop to avoid this problem.


next up previous contents index
Next: Verbosity Up: Options for all programs Previous: Listing options   Contents   Index
Christopher Basten 2002-03-27