P
Philipp Kraus
Hi,
I'm implementating some algorithems with random data, so I must
initialisation the seed. But the code creates many objects of my class
so that the seed, which is set to
static_cast<std::time_t>(time(0)))
is in all objects the same and so I get in all objects the same "random
values".
My idea for solving this seed problem, ist to mix the time with the
object reference (*this).
Is this a good solution or do you know another algorithm? How can I
convert the reference to a numeric value?
Thanks
Phil
I'm implementating some algorithems with random data, so I must
initialisation the seed. But the code creates many objects of my class
so that the seed, which is set to
static_cast<std::time_t>(time(0)))
is in all objects the same and so I get in all objects the same "random
values".
My idea for solving this seed problem, ist to mix the time with the
object reference (*this).
Is this a good solution or do you know another algorithm? How can I
convert the reference to a numeric value?
Thanks
Phil