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 ()
 Constructs an exponential random variable with a mean value of 1.0. More...
 
 ExponentialVariableImpl (double m)
 Constructs an exponential random variable with a specified mean. More...
 
 ExponentialVariableImpl (double m, double b)
 Constructs an exponential random variable with specified mean and upper limit. More...
 
 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 521 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 563 of file random-variable.cc.

References NS_LOG_FUNCTION.

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 570 of file random-variable.cc.

References NS_LOG_FUNCTION.

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 577 of file random-variable.cc.

References NS_LOG_FUNCTION.

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

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

References NS_LOG_FUNCTION.

Member Function Documentation

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

Implements ns3::RandomVariableBase.

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

References ExponentialVariableImpl(), and NS_LOG_FUNCTION.

+ 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 592 of file random-variable.cc.

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

+ Here is the call graph for this function:

Member Data Documentation

double ns3::ExponentialVariableImpl::m_bound
private

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

Referenced by GetValue().

double ns3::ExponentialVariableImpl::m_mean
private

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

Referenced by GetValue().


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