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

woss::RandomGenerator class More...

#include <random-generator-definitions.h>

Inheritance diagram for woss::RandomGenerator:
Inheritance graph
Collaboration diagram for woss::RandomGenerator:
Collaboration graph

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 ( )
inlinevirtual

Default destructor

Member Function Documentation

virtual RandomGenerator* woss::RandomGenerator::clone ( ) const
inlinevirtual

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)
inlinevirtual

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
inlinevirtual

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
inlinevirtual

Checks the validity of RandomGenerator

Returns
true if initialized, false otherwise

References initialized.

virtual void woss::RandomGenerator::setSeed ( int  s)
inlinevirtual

Sets the seed

Parameters
sseed

References seed.

Member Data Documentation

bool woss::RandomGenerator::initialized
protected
int woss::RandomGenerator::seed
protected

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