World Ocean Simulation System (WOSS) library
woss::RandomGenerator Class Reference

woss::RandomGenerator class More...

#include <random-generator-definitions.h>

Inheritance diagram for woss::RandomGenerator:

List of all members.

Public Member Functions

 RandomGenerator (int s=0)
virtual ~RandomGenerator ()
virtual RandomGeneratorcreate (double seed)
virtual RandomGeneratorclone () const
virtual bool isValid () const
virtual void setSeed (int s)
virtual int getSeed () const
virtual void initialize ()
virtual double getRand () const
virtual int getRandInt () const

Protected Attributes

int seed
bool initialized

Detailed Description

woss::RandomGenerator class

Class for random value generation purposes


Constructor & Destructor Documentation

woss::RandomGenerator::RandomGenerator ( int  s = 0) [inline]

Default RandomGenerator constructor

Parameters:
sseed

Referenced by clone(), and create().

virtual woss::RandomGenerator::~RandomGenerator ( ) [inline, virtual]

Default destructor


Member Function Documentation

virtual RandomGenerator* woss::RandomGenerator::clone ( ) const [inline, virtual]

RandomGenerator virtual factory method

Returns:
a heap-allocated RandomGenerator copy of this instance

Reimplemented in WossRandomGenerator.

References RandomGenerator().

Referenced by woss::DefHandler::operator=().

Here is the call graph for this function:

virtual RandomGenerator* woss::RandomGenerator::create ( double  seed) [inline, virtual]

RandomGenerator virtual factory method

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

References RandomGenerator().

Here is the call graph for this function:

double RandomGenerator::getRand ( ) const [virtual]

Gets a random value

Returns:
a random value between 0 and 1

Reimplemented in WossRandomGenerator.

References initialized.

Referenced by woss::DefHandler::getRand().

int RandomGenerator::getRandInt ( ) const [virtual]

Gets a random integer value

Returns:
a random integer

Reimplemented in WossRandomGenerator.

References initialized.

Referenced by woss::DefHandler::getRandInt().

virtual int woss::RandomGenerator::getSeed ( ) const [inline, virtual]

Sets the seed

Returns:
the seed

References seed.

void RandomGenerator::initialize ( ) [virtual]

Mandatory function to initialize the instance

Reimplemented in WossRandomGenerator.

References initialized, and seed.

virtual bool woss::RandomGenerator::isValid ( ) const [inline, virtual]

Checks the validity of RandomGenerator

Returns:
true if initialized, false otherwise

References initialized.

virtual void woss::RandomGenerator::setSeed ( int  s) [inline, virtual]

Sets the seed

Parameters:
sseed

References seed.


Member Data Documentation


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