A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
random-variable-stream-helper.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012 University of Washington
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*/
7
#ifndef RANDOM_VARIABLE_STREAM_HELPER_H
8
#define RANDOM_VARIABLE_STREAM_HELPER_H
9
10
#include <cstdint>
11
#include <string>
12
13
/**
14
* \file
15
* \ingroup core-helpers
16
* \ingroup randomvariable
17
* ns3::RandomVariableStreamHelper declaration.
18
*/
19
20
namespace
ns3
21
{
22
23
/**
24
* \brief Helper class for static methods involving RandomVariableStream
25
*/
26
class
RandomVariableStreamHelper
27
{
28
public
:
29
/**
30
* This helper method can be used to configure the stream number for
31
* one or more RNG streams. The path passed in should correspond to
32
* an attribute path in the configuration system. It may contain wildcards
33
* and may ultimately match zero, one, or more than one object.
34
*
35
* The objects to match are of type PointerValue where the underlying
36
* type is of type Ptr<RandomVariableStream>.
37
*
38
* \code
39
* .AddAttribute ("Speed",
40
* "A random variable used to pick the speed of a random waypoint model.",
41
* StringValue("ns3::UniformRandomVariable[Min=0.3|Max=0.7]"),
42
* MakePointerAccessor (&RandomWaypointMobilityModel::m_speed),
43
* MakePointerChecker<RandomVariableStream> ())
44
*
45
* \endcode
46
*
47
* Usage would look (for node 3) like this:
48
* \code
49
* std::string path
50
* ("/$ns3::NodeListPriv/NodeList/3/$ns3::Node/$ns3::RandomWaypointMobilityModel/Speed/$ns3::UniformRandomVariable");
51
* int64_t retVal = RandomVariableStreamHelper::AssignStreams (path, 0);
52
* \endcode
53
*
54
* \return The number of streams set
55
* \param path (possibly wildcarded) path to a RandomVariableStream PointerValue
56
* \param stream stream number to set; must be non-negative
57
*/
58
static
int64_t
AssignStreams
(std::string path, int64_t stream);
59
};
60
61
}
// namespace ns3
62
63
#endif
/* RANDOM_VARIABLE_STREAM_HELPER_H */
ns3::RandomVariableStreamHelper
Helper class for static methods involving RandomVariableStream.
Definition
random-variable-stream-helper.h:27
ns3::RandomVariableStreamHelper::AssignStreams
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.
Definition
random-variable-stream-helper.cc:28
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
core
helper
random-variable-stream-helper.h
Generated on Fri Nov 8 2024 13:58:59 for ns-3 by
1.11.0