|
@@ -60,9 +60,7 @@ public:
|
|
///
|
|
///
|
|
/// \param min The minimum number in the range
|
|
/// \param min The minimum number in the range
|
|
/// \param max The maximum number in the range
|
|
/// \param max The maximum number in the range
|
|
- /// \param seed A seed for the RNG. If 0 is passed, the current time
|
|
|
|
- /// is used.
|
|
|
|
- UniformRandomIntegerGenerator(int min, int max, unsigned int seed = 0):
|
|
|
|
|
|
+ UniformRandomIntegerGenerator(int min, int max):
|
|
min_(std::min(min, max)), max_(std::max(min, max)),
|
|
min_(std::min(min, max)), max_(std::max(min, max)),
|
|
dist_(min_, max_), generator_(rng_, dist_)
|
|
dist_(min_, max_), generator_(rng_, dist_)
|
|
{
|
|
{
|
|
@@ -75,10 +73,7 @@ public:
|
|
}
|
|
}
|
|
|
|
|
|
// Init with the current time
|
|
// Init with the current time
|
|
- if (seed == 0) {
|
|
|
|
- seed = time(NULL);
|
|
|
|
- }
|
|
|
|
- rng_.seed(seed);
|
|
|
|
|
|
+ rng_.seed(time(NULL));
|
|
}
|
|
}
|
|
|
|
|
|
/// \brief Generate uniformly distributed integer
|
|
/// \brief Generate uniformly distributed integer
|