Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
soar_rand.cpp
Go to the documentation of this file.
1 #include <portability.h>
2 
3 #include "soar_rand.h"
4 
6 
7 // real number in [0,1]
8 double SoarRand()
9 { return gSoarRand.rand(); }
10 
11 // real number in [0,n]
12 double SoarRand(const double& max)
13 { return gSoarRand.rand(max); }
14 
15 // integer in [0,2^32-1]
17 { return gSoarRand.randInt(); }
18 
19 // integer in [0,n] for n < 2^32
21 { return gSoarRand.randInt(max); }
22 
23 
24 // automatically seed with a value based on the time or /dev/urandom
26 { gSoarRand.seed(); }
27 
28 // seed with a provided value
29 void SoarSeedRNG(const uint32_t seed)
30 { gSoarRand.seed(seed); }