A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::ExponentialVariableImpl Class Reference
+ Inheritance diagram for ns3::ExponentialVariableImpl:
+ Collaboration diagram for ns3::ExponentialVariableImpl:

Public Member Functions

 ExponentialVariableImpl ()
 ExponentialVariableImpl (double m)
 Constructs an exponential random variable with a specified mean.
 ExponentialVariableImpl (double m, double b)
 Constructs an exponential random variable with specified mean and upper limit.
 ExponentialVariableImpl (const ExponentialVariableImpl &c)
virtual RandomVariableBaseCopy (void) const
virtual double GetValue ()
- Public Member Functions inherited from ns3::RandomVariableBase
 RandomVariableBase ()
 RandomVariableBase (const RandomVariableBase &o)
virtual ~RandomVariableBase ()
virtual uint32_t GetInteger ()
RngStreamGetStream (void)

Private Attributes

double m_bound
double m_mean

Detailed Description

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

Constructor & Destructor Documentation

ns3::ExponentialVariableImpl::ExponentialVariableImpl ( )

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

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

Referenced by Copy().

+ Here is the caller graph for this function:

ns3::ExponentialVariableImpl::ExponentialVariableImpl ( double  m)
explicit

Constructs an exponential random variable with a specified mean.

Parameters
mMean value for the random variable

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

ns3::ExponentialVariableImpl::ExponentialVariableImpl ( 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: $ m - b/(e^{b/m}-1) $.

Parameters
mMean value of the random variable
bUpper bound on returned values

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

ns3::ExponentialVariableImpl::ExponentialVariableImpl ( const ExponentialVariableImpl c)

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

Member Function Documentation

RandomVariableBase * ns3::ExponentialVariableImpl::Copy ( void  ) const
virtual

Implements ns3::RandomVariableBase.

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

References ExponentialVariableImpl().

+ Here is the call graph for this function:

double ns3::ExponentialVariableImpl::GetValue ( void  )
virtual
Returns
A random value from this exponential distribution

Implements ns3::RandomVariableBase.

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

References ns3::RandomVariableBase::GetStream(), m_bound, m_mean, and ns3::RngStream::RandU01().

+ Here is the call graph for this function:

Member Data Documentation

double ns3::ExponentialVariableImpl::m_bound
private

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

Referenced by GetValue().

double ns3::ExponentialVariableImpl::m_mean
private

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

Referenced by GetValue().


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