Jer?nimo Alaminos Prats <alaminospr at gmail.com> wrote:
Thank you Jaime, I didn't notice that you need that. Just out of
curiosity, is there any reason for this need to initialize the random
number generator? For me, the usual behavior of "random" anywhere is
to obtain a random number.
Suppose you write a program that uses random somewhere, perhaps even a
program with a test suite. You encounter a bug, fix it, and rerun the
failing case or the test suite itself. No failure this time? You must
have fixed the bug.
Maybe, maybe not.
A random number generator that cannot be initialized to geneerate the
same sequence with each execution is a vary dangerous tool. In a
different way, so is a random number generator that cannot be
reinitialized to some pseudo-random new point in its sequence. Either
way, it's good that the programmer is forced to think about which he
wants in some particular context.