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

EmpiricalVariable distribution random varDefines a random variable that has a specified, empirical distribution. More...

`#include <random-variable.h>`

Inheritance diagram for ns3::EmpiricalVariable:
Collaboration diagram for ns3::EmpiricalVariable:

## Public Member Functions

EmpiricalVariable ()
Constructor for the EmpiricalVariable random variables. More...

void CDF (double v, double c)
Specifies a point in the empirical distribution. 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)

## Protected Member Functions

EmpiricalVariable (const RandomVariableBase &variable)

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

RandomVariableBasePeek (void) const

## Detailed Description

EmpiricalVariable distribution random var

Defines a random variable that has a specified, empirical distribution.

The distribution is specified by a series of calls to the CDF member function, specifying a value and the probability that the function value is less than the specified value. When values are requested, a uniform random variable is used to select a probability, and the return value is interpreted linearly between the two appropriate points in the CDF. The method is known as inverse transform sampling: (http://en.wikipedia.org/wiki/Inverse_transform_sampling).

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

## Constructor & Destructor Documentation

 ns3::EmpiricalVariable::EmpiricalVariable ( )
explicit

Constructor for the EmpiricalVariable random variables.

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

References NS_LOG_FUNCTION.

 ns3::EmpiricalVariable::EmpiricalVariable ( const RandomVariableBase & variable )
protected

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

References NS_LOG_FUNCTION.

## Member Function Documentation

 void ns3::EmpiricalVariable::CDF ( double v, double c )

Specifies a point in the empirical distribution.

Parameters
 v The function value for this point c Probability that the function is less than or equal to v

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

Here is the call graph for this function:

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