Re: What is best way to set_rand?
- Posted by mattlewis (admin) Jan 24, 2013
- 1293 views
I want to use two values as seeds for set_rand. How many bit these values have in width? What is best way to use hashes (of external data) as seeds?
atom Hash1 = hash(data1, ALGORITHM) atom Hash2 = hash(data2, ALGORITHM) set_rand({Hash1, Hash2})
It is correct? What ALGORITHM is better in this case? HSIEH30 or something 32-bit? 64-bit? More? When I put a line to set_rand, in what it turns? HSIEH32?
What are you trying to do? Normally, the only reason to set the random seed is to get consistent results in a simulation, or something like that.
I don't think it really matters how you go about picking a seed. The seed doesn't affect the "randomness" of the sequence of random numbers. It just gives you the ability to get a consistent sequence subject to the pseudo random algorithm that's used.
The seeds are all 32-bits, regardless of platform.
Matt