cIRngManager Class Reference¶
|
API
|
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 cRNG * | getRng (const cComponent *component, int k)=0 |
| virtual uint32_t | getHash () const =0 |
Access to the global RNGs. | |
| virtual int | getTotalNumRngs () const =0 |
| virtual cRNG * | getGlobalRng (int rngId)=0 |
| Public Member Functions inherited from cNoncopyableOwnedObject | |
| cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true) | |
| virtual cNoncopyableOwnedObject * | dup () const override |
| Public Member Functions inherited from cOwnedObject | |
| cOwnedObject () | |
| cOwnedObject (const char *name, bool namepooling=true) | |
| cOwnedObject (const cOwnedObject &obj) | |
| virtual | ~cOwnedObject () |
| cOwnedObject & | operator= (const cOwnedObject &o) |
| virtual cObject * | getOwner () 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 () |
| cNamedObject & | operator= (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 cObject * | getThisPtr () const |
| virtual std::string | str () const |
| virtual std::ostream & | printOn (std::ostream &os) const |
| virtual bool | isSoftOwner () const |
| virtual void | forEachChild (cVisitor *v) |
| cObject * | findObject (const char *name, bool deep=true) |
| virtual cClassDescriptor * | getDescriptor () const |
| void | copyNotSupported () const |
Additional Inherited Members | |
| Static Public Member Functions inherited from cOwnedObject | |
| static long | getTotalObjectCount () |
| static long | getLiveObjectCount () |
| static void | resetObjectCounters () |
| static cSoftOwner * | getOwningContext () |
| 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()
|
inline |
Constructor.
◆ ~cIRngManager()
|
virtual |
Destructor.
Member Function Documentation
◆ configure()
|
pure virtual |
Initializes the RNG manager from the given configuration. Called during simulation setup, before the network is built.
Implemented in cRngManager.
◆ configureRngs()
|
pure virtual |
Sets up RNG access for the given component. Called during component initialization.
Implemented in cRngManager.
◆ getNumRngs()
|
pure virtual |
Returns the number of RNGs available for the given component.
Implemented in cRngManager.
◆ getRng()
|
pure virtual |
Returns the RNG instance for the given component and local RNG index k.
Implemented in cRngManager.
◆ getHash()
|
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()
|
pure virtual |
Returns the total number of global RNG instances.
Implemented in cRngManager.
◆ getGlobalRng()
|
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.
Generated on for API by