Replace srand() by rng.reseed() and clear src

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2364 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
boufaras 2011-09-14 12:37:29 +00:00
commit 61c489dfee

View file

@ -100,12 +100,6 @@ int main(int argc, char **argv)
parser.processParam( seedParam ); parser.processParam( seedParam );
unsigned seed = seedParam.value(); unsigned seed = seedParam.value();
//Number of position to change
eoValueParam<unsigned int> nbPosParam(1, "nbPos", "X Change", 'N');
parser.processParam( nbPosParam, "Exchange" );
unsigned nbPos = nbPosParam.value();
// Iteration number // Iteration number
eoValueParam<unsigned int> nbIterationParam(1, "nbIteration", "TS Iteration number", 'I'); eoValueParam<unsigned int> nbIterationParam(1, "nbIteration", "TS Iteration number", 'I');
parser.processParam( nbIterationParam, "TS Iteration number" ); parser.processParam( nbIterationParam, "TS Iteration number" );
@ -145,10 +139,10 @@ int main(int argc, char **argv)
* *
* ========================================================= */ * ========================================================= */
//reproducible random seed: if you don't change SEED above, //reproducible random seed: if you don't change SEED above,
// you'll aways get the same result, NOT a random run // you'll aways get the same result, NOT a random run
// rng.reseed(seed); rng.reseed(seed);
srand(0);
/* ========================================================= /* =========================================================
* *
* Initilisation of QAP data * Initilisation of QAP data
@ -156,7 +150,7 @@ srand(0);
* ========================================================= */ * ========================================================= */
PPPData<int> _data; PPPData<int> _data;
_data.load(); _data.load();
/* ========================================================= /* =========================================================
* *
@ -243,14 +237,12 @@ _data.load();
eval(sol); eval(sol);
std::cout << "initial: " << sol<< std::endl; std::cout << "initial: " << sol<< std::endl;
// Create timer for timing CUDA calculation
/*cudaFuncSetCacheConfig(moGPUMappingKernelEvalByModif<int,eoMinimizingFitness,PPPIncrEval<Neighbor> >, cudaFuncCachePreferL1);*/
moGPUTimer timer; moGPUTimer timer;
timer.start(); timer.start();
tabuSearch(sol); tabuSearch(sol);
std::cout << "final: " << sol << std::endl; std::cout << "final: " << sol << std::endl;
timer.stop(); timer.stop();
printf("CUDA execution time = %f ms\n",timer.getTime()); printf("Execution time = %f ms\n",timer.getTime());
timer.deleteTimer(); timer.deleteTimer();