Simpact Cyan
Population based event driven simulation using mNRM
discretedistributionfast.h
1 #ifndef DISCRETEDISTRIBUTIONFAST_H
2 
3 #define DISCRETEDISTRIBUTIONFAST_H
4 
6 #include <vector>
7 
8 class DiscreteDistributionFast : public ProbabilityDistribution
9 {
10 public:
11  DiscreteDistributionFast(double xMin, double xMax, const std::vector<double> &probValues, GslRandomNumberGenerator *pRndGen);
12  ~DiscreteDistributionFast();
13 
14  double pickNumber() const;
15 private:
16  static int getLargerPowerOfTwo(const int s0, int *pLevels);
17 
18  std::vector<std::vector<double> > m_probLevels;
19  double m_totalSum, m_xMin, m_binSize;
20 };
21 
22 #endif // DISCRETEDISTRIBUTIONFAST_H
virtual double pickNumber() const =0
Pick a number according to a specific distrubution, specified in a subclass of ProbabilityDistributio...
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:16
Abstract base class for probability distribution implementations so that they can be used interchange...
Definition: probabilitydistribution.h:15