Simpact Cyan
Population based event driven simulation using mNRM
normaldistribution.h
Go to the documentation of this file.
1 #ifndef NORMALDISTRIBUTION_H
2 
3 #define NORMALDISTRIBUTION_H
4 
11 
18 {
19 public:
21  NormalDistribution(double mu, double sigma, GslRandomNumberGenerator *pRng);
22 
23  double pickNumber() const;
24  double getMu() const { return m_mu; }
25  double getSigma() const { return m_sigma; }
26 private:
27  double m_mu, m_sigma;
28 };
29 
31 {
32  m_mu = mu;
33  m_sigma = sigma;
34 }
35 
36 inline double NormalDistribution::pickNumber() const
37 {
38  return getRandomNumberGenerator()->pickGaussianNumber(m_mu, m_sigma);
39 }
40 
41 #endif // NORMALDISTRIBUTION_H
42 
NormalDistribution(double mu, double sigma, GslRandomNumberGenerator *pRng)
The constructor specifies parameters for a log-normal distribution.
Definition: normaldistribution.h:30
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:16
double pickNumber() const
Pick a number according to a specific distrubution, specified in a subclass of ProbabilityDistributio...
Definition: normaldistribution.h:36
This class allows you to return a random number from a normal distribution with parameters specified ...
Definition: normaldistribution.h:17
double pickGaussianNumber(double mean, double sigma)
Picks a random number from the gaussian distribution with parameters mean and sigma.
Definition: gslrandomnumbergenerator.cpp:127
Abstract base class for probability distribution implementations so that they can be used interchange...
Definition: probabilitydistribution.h:15