A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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)
 This helper method can be used to configure the stream number for one or more RNG streams.
 

Detailed Description

Helper class for static methods involving RandomVariableStream.

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

Member Function Documentation

◆ AssignStreams()

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

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 object.

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.",
StringValue("ns3::UniformRandomVariable[Min=0.3|Max=0.7]"),
Ptr< RandomVariableStream > m_speed
random variable to generate speeds
Hold variables of type string.
Definition string.h:45
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition pointer.h:248
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
Definition pointer.h:269

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);
static int64_t AssignStreams(std::string path, int64_t stream)
This helper method can be used to configure the stream number for one or more RNG streams.
Returns
The number of streams set
Parameters
path(possibly wildcarded) path to a RandomVariableStream PointerValue
streamstream number to set; must be non-negative

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

References ns3::Config::MatchContainer::Get(), ns3::PointerValue::Get(), ns3::Config::MatchContainer::GetN(), ns3::Config::LookupMatches(), NS_ASSERT, NS_LOG_DEBUG, and NS_LOG_FUNCTION_NOARGS.

+ Here is the call graph for this function:

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