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>
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... | |
![]() | |
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... | |
RandomVariable & | operator= (const RandomVariable &o) |
Additional Inherited Members | |
![]() | |
RandomVariable (const RandomVariableBase &variable) | |
RandomVariableBase * | Peek (void) const |
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.
ns3::ConstantVariable::ConstantVariable | ( | ) |
Construct a ConstantVariable RNG that returns zero every sample.
Definition at line 376 of file random-variable.cc.
References NS_LOG_FUNCTION.
Referenced by SetConstant().
ns3::ConstantVariable::ConstantVariable | ( | double | c | ) |
Construct a ConstantVariable RNG that returns the specified value every sample.
c | Unchanging value for this RNG. |
Definition at line 381 of file random-variable.cc.
References NS_LOG_FUNCTION.
void ns3::ConstantVariable::SetConstant | ( | double | c | ) |
Specify a new constant RNG for this generator.
c | New constant value for this RNG. |
Definition at line 387 of file random-variable.cc.
References ConstantVariable(), and NS_LOG_FUNCTION.