59 static std::mt19937 Generator_;
66 std::uniform_int_distribution< Idx > uni_int(0,
int(max) - 1);
72 std::uniform_real_distribution uni_real(0.0, 1.0);
78 if (seed == 0) seed = (
unsigned int)std::chrono::system_clock::now().time_since_epoch().count();
79 std::seed_seq seq{seed + 1, seed + 2, seed + 3, seed + 4, seed + 5};
90 return (
unsigned int)((GUM_RANDOMSEED == 0)
91 ? std::chrono::system_clock::now().time_since_epoch().count()
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Idx randomValue(const Size max=2)
Returns a random Idx between 0 and max-1 included.
unsigned int randomGeneratorSeed()
Returns the aGrUM's seed used by the std::generators.
void initRandom(unsigned int seed=0)
Initialize random generator seed.
std::mt19937 & randomGenerator()
define a random_engine with correct seed
unsigned int currentRandomGeneratorValue()
returns the current generator's value
double randomProba()
Returns a random double between 0 and 1 included (i.e.
std::mt19937 & generator()
gum is the global namespace for all aGrUM entities
Contains useful methods for random stuff.