World Ocean Simulation System (WOSS) library
WossRandomGenerator Class Reference

#include <uw-woss-random-generator.h>

Inheritance diagram for WossRandomGenerator:
Inheritance graph
Collaboration diagram for WossRandomGenerator:
Collaboration graph

Public Member Functions

 WossRandomGenerator (int seed=0)
 WossRandomGenerator (const WossRandomGenerator &copy)
 WossRandomGenerator (WossRandomGenerator &&tmp)=default
WossRandomGeneratoroperator= (const WossRandomGenerator &copy)
WossRandomGeneratoroperator= (WossRandomGenerator &&tmp)=default
virtual ~WossRandomGenerator () override=default
virtual std::unique_ptr< woss::RandomGeneratorcreate (int s) const override
virtual std::unique_ptr< woss::RandomGeneratorclone () const override
virtual double getRand () const
virtual int getRandInt () const
virtual void initialize ()
Public Member Functions inherited from woss::RandomGenerator
 RandomGenerator (int s=0)
virtual ~RandomGenerator ()=default
 RandomGenerator (const RandomGenerator &copy)=default
 RandomGenerator (RandomGenerator &&tmp)=default
RandomGeneratoroperator= (const RandomGenerator &copy)=default
RandomGeneratoroperator= (RandomGenerator &&tmp)=default
virtual bool isValid () const
virtual void setSeed (int s)
virtual int getSeed () const

Protected Attributes

std::unique_ptr< RNG > rng = nullptr
Protected Attributes inherited from woss::RandomGenerator
int seed = 0
bool initialized = false

Constructor & Destructor Documentation

◆ WossRandomGenerator() [1/3]

WossRandomGenerator::WossRandomGenerator ( int seed = 0)

◆ WossRandomGenerator() [2/3]

WossRandomGenerator::WossRandomGenerator ( const WossRandomGenerator & copy)

References woss::RandomGenerator::initialized, woss::RandomGenerator::RandomGenerator(), rng, and WossRandomGenerator().

Here is the call graph for this function:

◆ WossRandomGenerator() [3/3]

WossRandomGenerator::WossRandomGenerator ( WossRandomGenerator && tmp)
default

References WossRandomGenerator().

Here is the call graph for this function:

◆ ~WossRandomGenerator()

virtual WossRandomGenerator::~WossRandomGenerator ( )
overridevirtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< woss::RandomGenerator > WossRandomGenerator::clone ( ) const
inlineoverridevirtual

RandomGenerator virtual factory method

Returns
std::unique_ptr to a heap-allocated RandomGenerator copy of this instance

Reimplemented from woss::RandomGenerator.

◆ create()

virtual std::unique_ptr< woss::RandomGenerator > WossRandomGenerator::create ( int seed) const
inlineoverridevirtual

RandomGenerator virtual factory method

Parameters
copyRandomGenerator to be copied
Returns
a std::unique_ptr to a heap-allocated RandomGenerator object

Reimplemented from woss::RandomGenerator.

◆ getRand()

double WossRandomGenerator::getRand ( ) const
virtual

Gets a random value

Returns
a random value between 0 and 1

Reimplemented from woss::RandomGenerator.

References woss::RandomGenerator::initialized, and rng.

◆ getRandInt()

int WossRandomGenerator::getRandInt ( ) const
virtual

Gets a random integer value

Returns
a random integer

Reimplemented from woss::RandomGenerator.

References woss::RandomGenerator::initialized, and rng.

◆ initialize()

void WossRandomGenerator::initialize ( )
virtual

Mandatory function to initialize the instance

Reimplemented from woss::RandomGenerator.

References woss::RandomGenerator::initialized, rng, and woss::RandomGenerator::seed.

Referenced by WossRandomGeneratorTcl::command().

◆ operator=() [1/2]

WossRandomGenerator & WossRandomGenerator::operator= ( const WossRandomGenerator & copy)

References woss::RandomGenerator::initialized, rng, woss::RandomGenerator::seed, and WossRandomGenerator().

Here is the call graph for this function:

◆ operator=() [2/2]

WossRandomGenerator & WossRandomGenerator::operator= ( WossRandomGenerator && tmp)
default

References WossRandomGenerator().

Here is the call graph for this function:

Member Data Documentation

◆ rng

std::unique_ptr<RNG> WossRandomGenerator::rng = nullptr
protected

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