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);
static std::string version()
Get version number.
Definition: evocommon.h:146
static std::string g_version
Version number.
Definition: evocommon.h:130
uint32_t get_seed()
get seed value
Definition: evocommon.h:94
~prng()
Destructor.
Definition: evocommon.h:82
A toolkit and framework for implementing evolutionary algorithms.
Definition: analyzer.h:60
The random number generator used by Evocosm.
Definition: evocommon.h:69
Elements shared by all classes in Evocosm.
Definition: evocommon.h:117
static uint32_t get_seed()
Set the seed for the random number generator.
Definition: evocommon.h:140
static prng g_random
A shared random number generator.
Definition: evocommon.h:127
prng()
Constructor.
Definition: evocommon.h:76
static void set_seed(uint32_t a_seed)
Set the seed for the random number generator.
Definition: evocommon.h:134
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
double get_real()
get the next value in the range [0,1)
Definition: evocommon.h:106
void set_seed(uint32_t a_seed)
Set the seed for the random number generator.
Definition: evocommon.h:88
size_t get_index(size_t n)
get a random index value
Definition: evocommon.h:100