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

Helper class for static methods involving RandomVariableStream. More...

#include <random-variable-stream-helper.h>

Static Public Member Functions

static int64_t AssignStreams (std::string path, int64_t stream)

Detailed Description

Helper class for static methods involving RandomVariableStream.

Definition at line 29 of file random-variable-stream-helper.h.

Member Function Documentation

int64_t ns3::RandomVariableStreamHelper::AssignStreams ( std::string  path,
int64_t  stream 

This helper method can be used to configure the stream number for one or more RNG streams. The path passed in should correspond to an attribute path in the configuration system. It may contain wildcards and may ultimately match zero, one, or more than one objects.

The objects to match are of type PointerValue where the underlying type is of type Ptr<RandomVariableStream>.

.AddAttribute ("Speed",
"A random variable used to pick the speed of a random waypoint model.",
MakePointerAccessor (&RandomWaypointMobilityModel::m_speed),
MakePointerChecker<RandomVariableStream> ())

Usage would look (for node 3) like this:

std::string path ("/$ns3::NodeListPriv/NodeList/3/$ns3::Node/$ns3::RandomWaypointMobilityModel/Speed/$ns3::UniformRandomVariable");
int64_t retVal = RandomVariableStreamHelper::AssignStreams (path, 0);
The number of streams set
path(possibly wildcarded) path to a RandomVariableStream PointerValue
streamstream number to set; must be non-negative

Definition at line 30 of file random-variable-stream-helper.cc.

References ns3::Config::MatchContainer::Begin(), ns3::Config::MatchContainer::End(), ns3::Config::MatchContainer::Get(), ns3::Config::LookupMatches(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION_NOARGS, and ns3::RandomVariableStream::SetStream().

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