Scheduler
bernoulli.h
Go to the documentation of this file.
1 
10 #ifndef BERNOULLI_H
11 #define BERNOULLI_H
12 
14 
15 namespace Utils
16 {
17 
18 class RandomGenerator;
19 
21 {
22 public:
26  Bernoulli(RandomGenerator *gen, double p);
27  virtual ~Bernoulli(){};
28  double draw() override;
29 private:
30  RandomGenerator *gen{nullptr};
31  double p{0.5};
32 };
33 
34 }
35 #endif
virtual ~Bernoulli()
Definition: bernoulli.h:27
double draw() override
returns a number from 0 to 1 following the underlying probability distribution
Definition: bernoulli.cpp:28
Definition: context.h:16
Bernoulli(RandomGenerator *gen, double p)
Definition: bernoulli.cpp:18