cIRngManager Class Reference

API: cIRngManager Class Reference
API
cIRngManager Class Referenceabstract
Inheritance diagram for cIRngManager:
[legend]

Public Member Functions

Constructor, destructor.
 cIRngManager ()
virtual ~cIRngManager ()
Setting up and accessing RNGs.
virtual void configure (cConfiguration *cfg)=0
virtual void configureRngs (cComponent *component)=0
virtual int getNumRngs (const cComponent *component) const =0
virtual cRNGgetRng (const cComponent *component, int k)=0
virtual uint32_t getHash () const =0
Access to the global RNGs.
virtual int getTotalNumRngs () const =0
virtual cRNGgetGlobalRng (int rngId)=0
Public Member Functions inherited from cNoncopyableOwnedObject
 cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true)
virtual cNoncopyableOwnedObjectdup () const override
Public Member Functions inherited from cOwnedObject
 cOwnedObject ()
 cOwnedObject (const char *name, bool namepooling=true)
 cOwnedObject (const cOwnedObject &obj)
virtual ~cOwnedObject ()
cOwnedObjectoperator= (const cOwnedObject &o)
virtual cObjectgetOwner () const override
virtual bool isOwnedObject () const override
Public Member Functions inherited from cNamedObject
 cNamedObject ()
 cNamedObject (const char *name, bool namepooling=true)
 cNamedObject (const cNamedObject &obj)
virtual ~cNamedObject ()
cNamedObjectoperator= (const cNamedObject &o)
virtual void setName (const char *s)
virtual const char * getName () const override
virtual void setNamePooling (bool b)
virtual bool getNamePooling ()
Public Member Functions inherited from cObject
 cObject ()
 cObject (const cObject &other)=default
virtual ~cObject ()
virtual const char * getClassName () const
bool isName (const char *s) const
virtual const char * getFullName () const
virtual std::string getFullPath () const
virtual std::string getClassAndFullName () const
virtual std::string getClassAndFullPath () const
const cObjectgetThisPtr () const
virtual std::string str () const
virtual std::ostream & printOn (std::ostream &os) const
virtual bool isSoftOwner () const
virtual void forEachChild (cVisitor *v)
cObjectfindObject (const char *name, bool deep=true)
virtual cClassDescriptorgetDescriptor () const
void copyNotSupported () const

Additional Inherited Members

Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
static long getLiveObjectCount ()
static void resetObjectCounters ()
static cSoftOwnergetOwningContext ()
Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
virtual void drop (cOwnedObject *obj)
void dropAndDelete (cOwnedObject *obj)

Description

Abstract interface for managing random number generators (RNGs) for simulation components (modules and channels).

The RNG manager is responsible for setting up and providing access to RNG instances used during the simulation. It is consulted by cComponent's getRNG(k) to obtain the actual cRNG instance for a given local RNG index. The interface allows for RNG instances to be shared among components.

The RNG manager is pluggable: a custom implementation can be installed into cSimulation via setRngManager(). The default implementation is cRngManager.

See also
cRngManager, cRNG, cComponent::getRNG()

Constructor & Destructor Documentation

◆ cIRngManager()

cIRngManager ( )
inline

Constructor.

◆ ~cIRngManager()

virtual ~cIRngManager ( )
virtual

Destructor.

Member Function Documentation

◆ configure()

virtual void configure ( cConfiguration * cfg)
pure virtual

Initializes the RNG manager from the given configuration. Called during simulation setup, before the network is built.

Implemented in cRngManager.

◆ configureRngs()

virtual void configureRngs ( cComponent * component)
pure virtual

Sets up RNG access for the given component. Called during component initialization.

Implemented in cRngManager.

◆ getNumRngs()

virtual int getNumRngs ( const cComponent * component) const
pure virtual

Returns the number of RNGs available for the given component.

Implemented in cRngManager.

◆ getRng()

virtual cRNG * getRng ( const cComponent * component,
int k )
pure virtual

Returns the RNG instance for the given component and local RNG index k.

Implemented in cRngManager.

◆ getHash()

virtual uint32_t getHash ( ) const
pure virtual

Returns a hash value computed from the usage state of all RNGs (e.g. the number of random numbers drawn from each). Intended for use as a fingerprint ingredient.

Implemented in cRngManager.

◆ getTotalNumRngs()

virtual int getTotalNumRngs ( ) const
pure virtual

Returns the total number of global RNG instances.

Implemented in cRngManager.

◆ getGlobalRng()

virtual cRNG * getGlobalRng ( int rngId)
pure virtual

Returns the global RNG instance with the given index (0-based). Throws an error if rngId is out of range.

Implemented in cRngManager.