+bool Random::read_state(std::string filename)
+{
+ std::ifstream file(filename);
+ if (file) {
+ file >> mt19937_gen;
+ return true;
+ } else {
+ XBT_WARN("Could not open %s and thus not save the RNG state.", filename.c_str());
+ return false;
+ }
+}
+
+bool Random::write_state(std::string filename)
+{
+ std::ofstream file(filename);
+ if (file) {
+ file << mt19937_gen;
+ return false;
+ } else {
+ XBT_WARN("Could not open %s and thus not read the RNG state.", filename.c_str());
+ return false;
+ }
+}
+