+bool Random::read_state(const std::string& filename)
+{
+ std::ifstream file(filename);
+ file >> mt19937_gen;
+ file.close();
+ if (file.fail())
+ XBT_WARN("Could not save the RNG state to file %s.", filename.c_str());
+ return not file.fail();
+}
+
+bool Random::write_state(const std::string& filename)
+{
+ std::ofstream file(filename);
+ file << mt19937_gen;
+ file.close();
+ if (file.fail())
+ XBT_WARN("Could not read the RNG state from file %s.", filename.c_str());
+ return not file.fail();
+}
+
+int StdRandom::uniform_int(int min, int max)
+{
+ std::uniform_int_distribution<> dist(min, max);
+ return dist(mt19937_gen);
+}
+
+double StdRandom::uniform_real(double min, double max)
+{
+ std::uniform_real_distribution<> dist(min, max);
+ return dist(mt19937_gen);
+}
+
+double StdRandom::exponential(double lambda)
+{
+ std::exponential_distribution<> dist(lambda);
+ return dist(mt19937_gen);
+}
+
+double StdRandom::normal(double mean, double sd)
+{
+ std::normal_distribution<> dist(mean, sd);
+ return dist(mt19937_gen);
+}
+
+int XbtRandom::uniform_int(int min, int max)