| [3f9eba] | 1 | /* | 
|---|
|  | 2 | * RandomNumberDistribution.hpp | 
|---|
|  | 3 | * | 
|---|
|  | 4 | *  Created on: Jan 01, 2011 | 
|---|
|  | 5 | *      Author: heber | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #ifndef RANDOMNUMBERDISTRIBUTION_HPP_ | 
|---|
|  | 9 | #define RANDOMNUMBERDISTRIBUTION_HPP_ | 
|---|
|  | 10 |  | 
|---|
|  | 11 | // include config.h | 
|---|
|  | 12 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 13 | #include <config.h> | 
|---|
|  | 14 | #endif | 
|---|
|  | 15 |  | 
|---|
| [15911c] | 16 | class RandomNumberDistributionFactoryTest; | 
|---|
|  | 17 | class RandomNumberGenerator; | 
|---|
| [0275ad] | 18 | class RandomNumberDistribution_Parameters; | 
|---|
| [15911c] | 19 |  | 
|---|
| [3f9eba] | 20 | /** Abstract base class for a random number distribution. | 
|---|
|  | 21 | * | 
|---|
|  | 22 | *  This class represents the interface to the random number distribution. | 
|---|
|  | 23 | *  Hence, they all can be accessed the same way. | 
|---|
|  | 24 | * | 
|---|
|  | 25 | * It is also the base class that is needed for RandomNumberGeneratorFactory. | 
|---|
|  | 26 | */ | 
|---|
|  | 27 | class RandomNumberDistribution | 
|---|
|  | 28 | { | 
|---|
| [15911c] | 29 | /** | 
|---|
|  | 30 | * test has to access cstor/dstor. | 
|---|
|  | 31 | */ | 
|---|
|  | 32 | friend class RandomNumberDistributionFactoryTest; | 
|---|
|  | 33 |  | 
|---|
|  | 34 | /** | 
|---|
|  | 35 | * RandomNumberGenerator(_Encapsulation) needs access to dstor. | 
|---|
|  | 36 | */ | 
|---|
|  | 37 | friend class RandomNumberGenerator; | 
|---|
|  | 38 |  | 
|---|
| [3f9eba] | 39 | public: | 
|---|
| [0275ad] | 40 | /** Getter for the whole set of possible parameters. | 
|---|
|  | 41 | * | 
|---|
|  | 42 | * @return filled instance of RandomNumberDistribution_Parameters | 
|---|
|  | 43 | */ | 
|---|
|  | 44 | virtual RandomNumberDistribution_Parameters* getParameterSet() const=0; | 
|---|
|  | 45 |  | 
|---|
|  | 46 | /** Getter for smallest value the uniform_... engines produces. | 
|---|
| [081e5d] | 47 | * | 
|---|
|  | 48 | * @return smallest value | 
|---|
|  | 49 | */ | 
|---|
|  | 50 | virtual double min() const=0; | 
|---|
|  | 51 |  | 
|---|
| [0275ad] | 52 | /** Getter for largest value the uniform_... engines produces. | 
|---|
| [081e5d] | 53 | * | 
|---|
|  | 54 | * @return largest value | 
|---|
|  | 55 | */ | 
|---|
|  | 56 | virtual double max() const=0; | 
|---|
|  | 57 |  | 
|---|
|  | 58 |  | 
|---|
|  | 59 | /** Getter for bernoulli_distribution probability p. | 
|---|
|  | 60 | * | 
|---|
|  | 61 | * @return p | 
|---|
|  | 62 | */ | 
|---|
|  | 63 | virtual double p() const=0; | 
|---|
|  | 64 |  | 
|---|
| [0275ad] | 65 | /** Getter for binomial_distribution's parameter t. | 
|---|
|  | 66 | * | 
|---|
|  | 67 | * @return t | 
|---|
|  | 68 | */ | 
|---|
|  | 69 | virtual double t() const=0; | 
|---|
|  | 70 |  | 
|---|
|  | 71 | /** Getter for cauchy_distribution parameter median. | 
|---|
|  | 72 | * | 
|---|
|  | 73 | * @return median | 
|---|
|  | 74 | */ | 
|---|
|  | 75 | virtual double median() const=0; | 
|---|
|  | 76 |  | 
|---|
|  | 77 | /** Getter for cauchy_distribution parameter sigma. | 
|---|
|  | 78 | * | 
|---|
|  | 79 | * @return sigma | 
|---|
|  | 80 | */ | 
|---|
|  | 81 | virtual double sigma() const=0; | 
|---|
|  | 82 |  | 
|---|
|  | 83 | /** Getter for gamma_distribution parameter alpha. | 
|---|
|  | 84 | * | 
|---|
|  | 85 | * @return alpha | 
|---|
|  | 86 | */ | 
|---|
|  | 87 | virtual double alpha() const=0; | 
|---|
|  | 88 |  | 
|---|
|  | 89 | /** Getter for poisson_distribution's parameter mean. | 
|---|
|  | 90 | * | 
|---|
|  | 91 | * @return mean | 
|---|
|  | 92 | */ | 
|---|
|  | 93 | virtual double mean() const=0; | 
|---|
|  | 94 |  | 
|---|
|  | 95 | /** Getter for triangle_distribution parameter a. | 
|---|
|  | 96 | * | 
|---|
|  | 97 | * @return a | 
|---|
|  | 98 | */ | 
|---|
|  | 99 | virtual double a() const=0; | 
|---|
|  | 100 |  | 
|---|
|  | 101 | /** Getter for triangle_distribution parameter b. | 
|---|
|  | 102 | * | 
|---|
|  | 103 | * @return b | 
|---|
|  | 104 | */ | 
|---|
|  | 105 | virtual double b() const=0; | 
|---|
|  | 106 |  | 
|---|
|  | 107 | /** Getter for triangle_distribution parameter c. | 
|---|
|  | 108 | * | 
|---|
|  | 109 | * @return c | 
|---|
|  | 110 | */ | 
|---|
|  | 111 | virtual double c() const=0; | 
|---|
|  | 112 |  | 
|---|
|  | 113 | /** Getter for exponential_distribution parameter lambda. | 
|---|
|  | 114 | * | 
|---|
|  | 115 | * @return lambda | 
|---|
|  | 116 | */ | 
|---|
|  | 117 | virtual double lambda() const=0; | 
|---|
|  | 118 |  | 
|---|
| [3f9eba] | 119 | /** Getter for the type name of the internal distribution. | 
|---|
|  | 120 | * | 
|---|
| [0275ad] | 121 | * @return name of distribution | 
|---|
| [3f9eba] | 122 | */ | 
|---|
|  | 123 | virtual std::string name()=0; | 
|---|
|  | 124 |  | 
|---|
| [15911c] | 125 | /** Destructor of class RandomNumberDistribution. | 
|---|
|  | 126 | * | 
|---|
|  | 127 | * @note must be public such that instances from factory can be destroyed. | 
|---|
|  | 128 | * | 
|---|
|  | 129 | */ | 
|---|
| [3f9eba] | 130 | virtual ~RandomNumberDistribution() {}; | 
|---|
| [15911c] | 131 | protected: | 
|---|
| [3f9eba] | 132 |  | 
|---|
| [15911c] | 133 | /** Constructor of class RandomNumberDistribution. | 
|---|
|  | 134 | * | 
|---|
|  | 135 | * @note is protected such that instances can only be created by the factory. | 
|---|
|  | 136 | */ | 
|---|
|  | 137 | RandomNumberDistribution() {}; | 
|---|
| [3f9eba] | 138 | }; | 
|---|
|  | 139 |  | 
|---|
|  | 140 | #endif /* RANDOMNUMBERDISTRIBUTION_HPP_ */ | 
|---|