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

A random variable that returns a constantClass ConstantVariable defines a random number generator that returns the same value every sample. More...

#include <random-variable.h>

+ Inheritance diagram for ns3::ConstantVariable:
+ Collaboration diagram for ns3::ConstantVariable:

Public Member Functions

 ConstantVariable ()
 Construct a ConstantVariable RNG that returns zero every sample. More...
 
 ConstantVariable (double c)
 Construct a ConstantVariable RNG that returns the specified value every sample. More...
 
void SetConstant (double c)
 Specify a new constant RNG for this generator. 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 random variable that returns a constant

Class ConstantVariable defines a random number generator that returns the same value every sample.

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

Constructor & Destructor Documentation

ns3::ConstantVariable::ConstantVariable ( )

Construct a ConstantVariable RNG that returns zero every sample.

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

References NS_LOG_FUNCTION.

Referenced by SetConstant().

+ Here is the caller graph for this function:

ns3::ConstantVariable::ConstantVariable ( double  c)

Construct a ConstantVariable RNG that returns the specified value every sample.

Parameters
cUnchanging value for this RNG.

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

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::ConstantVariable::SetConstant ( double  c)

Specify a new constant RNG for this generator.

Parameters
cNew constant value for this RNG.

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

References ConstantVariable(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:


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