latest version v1.9 - last update 10 Apr 2010 |
Base random number class. More...
#include <ltiDiscreteRandDist.h>
Classes | |
class | parameters |
parameters of the random distribution More... | |
Public Member Functions | |
discreteRandomDistribution (bool reInit=false) | |
discreteRandomDistribution (const unsigned int theValue) | |
virtual | ~discreteRandomDistribution () |
virtual int | draw () const =0 |
template<class T > | |
bool | apply (T &theObject) const |
virtual functor * | clone () const =0 |
virtual const char * | getTypeName () const |
discreteRandomDistribution & | copy (const discreteRandomDistribution &other) |
Base random number class.
lti::discreteRandomDistribution::discreteRandomDistribution | ( | bool | reInit = false |
) |
default constructor.
Initializes the pseudo-random number generator using system time. If reInit is false, the generator is initialized only when instantiating the first discreteRandomDistribution object.
lti::discreteRandomDistribution::discreteRandomDistribution | ( | const unsigned int | theValue | ) |
this constructor initializes the pseudo-random number generator using the given value
virtual lti::discreteRandomDistribution::~discreteRandomDistribution | ( | ) | [virtual] |
destructor
bool lti::discreteRandomDistribution::apply | ( | T & | theObject | ) | const [inline] |
virtual functor* lti::discreteRandomDistribution::clone | ( | ) | const [pure virtual] |
returns a pointer to a clone of the functor.
Reimplemented from lti::randomDistribution.
Implemented in lti::binomialDistribution.
discreteRandomDistribution& lti::discreteRandomDistribution::copy | ( | const discreteRandomDistribution & | other | ) |
virtual int lti::discreteRandomDistribution::draw | ( | ) | const [pure virtual] |
draws a number from the distribution.
Returns either 1 or 0, for occurence of the event or not.
Implemented in lti::binomialDistribution.
Referenced by apply().
virtual const char* lti::discreteRandomDistribution::getTypeName | ( | void | ) | const [inline, virtual] |
returns the name of this type
Reimplemented from lti::randomDistribution.
Reimplemented in lti::binomialDistribution.