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

Return a sequential list of valuesClass SequentialVariable defines a random number generator that returns a sequential sequence. The sequence monotonically increases for a period, then wraps around to the low value and begins monotonically increasing again. More...

#include <random-variable.h>

+ Inheritance diagram for ns3::SequentialVariable:

Public Member Functions

 SequentialVariable (double f, double l, double i=1, uint32_t c=1)
 Constructor for the SequentialVariable RNG. More...
 
 SequentialVariable (double f, double l, const RandomVariable &i, uint32_t c=1)
 Constructor for the SequentialVariable RNG. More...
 
- Public Member Functions inherited from ns3::RandomVariable
 RandomVariable (const RandomVariable &o)
 
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

Return a sequential list of values

Class SequentialVariable defines a random number generator that returns a sequential sequence. The sequence monotonically increases for a period, then wraps around to the low value and begins monotonically increasing again.

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

Constructor & Destructor Documentation

ns3::SequentialVariable::SequentialVariable ( double  f,
double  l,
double  i = 1,
uint32_t  c = 1 
)

Constructor for the SequentialVariable RNG.

The four parameters define the sequence. For example SequentialVariable(0,5,1,2) creates a RNG that has the sequence 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 0 ...

Parameters
fFirst value of the sequence.
lOne more than the last value of the sequence.
iIncrement between sequence values
cNumber of times each member of the sequence is repeated

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

References NS_LOG_FUNCTION.

ns3::SequentialVariable::SequentialVariable ( double  f,
double  l,
const RandomVariable i,
uint32_t  c = 1 
)

Constructor for the SequentialVariable RNG.

Differs from the first only in that the increment parameter is a random variable

Parameters
fFirst value of the sequence.
lOne more than the last value of the sequence.
iReference to a RandomVariable for the sequence increment
cNumber of times each member of the sequence is repeated

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

References NS_LOG_FUNCTION.


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