53 #if !defined(LIBEVOCOSM_EVOCOMMON_H) 54 #define LIBEVOCOSM_EVOCOMMON_H 57 #include "libbrahe/prng.h" 72 brahe_prng_state_t m_random;
78 brahe_prng_init(&m_random,BRAHE_PRNG_MWC1038,0);
84 brahe_prng_free(&m_random);
90 brahe_prng_init(&m_random,BRAHE_PRNG_MWC1038,a_seed);
96 return m_random.m_seed;
102 return brahe_prng_index(&m_random,n);
108 return brahe_prng_real2(&m_random);
123 return g_random.get_index(n);
static void set_seed(uint32_t a_seed)
Set the seed for the random number generator.
Definition: evocommon.h:134
static std::string g_version
Version number.
Definition: evocommon.h:130
The random number generator used by Evocosm.
Definition: evocommon.h:69
size_t get_index(size_t n)
get a random index value
Definition: evocommon.h:100
A toolkit and framework for implementing evolutionary algorithms.
Definition: analyzer.h:60
void set_seed(uint32_t a_seed)
Set the seed for the random number generator.
Definition: evocommon.h:88
prng()
Constructor.
Definition: evocommon.h:76
static std::string version()
Get version number.
Definition: evocommon.h:146
static size_t rand_index(size_t n)
Static function to allow use of g_random function pointer in random_shuffle.
Definition: evocommon.h:121
static prng g_random
A shared random number generator.
Definition: evocommon.h:127
Elements shared by all classes in Evocosm.
Definition: evocommon.h:117
~prng()
Destructor.
Definition: evocommon.h:82
static uint32_t get_seed()
Set the seed for the random number generator.
Definition: evocommon.h:140
double get_real()
get the next value in the range [0,1)
Definition: evocommon.h:106
uint32_t get_seed()
get seed value
Definition: evocommon.h:94