Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-12-24 05:37:17


Hossein Haeri wrote:

> Using the following (slightly manipulated) sample code
> of Boost.Random, I'm always gettig the same sequence:
>
> boost::mt19937 rng;
> boost::uniform_int<> six(1,6);
> boost::variate_generator<boost::mt19937,
> boost::uniform_int<> >
> die(rng, six);
> for(size_t i = 0; i < 10; ++i)
> cout << die() << " ";
>
> I know that this is the consequence of the fact that
> the generators are deterministic ones, plus another
> fact that they start using the same seed.
>
> This behaviour, however, is not that much desirable,
> and I'm seaking some sort of good random seed. Any
> suggestions?

See:

   http://article.gmane.org/gmane.comp.lib.boost.user/8288/

for some suggestsions.

HTH,
Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net