33 #ifdef DEBUG_RANDCALLS
34 std::map<std::mt19937*, int> RandHelper::myCallCount;
35 std::map<std::mt19937*, int> RandHelper::myRngId;
36 int RandHelper::myDebugIndex(7);
51 oc.
addDescription(
"random",
"Random Number",
"Initialises the random number generator with the current system time");
55 oc.
addDescription(
"seed",
"Random Number",
"Initialises the random number generator with the given value");
61 if (which ==
nullptr) {
64 #ifdef DEBUG_RANDCALLS
65 myRngId[which] = myRngId.size();
68 which->seed((
unsigned long)time(
nullptr));
A storage for options typed value containers)
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
static void initRand(std::mt19937 *which=nullptr, const bool random=false, const int seed=23423)
Initialises the random number generator with hardware randomness or seed.
static void initRandGlobal(std::mt19937 *which=nullptr)
Reads the given random number options and initialises the random number generator in accordance.
static void insertRandOptions()
Initialises the given options container with random number options.
static std::mt19937 myRandomNumberGenerator
the random number generator to use