#include <rng-seed-manager.h>
Static Public Member Functions | |
static uint64_t | GetNextStreamIndex (void) |
static uint64_t | GetRun (void) |
static uint32_t | GetSeed (void) |
Get the seed value. More... | |
static void | SetRun (uint64_t run) |
Set the run number of simulation. More... | |
static void | SetSeed (uint32_t seed) |
set the seed it will duplicate the seed value 6 times More... | |
Definition at line 8 of file rng-seed-manager.h.
|
static |
Definition at line 52 of file rng-seed-manager.cc.
References ns3::g_nextStreamIndex, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::RandomVariableBase::GetStream(), ns3::RandomVariableBase::RandomVariableBase(), and ns3::RandomVariableStream::SetStream().
|
static |
Definition at line 43 of file rng-seed-manager.cc.
References ns3::g_rngRun, ns3::IntegerValue::Get(), ns3::GlobalValue::GetValue(), and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::RandomVariableBase::GetStream(), ns3::RandomVariableBase::RandomVariableBase(), and ns3::RandomVariableStream::SetStream().
|
static |
Get the seed value.
Note: returns the first of the six seed values used in the underlying RNG
Definition at line 23 of file rng-seed-manager.cc.
References ns3::g_rngSeed, ns3::IntegerValue::Get(), ns3::GlobalValue::GetValue(), and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::RandomVariableBase::GetStream(), ns3::RandomVariableBase::RandomVariableBase(), and ns3::RandomVariableStream::SetStream().
|
static |
Set the run number of simulation.
In this example, N could successivly be equal to 1,2,3, etc. and the user would continue to get independent runs out of the single simulation. For this simple example, the following might work:
Definition at line 37 of file rng-seed-manager.cc.
References NS_LOG_FUNCTION, and ns3::Config::SetGlobal().
Referenced by ns3::BriteTopologyStructureTestCase::DoRun(), ns3::olsr::Bug780Test::DoRun(), ns3::olsr::HelloRegressionTest::DoRun(), ns3::aodv::Bug772ChainTest::DoRun(), ns3::olsr::TcRegressionTest::DoRun(), ns3::aodv::ChainRegressionTest::DoRun(), ns3::Bug555TestCase::DoRun(), and main().
|
static |
set the seed it will duplicate the seed value 6 times
seed | Note, while the underlying RNG takes six integer values as a seed; it is sufficient to set these all to the same integer, so we provide a simpler interface here that just takes one integer. |
Definition at line 31 of file rng-seed-manager.cc.
References NS_LOG_FUNCTION, and ns3::Config::SetGlobal().
Referenced by ns3::BriteTopologyStructureTestCase::DoRun(), ns3::SteadyStateRandomWaypointTest::DoRun(), ns3::olsr::Bug780Test::DoRun(), ns3::LteRlcAmE2eTestCase::DoRun(), ns3::LteRlcUmE2eTestCase::DoRun(), ns3::olsr::HelloRegressionTest::DoRun(), ns3::aodv::Bug772ChainTest::DoRun(), ns3::olsr::TcRegressionTest::DoRun(), ns3::aodv::ChainRegressionTest::DoRun(), ns3::Bug555TestCase::DoRun(), and main().