Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CRandomNumber Class Reference

A class which provides a simple mechanism for generating random numbers. More...

#include <RandomNumber.h>

List of all members.

Public Member Functions

 CRandomNumber (void)
 Constructor.
 CRandomNumber (double dMin, double dMax)
 Constructor, initialises to 2 double forming the bounds.
 ~CRandomNumber (void)
 Destructor.
void Set (double dMin, double dMax)
 Sets the random number bound to 2 doubles.
void SetMax (double dMax)
 Sets the max.
void SetMin (double dMin)
 Sets the min.
double GetMin (void) const
 Access to the min.
double GetMax (void) const
 Access to the max.
double Get (void) const
 Gets a random number based on the settings.
int GetInt (void) const
 Gets an integer based on the settings. Sets up temporary new boundaries so that an interval of e.g. 0.8 to 3.7 will become 1.0 to 3.0 allowing integers 1 and 2 only.

Static Public Member Functions

static double GetFraction (void)
 Returns a random number from 0 to 1 inclusive.
static bool GetBool (void)
 Returns true or false;.


Detailed Description

A class which provides a simple mechanism for generating random numbers.

---------------------------------------------------------------------------


Constructor & Destructor Documentation

CRandomNumber::CRandomNumber void   ) 
 

Constructor.

--------------------------------------------------------------------------
CRandomNumber::CRandomNumber

---------------------------------------------------------------------------

CRandomNumber::CRandomNumber double  dMin,
double  dMax
 

Constructor, initialises to 2 double forming the bounds.

--------------------------------------------------------------------------
CRandomNumber::CRandomNumber

---------------------------------------------------------------------------

CRandomNumber::~CRandomNumber void   ) 
 

Destructor.

--------------------------------------------------------------------------
CRandomNumber::~CRandomNumber

---------------------------------------------------------------------------


Member Function Documentation

double CRandomNumber::Get void   )  const
 

Gets a random number based on the settings.

--------------------------------------------------------------------------
CRandomNumber::Get

---------------------------------------------------------------------------

bool CRandomNumber::GetBool void   )  [static]
 

Returns true or false;.

--------------------------------------------------------------------------
CRandomNumber::GetBool

---------------------------------------------------------------------------

double CRandomNumber::GetFraction void   )  [static]
 

Returns a random number from 0 to 1 inclusive.

--------------------------------------------------------------------------
CRandomNumber::GetFraction

---------------------------------------------------------------------------

int CRandomNumber::GetInt void   )  const
 

Gets an integer based on the settings. Sets up temporary new boundaries so that an interval of e.g. 0.8 to 3.7 will become 1.0 to 3.0 allowing integers 1 and 2 only.

Gets an integer based on the settings. Sets up temporary new boundaries so that an interval of e.g. 0.8 to 3.7 will become 1.0 to 3.0 allowing integers 1 and 2 only.

void CRandomNumber::Set double  dMin,
double  dMax
 

Sets the random number bound to 2 doubles.

--------------------------------------------------------------------------
CRandomNumber::Set

---------------------------------------------------------------------------


The documentation for this class was generated from the following files:
Generated on Mon Apr 21 11:43:52 2008 for GeoLib by  doxygen 1.4.4