dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
PseudoRandom.h
1 //
2 // Created by amarrero on 14/12/20.
3 //
4 
5 #ifndef DIGNEA_PSEUDORANDOM_H
6 #define DIGNEA_PSEUDORANDOM_H
7 // PseudoRandom.h
8 //
9 // Author:
10 // Esteban López-Camacho <esteban@lcc.uma.es>
11 // Antonio J. Nebro <antonio@lcc.uma.es>
12 // Juan J. Durillo <durillo@lcc.uma.es>
13 //
14 // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
15 //
16 // This program is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU Lesser General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 // This program is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU Lesser General Public License for more details.
25 //
26 // You should have received a copy of the GNU Lesser General Public License
27 // along with this program. If not, see <http://www.gnu.org/licenses/>.
28 
29 #include <dignea/utilities/random/RandomGenerator.h>
30 #include <math.h>
31 
32 #include <iostream>
33 
39 class PseudoRandom {
40  public:
41  static RandomGenerator *randomGenerator_;
42 
43  PseudoRandom();
44 
45  public:
51  static double randDouble(); // static int randInt();
59  static int randInt(int minBound, int maxBound);
67  static double randDouble(double minBound, double maxBound);
76  static double randNormal(double mean, double standardDeviation);
84  static double *randSphere(int dimension);
85 };
86 
87 #endif // DIGNEA_PSEUDORANDOM_H
This is the interface for the random number generator in dignea. The idea is that all the random numb...
Definition: PseudoRandom.h:39
static int randInt(int minBound, int maxBound)
Returns a random integer int the range [minBound, maxBound].
Definition: PseudoRandom.cpp:38
static RandomGenerator * randomGenerator_
Definition: PseudoRandom.h:41
static double randNormal(double mean, double standardDeviation)
Returns a random value extracted from a Normal Distribution with mean and standardDeviation.
Definition: PseudoRandom.cpp:61
static double randDouble()
Generates a random double value between 0.0 and 1.0.
Definition: PseudoRandom.cpp:31
static double * randSphere(int dimension)
Get random points from an hypersphere (center = 0, radius = 1) Code taken from Maurice Clerc's implem...
Definition: PseudoRandom.cpp:83