Soar Kernel
9.3.2 08-06-12
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
src
soar_rand.cpp
Go to the documentation of this file.
1
#include <portability.h>
2
3
#include "
soar_rand.h
"
4
5
static
MTRand
gSoarRand
;
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]
16
uint32_t
SoarRandInt
()
17
{
return
gSoarRand.
randInt
(); }
18
19
// integer in [0,n] for n < 2^32
20
uint32_t
SoarRandInt
(
const
uint32_t
& max)
21
{
return
gSoarRand.
randInt
(max); }
22
23
24
// automatically seed with a value based on the time or /dev/urandom
25
void
SoarSeedRNG
()
26
{ gSoarRand.
seed
(); }
27
28
// seed with a provided value
29
void
SoarSeedRNG
(
const
uint32_t
seed)
30
{ gSoarRand.
seed
(seed); }
Generated on Mon Aug 6 2012 17:21:02 for Soar Kernel by
1.8.1.2