Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages   Examples  

DistContext Class Reference
[Random]

Inherits LabelScope, and StatisticManager.

Inherited by Simulation.


Detailed Description

DistContext stores global data for Dist.

Author:
Ralf Gerstenberger

The random number generator (RNG) Dist does need some 'global' data for generating independent random numbers. These data are stored in DistContext.

Warning:
The RNG's in one DistContext are independent from one another (within the limits of the RNG in Dist). Those RNG's in different DistContexts are NOT independent. Without changing the seed manually one will get the same sequence of random numbers in every DistContext!
Since:
1.0


Public Member Functions

 DistContext ()
 Construction.

virtual ~DistContext ()
 Destruction.

void setSeed (int n=0)
 Set start seed for new RNG's.


Protected Member Functions

unsigned long getSeed ()
 Get current start seed.

unsigned long getNextSeed ()
 Get start seed for a new RNG.


Friends

class Dist


Constructor & Destructor Documentation

DistContext  ) 
 

Construction.


Member Function Documentation

void setSeed int  n = 0  ) 
 

Set start seed for new RNG's.

Parameters:
n new seed
The new seed will be used for the initialisation of new RNG's in this context. Choosing a good seed is not trivial. The one used as default is known to be sufficient for simulations.

Warning:
The quality of the random numbers depends on the selected seed!

unsigned long getSeed  )  [protected]
 

Get current start seed.

This function returns the current seed without generating a new seed value. The returned value was used for the last created RNG in this context.

See also:
getNextSeed()

unsigned long getNextSeed  )  [protected]
 

Get start seed for a new RNG.

This function returns a new seed. The seed is generated by a random number generator different from the one used for ordinary random numbers. That is why the created random number generators in one DistContext are independent from one another.


Generated on Mon Aug 11 10:36:07 2003 for ODEMx by doxygen1.3