cRngManager Class Reference¶
|
API
|
Public Member Functions | |
| cRngManager () | |
| virtual | ~cRngManager () |
Redefined cIRngManager methods. | |
| virtual void | configure (cConfiguration *cfg) override |
| virtual void | configureRngs (cComponent *component) override |
| virtual int | getNumRngs (const cComponent *component) const override |
| virtual cRNG * | getRng (const cComponent *component, int k) override |
| virtual uint32_t | getHash () const override |
| virtual int | getTotalNumRngs () const override |
| virtual cRNG * | getGlobalRng (int rngId) override |
| Public Member Functions inherited from cIRngManager | |
| cIRngManager () | |
| virtual | ~cIRngManager () |
| 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
The default implementation of cIRngManager.
cRngManager implements a two-level RNG access scheme. It creates a set of global (physical) RNG instances at simulation setup time, and each component (module or channel) accesses them through a configurable local-to-global index mapping. This mapping enables techniques such as variance reduction without requiring changes to model code.
Relevant configuration options:
- num-rngs: The number of global (physical) RNG instances to create.
- rng-class: The C++ class of the RNG to use (default: cMersenneTwister).
- seed-set: Selects the set of automatic seeds (default: ${runnumber}).
- <module-path>.rng-N = M: Maps local RNG index N to global RNG index M for matching modules/channels. The value may be an expression.
- seed-K-mt, seed-K-lcg32: Manual seed for global RNG K.
- See also
- cIRngManager, cRNG, cComponent::getRNG()
Constructor & Destructor Documentation
◆ cRngManager()
|
inline |
Constructor
◆ ~cRngManager()
|
virtual |
Destructor
Member Function Documentation
◆ configure()
|
overridevirtual |
Initializes the RNG manager from the given configuration. Called during simulation setup, before the network is built.
Implements cIRngManager.
◆ configureRngs()
|
overridevirtual |
Sets up RNG access for the given component. Called during component initialization.
Implements cIRngManager.
◆ getNumRngs()
|
overridevirtual |
Returns the number of RNGs available for the given component.
Implements cIRngManager.
◆ getRng()
|
overridevirtual |
Returns the RNG instance for the given component and local RNG index k.
Implements cIRngManager.
◆ getHash()
|
overridevirtual |
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.
Implements cIRngManager.
◆ getTotalNumRngs()
|
overridevirtual |
Returns the total number of global RNG instances.
Implements cIRngManager.
◆ getGlobalRng()
|
overridevirtual |
Returns the global RNG instance with the given index (0-based). Throws an error if rngId is out of range.
Implements cIRngManager.
Generated on for API by