A Discrete-Event Network Simulator Home Tutorials  ▼ Docs    ▼ Develop ▼ API
ns3::ExponentialVariable Class Reference

Exponentially Distributed random varThis class supports the creation of objects that return random numbers from a fixed exponential distribution. It also supports the generation of single random numbers from various exponential distributions. More...

#include <random-variable.h>

Inheritance diagram for ns3::ExponentialVariable:

## Public Member Functions

ExponentialVariable ()

ExponentialVariable (double m)
Constructs an exponential random variable with a specified mean. More...

ExponentialVariable (double m, double b)
Constructs an exponential random variable with specified mean and upper limit. 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)

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

RandomVariableBasePeek (void) const

## Detailed Description

Exponentially Distributed random var

This class supports the creation of objects that return random numbers from a fixed exponential distribution. It also supports the generation of single random numbers from various exponential distributions.

The probability density function of an exponential variable is defined over the interval [0, +inf) as: where

The bounded version is defined over the interval [0,b] as: . Note that in this case the true mean is

x.GetValue (); //will always return with mean 3.14

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

## Constructor & Destructor Documentation

 ns3::ExponentialVariable::ExponentialVariable ( )

Constructs an exponential random variable with a mean value of 1.0.

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

References NS_LOG_FUNCTION.

 ns3::ExponentialVariable::ExponentialVariable ( double m )
explicit

Constructs an exponential random variable with a specified mean.

Parameters
 m Mean value for the random variable

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

References NS_LOG_FUNCTION.

 ns3::ExponentialVariable::ExponentialVariable ( double m, double b )

Constructs an exponential random variable with specified mean and upper limit.

Since exponential distributions can theoretically return unbounded values, it is sometimes useful to specify a fixed upper limit. Note however when the upper limit is specified, the true mean of the distribution is slightly smaller than the mean value specified: .

Parameters
 m Mean value of the random variable b Upper bound on returned values

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

References NS_LOG_FUNCTION.

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