OMNeT++ Simulation Library  6.0.3
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 
51  virtual void initialize(int seedSet, int rngId, int numRngs,
52  int parsimProcId, int parsimNumPartitions,
53  cConfiguration *cfg) override;
54 
56  virtual void selfTest() override;
57 
59  virtual uint32_t intRand() override;
60 
62  virtual uint32_t intRandMax() override;
63 
65  virtual uint32_t intRand(uint32_t n) override;
66 
68  virtual double doubleRand() override;
69 
71  virtual double doubleRandNonz() override;
72 
74  virtual double doubleRandIncl1() override;
75 };
76 
77 } // namespace omnetpp
78 
79 
80 #endif
81 
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