Scheduler
randomGenerator.h
Go to the documentation of this file.
1 
10 #ifndef RANDOMGENERATOR_H
11 #define RANDOMGENERATOR_H
12 #include <random>
13 #include <vector>
14 
15 namespace Utils
16 {
17 
19 {
20 public:
22  RandomGenerator(time_t seed);
23  double drawExp(double lambda);
24  double drawUniform(double min, double max);
25  double drawBeta(double alpha, double beta);
26  int drawUniformInt(int min, int max);
27  /*This function returns a vector of nbOfBins components,
28  containing elements so that the total of them is 1.
29  This is generating a random discrete distribution*/
30  std::vector<double> drawDistribution(int nbOfBins);
31  void seed(time_t seed);
32 private:
33  std::default_random_engine gen;
34  std::uniform_real_distribution<double> unif;
35 };
36 
37 }
38 
39 #endif
void seed(time_t seed)
double drawBeta(double alpha, double beta)
double drawExp(double lambda)
Definition: context.h:16
std::vector< double > drawDistribution(int nbOfBins)
double drawUniform(double min, double max)
int drawUniformInt(int min, int max)