2013-11-03 14:46:39 +00:00
|
|
|
#ifndef RANDOMGENERATOR_H
|
|
|
|
#define RANDOMGENERATOR_H
|
|
|
|
|
|
|
|
#include "system_global.h"
|
2013-11-19 11:16:33 +00:00
|
|
|
|
2013-11-03 14:46:39 +00:00
|
|
|
namespace paysages {
|
|
|
|
namespace system {
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
class SYSTEMSHARED_EXPORT RandomGenerator {
|
|
|
|
public:
|
2015-12-10 18:40:39 +00:00
|
|
|
typedef unsigned long Seed;
|
|
|
|
class RandomGeneratorPrivate;
|
|
|
|
|
|
|
|
public:
|
|
|
|
RandomGenerator(Seed seed = 0);
|
|
|
|
~RandomGenerator();
|
2013-11-03 14:46:39 +00:00
|
|
|
|
2015-12-10 18:40:39 +00:00
|
|
|
inline Seed getSeed() const {
|
|
|
|
return seed;
|
2013-11-03 14:46:39 +00:00
|
|
|
}
|
2015-12-10 18:40:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate a 0.0-1.0 random double value.
|
|
|
|
*/
|
|
|
|
double genDouble();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Seed seed;
|
|
|
|
RandomGeneratorPrivate *data;
|
2013-11-03 14:46:39 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // RANDOMGENERATOR_H
|