A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::DeterministicVariable Class Reference

a non-random variableDefines a random variable that has a specified, predetermined sequence. More...

#include <random-variable.h>

+ Inheritance diagram for ns3::DeterministicVariable:
+ Collaboration diagram for ns3::DeterministicVariable:

Public Member Functions

 DeterministicVariable (double *d, uint32_t c)
 Constructor. More...
 
- Public Member Functions inherited from ns3::RandomVariable
 RandomVariable ()
 
 RandomVariable (const RandomVariable &o)
 
 ~RandomVariable ()
 
uint32_t GetInteger (void) const
 Returns a random integer integer from the underlying distribution. More...
 
double GetValue (void) const
 Returns a random double from the underlying distribution. More...
 
RandomVariableoperator= (const RandomVariable &o)
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::RandomVariable
 RandomVariable (const RandomVariableBase &variable)
 
RandomVariableBasePeek (void) const
 

Detailed Description

a non-random variable

Defines a random variable that has a specified, predetermined sequence.

This would be useful when trying to force the RNG to return a known sequence, perhaps to compare NS-3 to some other simulator

Definition at line 507 of file random-variable.h.

Constructor & Destructor Documentation

ns3::DeterministicVariable::DeterministicVariable ( double *  d,
uint32_t  c 
)
explicit

Constructor.

Creates a generator that returns successive elements of the d array on successive calls to RandomVariable::GetValue. Note that the d pointer is copied for use by the generator (shallow-copy), not its contents, so the contents of the array d points to have to remain unchanged for the use of DeterministicVariable to be meaningful.

Parameters
dPointer to array of random values to return in sequence
cNumber of values in the array

Definition at line 1414 of file random-variable.cc.

References NS_LOG_FUNCTION.


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