Skip to content

Commit

Permalink
reset seed on each bench call
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Jan 23, 2024
1 parent 08fa8d3 commit f782470
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions MMVII/src/Bench/BenchGlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include "MMVII_PhgrDist.h"
#include "MMVII_Geom3D.h"
#include "MMVII_Radiom.h"
#include "MMVII_Random.h"
#include <cmath>
#include <functional>
#ifdef _WIN32
#include <windows.h>
#else
Expand Down Expand Up @@ -93,6 +95,11 @@ bool cParamExeBench::NewBench(const std::string & aName,bool ExactMatch)
mNbExe++;
mInsideFunc = true;
StdOut() << " Bench : " << aName << std::endl;

std::string aSeedStr = aName + "/" + std::to_string(mCurLev);
std::size_t aSeedVal = std::hash<std::string>{}(aSeedStr);
// StdOut() << " reinit seed to: " << aSeedStr << " / " << aSeedVal << "\n";
cRandGenerator::TheOne()->setSeed(aSeedVal);
}
return mInsideFunc;
}
Expand Down

0 comments on commit f782470

Please sign in to comment.