Simpact Cyan
Population based event driven simulation using mNRM
discretedistribution.h
Go to the documentation of this file.
1 #ifndef DISCRETEDISTRIBUTION_H
2 
3 #define DISCRETEDISTRIBUTION_H
4 
9 #include <vector>
10 
12 
20 {
21 public:
32  DiscreteDistribution(std::vector<double> &binStarts,
33  std::vector<double> &histValues,
34  GslRandomNumberGenerator *pRndGen);
36 
38  double pickNumber() const;
39 private:
40  std::vector<double> m_histSums;
41  std::vector<double> m_binStarts;
42  double m_totalSum;
43  mutable GslRandomNumberGenerator *m_pRndGen;
44 };
45 
46 #endif // DISCRETEDISTRIBUTION_H
47 
DiscreteDistribution(std::vector< double > &binStarts, std::vector< double > &histValues, GslRandomNumberGenerator *pRndGen)
Constructor of the class.
Definition: discretedistribution.cpp:7
Helper class to generate random numbers based on some kind of discrete distribution.
Definition: discretedistribution.h:19
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:15
double pickNumber() const
Pick a number according to the discrete distrubution specified in the constructor.
Definition: discretedistribution.cpp:52