This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/math/Random.h
kazu 4f511d907e some fixes [multithreading,..]
needed interface changes [new options]
logger for android
wifi-ap-optimization
new test-cases
2016-09-28 12:19:14 +02:00

29 lines
577 B
C++

#ifndef RANDOM_H
#define RANDOM_H
#include <cmath>
#include <random>
#include "../misc/Time.h"
#ifdef USE_FIXED_SEED
#define RANDOM_SEED 1234
#else
#define RANDOM_SEED ( std::chrono::system_clock::now().time_since_epoch() / std::chrono::milliseconds(1) )
#endif
//using RandomGenerator = std::minstd_rand;
class RandomGenerator : public std::minstd_rand {
public:
/** ctor with default seed */
RandomGenerator() : std::minstd_rand(RANDOM_SEED) {;}
/** ctor with custom seed */
RandomGenerator(result_type seed) : std::minstd_rand(seed) {;}
};
#endif // RANDOM_H