Skip to content
Snippets Groups Projects
Commit 05cf7ec5 authored by Uwe Woessner's avatar Uwe Woessner
Browse files

varying random seed

Signed-off-by: default avatarhpcwoess <woessner@hlrs.de>
parent 4f4cb102
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,10 @@
#include "slaveConfigImporter.h"
#include "CoreFramework/CoreShare/log.h"
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
using namespace Importer;
using namespace SimulationCommon;
......@@ -95,12 +99,19 @@ bool SlaveConfigImporter::ImportExperimentConfig(QDomElement experimentConfigEle
return false;
}
unsigned long randomSeed;
unsigned long randomSeed=0;
if (!ParseULong(experimentConfigElement, "RandomSeed", randomSeed))
{
LOG_INTERN(LogLevel::Error) << "RandomSeed not valid.";
return false;
//LOG_INTERN(LogLevel::Error) << "RandomSeed not valid.";
//return false;
}
if(randomSeed==0)
{
struct timeval tv;
gettimeofday(&tv,NULL);
randomSeed = (unsigned long)tv.tv_usec+getpid();
}
experimentConfig.randomSeed = static_cast<std::uint32_t>(randomSeed);
bool logCyclicsToCsv;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment