Simpact Cyan
Population based event driven simulation using mNRM
uniformdistribution2d.h
Go to the documentation of this file.
1 #ifndef UNIFORMDISTRIBUTION2D_H
2 
3 #define UNIFORMDISTRIBUTION2D_H
4 
10 #include "uniformdistribution.h"
11 
16 {
17 public:
19  UniformDistribution2D(double minValueX, double maxValueX, double minValueY, double maxValueY,
21 
22  Point2D pickPoint() const;
23  double pickMarginalX() const { return m_xDist.pickNumber(); }
24  double pickMarginalY() const { return m_yDist.pickNumber(); }
25  double pickConditionalOnX(double x) const { return m_yDist.pickNumber(); }
26  double pickConditionalOnY(double y) const { return m_xDist.pickNumber(); }
27 
28  double getXMin() const { return m_xDist.getMin(); }
29  double getXMax() const { return m_xDist.getMax(); }
30  double getYMin() const { return m_yDist.getMin(); }
31  double getYMax() const { return m_yDist.getMax(); }
32 private:
33  UniformDistribution m_xDist, m_yDist;
34 };
35 
36 inline UniformDistribution2D::UniformDistribution2D(double minValueX, double maxValueX,
37  double minValueY, double maxValueY,
39  m_xDist(minValueX, maxValueX, pRng),
40  m_yDist(minValueY, maxValueY, pRng)
41 
42 {
43 }
44 
45 inline Point2D UniformDistribution2D::pickPoint() const
46 {
47  double x = m_xDist.pickNumber();
48  double y = m_yDist.pickNumber();
49  return Point2D(x, y);
50 }
51 
52 #endif // UNIFORMDISTRIBUTION_H
53 
This class allows you to return a random number from a uniform distribution with parameters specified...
Definition: uniformdistribution2d.h:15
UniformDistribution2D(double minValueX, double maxValueX, double minValueY, double maxValueY, GslRandomNumberGenerator *pRng)
The constructor specifies parameters for a uniform distribution.
Definition: uniformdistribution2d.h:36
double pickNumber() const
Pick a number according to a specific distrubution, specified in a subclass of ProbabilityDistributio...
Definition: uniformdistribution.h:36
This class allows you to return a random number from a uniform distribution with parameters specified...
Definition: uniformdistribution.h:15
This class allows you to generate random numbers, and uses the GNU Scientific Library for this...
Definition: gslrandomnumbergenerator.h:16
Point2D pickPoint() const
Pick a point according to a specific distrubution, specified in a subclass of ProbabilityDistribution...
Definition: uniformdistribution2d.h:45
Abstract base class for 2D probability distribution implementations so that they can be used intercha...
Definition: probabilitydistribution2d.h:17