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 
10 #include <vector>
11 
13 
21 {
22 public:
36  DiscreteDistribution(const std::vector<double> &binStarts,
37  const std::vector<double> &histValues,
38  bool floor,
39  GslRandomNumberGenerator *pRndGen);
41 
42  double pickNumber() const;
43 private:
44  std::vector<double> m_histSums;
45  std::vector<double> m_binStarts;
46  double m_totalSum;
47  bool m_floor;
48 };
49 
50 #endif // DISCRETEDISTRIBUTION_H
51 
DiscreteDistribution(const std::vector< double > &binStarts, const std::vector< double > &histValues, bool floor, GslRandomNumberGenerator *pRndGen)
Constructor of the class.
Definition: discretedistribution.cpp:8
Helper class to generate random numbers based on some kind of discrete distribution.
Definition: discretedistribution.h:20
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: discretedistribution.cpp:50
Abstract base class for probability distribution implementations so that they can be used interchange...
Definition: probabilitydistribution.h:15