This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RN generators Seed


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 26 August 2003 09:28, Jeff Spirko wrote:

> I don't know the exact answer to your question, but I do have some
> suggestions.  I often use the current time in seconds to seed an
> RNG.  There is a slight problem with this.  If one simulation (or in
> my case, setting up a simulation) takes less than a second, two runs
> may use the same seed.  I ended up switching to using the bash
> shell's $RANDOM variable.  It's limited to 16-bits, but it could be
> combined with the time to get a better starting seed.

why don't you use /dev/random for the seed? This should give you completely 
random runs, no matter how close they are in time.

		nick
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/S2M0f1nNyq3gDhkRArkoAJ0TDY3m0cAKf6VGvFDi601mX0X98wCfbW1q
7udrcTxcuvO2LH3JXOjZ5JY=
=habO
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]