Simpact Cyan
Population based event driven simulation using mNRM
gammadistribution.h
Go to the documentation of this file.
1 #ifndef GAMMADISTRIBUTION_H
2 
3 #define GAMMADISTRIBUTION_H
4 
10 
17 {
18 public:
20  GammaDistribution(double a, double b, GslRandomNumberGenerator *pRng) : ProbabilityDistribution(pRng) { m_a = a; m_b = b; }
21 
22  double pickNumber() const { return getRandomNumberGenerator()->pickGamma(m_a, m_b); }
23  double getA() const { return m_a; }
24  double getB() const { return m_b; }
25 private:
26  double m_a, m_b;
27 };
28 
29 #endif // GAMMADISTRIBUTION_H
GammaDistribution(double a, double b, GslRandomNumberGenerator *pRng)
The constructor specifies parameters for a gamma distribution.
Definition: gammadistribution.h:20
double pickGamma(double a, double b)
Picks a random number from the gamma distribution with a and b defined as in the formula prob(x) = x^...
Definition: gslrandomnumbergenerator.cpp:170
double pickNumber() const
Pick a number according to a specific distrubution, specified in a subclass of ProbabilityDistributio...
Definition: gammadistribution.h:22
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:16
This class allows you to return a random number picked from a gamma distribution with parameters spec...
Definition: gammadistribution.h:16
Abstract base class for probability distribution implementations so that they can be used interchange...
Definition: probabilitydistribution.h:15