OMNeT++ Simulation Library  5.6.1
cLCG32 Class Reference

#include <clcg32.h>

Description

Implements a 32-bit (2^31-2 cycle length) linear congruential random number generator.

  • Range: 1 ... 2^31-2
  • Period length: 2^31-2
  • Method: x=(x * 7^5) mod (2^31-1)
  • Required hardware: exactly 32-bit integer aritmetics
  • To check: if x[0]=1 then x[10000]=1,043,618,065

Source: Raj Jain: The Art of Computer Systems Performance Analysis (John Wiley & Sons, 1991) pp 441-444, 455.

Inheritance diagram for cLCG32:
cRNG cObject

Public Member Functions

virtual void initialize (int seedSet, int rngId, int numRngs, int parsimProcId, int parsimNumPartitions, cConfiguration *cfg) override
 
virtual void selfTest () override
 
virtual unsigned long intRand () override
 
virtual unsigned long intRandMax () override
 
virtual unsigned long intRand (unsigned long n) override
 
virtual double doubleRand () override
 
virtual double doubleRandNonz () override
 
virtual double doubleRandIncl1 () override
 
- Public Member Functions inherited from cRNG
virtual unsigned long getNumbersDrawn () const
 
double doubleRandNonzIncl1 ()
 
- Public Member Functions inherited from cObject
 cObject ()
 
 cObject (const cObject &other)
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
virtual const char * getName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
const cObjectgetThisPtr () const
 
virtual std::string str () const
 
virtual _OPPDEPRECATED std::string info () const
 
virtual _OPPDEPRECATED std::string detailedInfo () const
 
virtual cObjectdup () const
 
virtual void parsimPack (cCommBuffer *buffer) const
 
virtual void parsimUnpack (cCommBuffer *buffer)
 
virtual cObjectgetOwner () const
 
virtual bool isOwnedObject () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
void copyNotSupported () const
 

Additional Inherited Members

- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Member Function Documentation

◆ initialize()

virtual void initialize ( int  seedSet,
int  rngId,
int  numRngs,
int  parsimProcId,
int  parsimNumPartitions,
cConfiguration cfg 
)
overridevirtual

Sets up the RNG.

Implements cRNG.

◆ selfTest()

virtual void selfTest ( )
overridevirtual

Tests correctness of the RNG

Implements cRNG.

◆ intRand() [1/2]

virtual unsigned long intRand ( )
overridevirtual

Random integer in the range [0,intRandMax()]

Implements cRNG.

◆ intRandMax()

virtual unsigned long intRandMax ( )
overridevirtual

Maximum value that can be returned by intRand()

Implements cRNG.

◆ intRand() [2/2]

virtual unsigned long intRand ( unsigned long  n)
overridevirtual

Random integer in [0,n), n < intRandMax()

Implements cRNG.

◆ doubleRand()

virtual double doubleRand ( )
overridevirtual

Random double on the [0,1) interval

Implements cRNG.

◆ doubleRandNonz()

virtual double doubleRandNonz ( )
overridevirtual

Random double on the (0,1) interval

Implements cRNG.

◆ doubleRandIncl1()

virtual double doubleRandIncl1 ( )
overridevirtual

Random double on the [0,1] interval

Implements cRNG.


The documentation for this class was generated from the following file: