14#include <Poco/Timestamp.h>
49 : m_engine(), uniformRealDistribution(start, end), m_start(start), m_end(end), m_seed(), m_savedEngine() {
58 m_seed =
static_cast<std::mt19937::result_type
>(seedValue);
This implements the the Mersenne Twister 19937 pseudo-random number generator algorithm as a specialz...
void restore() override
Restores the generator to the last saved point, or the beginning if nothing has been saved.
std::uniform_real_distribution< double > uniformRealDistribution
Uniform Real distribution.
double m_end
Maximum in range.
MersenneTwister()
Construct the generator using time stamp for the initial seed.
void restart() override
Resets the generator.
void setSeed(const size_t seedValue) override
Set the random number seed.
void setRange(const double start, const double end) override
Sets the range of the subsequent calls to next.
double m_start
Minimum in range.
std::mt19937::result_type m_seed
The current seed.
std::mt19937 m_engine
The engine.
std::unique_ptr< std::mt19937 > m_savedEngine
A generator that will take the value when save is requested.
void save() override
Saves the current state of the generator.
int nextInt(int start, int end) override
Return the next integer in the sequence within the given range.