eosim::dist::Distribution Class Reference
[Distributions]

#include <eosim/dist/distribution.hpp>

Inheritance diagram for eosim::dist::Distribution:

Inheritance graph
[legend]
Collaboration diagram for eosim::dist::Distribution:

Collaboration graph
[legend]
List of all members.

Detailed Description

Distribution abstract class.

Author:
Sebastián Alaggia
Version:
1.0.1
Date:
2005

Pseudo-random number generators and distribution play a critical roll in computer simulations. Good generators ensure randomness between runs. So every simulation library must provide these facilities. EoSimulator implements some of the most common distributions and provides one generator, but its design allows more than one generator.

EoSimulator has no fixed number of streams. When a distribution is created, a new generator of user defined type is assigned to it. The generator’s type is defined by a GenType label (GenType is declared together with the NumberGenerator interface). The generator is a Distribution’s private attribute. For example:

NegExpDist my_dist(MT19937, lambda); // this is a Negative Exponencial Distribution with rate lambda, created using the generator Mt19937


To get a sampled value from a distribution, invoke the operation Distribution::sample on any Distribution’s subclass:

You can also change the generator’s seed with the operation Distribution::setSeed. EoSimulator doesn’t support antithetic streams, but it can be easily implemented.


Public Member Functions

 Distribution (GenType gen)
 The constructor creates a Distribution whose generator’s type is gen.
virtual ~Distribution ()
 The destructor of Distribution.
virtual double sample ()=0
 This abstract operation is redefine in concrete distributions and returns a sampled value.
void setSeed (unsigned long seed)
 This operation sets a new seed in the distribution’s number generator.

Protected Attributes

NumberGeneratorgenerator


Constructor & Destructor Documentation

Distribution::Distribution ( GenType  gen  ) 

The constructor creates a Distribution whose generator’s type is gen.

Note:
The programmer could have different distributions with different generators. All distributions have there own generator, is an exclusive private member.


Generated on Tue Oct 14 16:48:53 2008 for EOSimulator by  doxygen 1.5.2