genetiK::util::Random Class Reference
[Utility classes]

This class represents both the interface and the container of the Random implementation used in the genetiK library . More...

#include <Random.h>

Inheritance diagram for genetiK::util::Random:

Inheritance graph
[legend]
Collaboration diagram for genetiK::util::Random:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual unsigned int getNextInt ()=0
 Returns the next pseudorandom integer.
virtual unsigned int getNextInt (unsigned int max)=0
 Returns the next pseudorandom integer.
virtual double getNextReal ()=0
 Returns the next pseudorandom integer.

Static Public Member Functions

static void setImplementation (Random *random)
 sets an implementation of the Random.
static void setDefaultImplementation ()
 sets the default implementation of the Random.
static RandomgetImplementation ()
 returns the current implementation of the random.
static void deleteImplementation ()
 destroy the current implementation.

Protected Member Functions

 Random ()
 creates the default Random implementation.

Detailed Description

This class represents both the interface and the container of the Random implementation used in the genetiK library .

This class represents both the interface and the container of the Random implementation used in the genetiK library. You can redefine your own Random, extending this class and passing it to the setImplementation method.


Constructor & Destructor Documentation

genetiK::util::Random::Random  )  [protected]
 

creates the default Random implementation.

This constructor is protected because you don't need to create any instance of this class. You can set this class as the Random imlementation by calling Random::SetDefaultImplementation();


Member Function Documentation

void genetiK::util::Random::deleteImplementation  )  [static]
 

destroy the current implementation.

Call this method to free the memory.

static Random* genetiK::util::Random::getImplementation  )  [inline, static]
 

returns the current implementation of the random.

The framework call this method to retrieve the current implementation of the random.

virtual unsigned int genetiK::util::Random::getNextInt unsigned int  max  )  [pure virtual]
 

Returns the next pseudorandom integer.

This method returns the next pseudorandom integer, you can override it in your random implementation. Returns an unsigned int greater than or equal to 0 and less than max;

Parameters:
max The return value upperbound

Implemented in genetiK::util::RandomDefault.

virtual unsigned int genetiK::util::Random::getNextInt  )  [pure virtual]
 

Returns the next pseudorandom integer.

This method returns the next pseudorandom integer, you can override it in your random implementation. Returns an unsigned int greater than or equal to 0 and less than 4294967296;

Implemented in genetiK::util::RandomDefault.

virtual double genetiK::util::Random::getNextReal  )  [pure virtual]
 

Returns the next pseudorandom integer.

This method returns the next pseudorandom double, you can override this method in your random implementation. Returns a double greater than or equal to 0.0 and less than 1.0;

Implemented in genetiK::util::RandomDefault.

void genetiK::util::Random::setDefaultImplementation  )  [static]
 

sets the default implementation of the Random.

Call this function to set the default implementation of the random. This method will be automatically called by the EvolutionaryAlgorithm if no Random implementation is set.

void genetiK::util::Random::setImplementation Random random  )  [static]
 

sets an implementation of the Random.

Call this function to set a new implementation of the random for the GenetiK Library.

Parameters:
random The implementation of the random


The documentation for this class was generated from the following files:
Generated on Thu Feb 23 12:22:41 2006 for GenetiK by  doxygen 1.4.6