lundi 27 mars 2017

Optimal seed for Mersenne Twister in C++ 11

My use case is : i need random numbers , but just for graphics (not for cryptography). I need to be able to get the same image (result) for 2 renderings /runs. For example using time() as seed would not create the same result for the next run. So i need a -constant- seed. The documentation for the mersenne twister says that it does not like 0 as seed, it also dislikes certain bit combinations. For such cases it is said to take up to 800000 calls until it delivers good random numbers again. For speed reasons i dont want to spend the overhead of 800000 calls. Ideally i would need some nice and trusted value(s) that i can use as seed directly.




Aucun commentaire:

Enregistrer un commentaire