Simpact Cyan
Population based event driven simulation using mNRM
probabilitydistribution2d.h
Go to the documentation of this file.
1 #ifndef PROBABILITYDISTRIBUTION2D_H
2 
3 #define PROBABILITYDISTRIBUTION2D_H
4 
9 #include <assert.h>
10 
12 
13 struct Point2D
14 {
15  Point2D() { }
16  Point2D(double x0, double y0) { x = x0; y = y0; }
17 
18  double x, y;
19 };
20 
24 {
25 public:
26  ProbabilityDistribution2D(GslRandomNumberGenerator *pRng) { assert(pRng != 0); m_pRng = pRng; }
27  virtual ~ProbabilityDistribution2D() { }
28 
31  virtual Point2D pickPoint() const = 0;
32  GslRandomNumberGenerator *getRandomNumberGenerator() const { return m_pRng; }
33 private:
34  mutable GslRandomNumberGenerator *m_pRng;
35 };
36 
37 #endif // PROBABILITYDISTRIBUTION2D_H
virtual Point2D pickPoint() const =0
Pick a point according to a specific distrubution, specified in a subclass of ProbabilityDistribution...
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:16
Abstract base class for 2D probability distribution implementations so that they can be used intercha...
Definition: probabilitydistribution2d.h:23