A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::TestRandomStream Class Reference

#include <random-stream.h>

+ Inheritance diagram for ns3::TestRandomStream:
+ Collaboration diagram for ns3::TestRandomStream:

Public Member Functions

void AddNext (uint32_t v)
 Add the given value to the list. More...
 
virtual int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
virtual uint32_t GetNext (uint32_t min, uint32_t max)
 Get integer between min and max (including min and max). More...
 
- Public Member Functions inherited from ns3::RandomStream
virtual ~RandomStream ()
 

Private Attributes

std::list< uint32_t > m_nexts
 

Detailed Description

Definition at line 78 of file random-stream.h.

Member Function Documentation

void ns3::TestRandomStream::AddNext ( uint32_t  v)

Add the given value to the list.

Parameters
v

Definition at line 51 of file random-stream.cc.

References m_nexts.

int64_t ns3::TestRandomStream::AssignStreams ( int64_t  stream)
virtual

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Implements ns3::RandomStream.

Definition at line 66 of file random-stream.cc.

uint32_t ns3::TestRandomStream::GetNext ( uint32_t  min,
uint32_t  max 
)
virtual

Get integer between min and max (including min and max).

Parameters
minlower bound (inclusive)
maxupper bound (inclusive)
Returns
a random number between min and max (including min and max)

Implements ns3::RandomStream.

Definition at line 57 of file random-stream.cc.

References m_nexts, and NS_ASSERT.

Member Data Documentation

std::list<uint32_t> ns3::TestRandomStream::m_nexts
private

Definition at line 100 of file random-stream.h.

Referenced by AddNext(), and GetNext().


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