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,
12  bool floor, GslRandomNumberGenerator *pRndGen);
13  ~DiscreteDistributionFast();
14 
15  double pickNumber() const;
16 private:
17  static int getLargerPowerOfTwo(const int s0, int *pLevels);
18 
19  std::vector<std::vector<double> > m_probLevels;
20  double m_totalSum, m_xMin, m_binSize;
21  bool m_floor;
22 };
23 
24 #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