-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Hi.
There are multiple places where you don't respect the user-provided seed in parameters.seed
bipopcmastrategy.cc
Lines 37 + 54 have this:
_gen = std::mt19937(rd());
_gen.seed(static_cast<uint64_t>(time(nullptr)));
esostrategy, Line 56 + 71 same problem
std::random_device rd;
_uhgen = std::mt19937(rd());
_uhunif = std::uniform_real_distribution<>(0,1);
I think this is also problematic in cmasolutions.cc
This calls into the RNG of Eigen, which I think uses rand()
and is hence also not seeded
if (p._x0min == p._x0max) {
if (p._x0min == dVec::Constant(p._dim,-std::numeric_limits<double>::max()))
_xmean = dVec::Random(p._dim) * 4.0; // initial mean randomly sampled from -4,4 in all dimensions.
else _xmean = p._x0min;
} else {
_xmean = 0.5*(dVec::Random(p._dim) + dVec::Constant(p._dim,1.0)); // scale to [0,1].
_xmean = _xmean.cwiseProduct(p._x0max - p._x0min) + p._x0min; // scale to bounds.
}
Metadata
Metadata
Assignees
Labels
No labels