OMNeT++ API
6.2.0
Discrete Event Simulation Library
cmersennetwister.h
1
//==========================================================================
2
// CMERSENNETWISTER.CC - part of
3
// OMNeT++/OMNEST
4
// Discrete System Simulation in C++
5
//
6
//==========================================================================
7
8
/*--------------------------------------------------------------*
9
Copyright (C) 2002-2017 Andras Varga
10
Copyright (C) 2006-2017 OpenSim Ltd.
11
12
This file is distributed WITHOUT ANY WARRANTY. See the file
13
`license' for details on this and other legal matters.
14
*--------------------------------------------------------------*/
15
16
#ifndef __OMNETPP_CMERSENNETWISTER_H
17
#define __OMNETPP_CMERSENNETWISTER_H
18
19
#include "simkerneldefs.h"
20
#include "globals.h"
21
#include "crng.h"
22
#include "cconfiguration.h"
23
#include "mersennetwister.h"
24
25
namespace
omnetpp {
26
27
41
class
SIM_API
cMersenneTwister
:
public
cRNG
42
{
43
protected
:
44
MTRand rng;
45
46
public
:
47
cMersenneTwister
() {}
48
virtual
~
cMersenneTwister
() {}
49
50
virtual
std::string str()
const override
;
51
53
virtual
void
initialize(
int
seedSet,
int
rngId,
int
numRngs,
54
int
parsimProcId,
int
parsimNumPartitions,
55
cConfiguration
*cfg)
override
;
56
58
virtual
void
selfTest()
override
;
59
61
virtual
uint32_t intRand()
override
;
62
64
virtual
uint32_t intRandMax()
override
;
65
67
virtual
uint32_t intRand(uint32_t n)
override
;
68
70
virtual
double
doubleRand()
override
;
71
73
virtual
double
doubleRandNonz()
override
;
74
76
virtual
double
doubleRandIncl1()
override
;
77
};
78
79
}
// namespace omnetpp
80
81
82
#endif
83
omnetpp::cConfiguration
Represents the configuration, as accessed by the simulation kernel.
Definition:
cconfiguration.h:76
omnetpp::cMersenneTwister
Wraps the Mersenne Twister RNG by Makoto Matsumoto and Takuji Nishimura.
Definition:
cmersennetwister.h:41
omnetpp::cRNG
Abstract interface for random number generator classes.
Definition:
crng.h:48
include
omnetpp
cmersennetwister.h
Generated by
1.8.17