From 98a6c551c3b8b90a417aeb1af9749af7fa39596a Mon Sep 17 00:00:00 2001 From: Faerbit Date: Sun, 7 Jun 2020 11:33:54 +0200 Subject: [PATCH] Init mersennetwister with current time. --- util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util.h b/util.h index df8fb88..e8ba046 100644 --- a/util.h +++ b/util.h @@ -3,6 +3,7 @@ #include #include +#include const double infinity = std::numeric_limits::infinity(); const double pi = 3.1415926535897932385; @@ -13,7 +14,7 @@ inline double degrees_to_radians(double degrees) { inline double random_double() { static std::uniform_real_distribution distribution(0.0, 1.0); - static std::mt19937 generator; + static std::mt19937 generator(std::time(nullptr)); return distribution(generator); }