From b6d46dbee4bc3bb1efc1ee0608bb91bad8ef860a Mon Sep 17 00:00:00 2001 From: boufaras Date: Wed, 3 Aug 2011 09:43:17 +0000 Subject: [PATCH] review and update the documentation git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2348 331e1502-861f-0410-8da2-ba01fb791d7f --- .../tutoriel/OneMax/testNeutralHC.cu | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/branches/ParadisEO-GPU/tutoriel/OneMax/testNeutralHC.cu b/branches/ParadisEO-GPU/tutoriel/OneMax/testNeutralHC.cu index c097086c4..cc7565430 100644 --- a/branches/ParadisEO-GPU/tutoriel/OneMax/testNeutralHC.cu +++ b/branches/ParadisEO-GPU/tutoriel/OneMax/testNeutralHC.cu @@ -43,21 +43,22 @@ using namespace std; #include // OneMax full eval function #include -// OneMax increment eval function +//Parallel evaluation of neighborhood on GPU #include +// OneMax increment evaluation function #include // One Max solution #include -// One Max neighbor +// Bit neighbor #include -// One Max ordered neighborhood +// Ordered neighborhood #include // The Solution and neighbor comparator #include #include // The continuator #include -// Simple HC algorithm +// Neutral HC algorithm #include //To compute execution time #include @@ -65,7 +66,7 @@ using namespace std; //------------------------------------------------------------------------------------ // Define types of the representation solution, different neighbors and neighborhoods //------------------------------------------------------------------------------------ -// REPRESENTATION + typedef moGPUBitVector solution; typedef moGPUBitNeighbor Neighbor; typedef moGPUOrderNeighborhoodByModif Neighborhood; @@ -90,16 +91,6 @@ void main_function(int argc, char **argv) parser.processParam( seedParam ); unsigned seed = seedParam.value(); - // description of genotype - eoValueParam vecSizeParam(1, "vecSize", "Genotype size", 'V'); - parser.processParam( vecSizeParam, "Representation" ); - unsigned vecSize = vecSizeParam.value(); - - //Number of position to change - eoValueParam nbPosParam(1, "nbPos", "X Change", 'N'); - parser.processParam( nbPosParam, "Exchange" ); - unsigned nbPos = nbPosParam.value(); - //nbStep maximum step to do eoValueParam nbStepParam(10, "nbStep", "maximum number of step", 'n'); parser.processParam( nbStepParam, "numberStep" ); @@ -138,7 +129,7 @@ void main_function(int argc, char **argv) * * ========================================================= */ - solution sol(vecSize); + solution sol(SIZE); /* ========================================================= * @@ -155,7 +146,7 @@ void main_function(int argc, char **argv) * ========================================================= */ OneMaxIncrEval incr_eval; - moGPUEvalByModif > cueval(vecSize,incr_eval); + moGPUEvalByModif > gpuEval(SIZE,incr_eval); /* ========================================================= * @@ -172,22 +163,22 @@ void main_function(int argc, char **argv) * * ========================================================= */ - Neighborhood neighborhood(vecSize,cueval); + Neighborhood neighborhood(SIZE,gpuEval); /* ========================================================= * - * The simple Hill Climbing algorithm + * The neutral Hill Climbing algorithm * * ========================================================= */ //True continuator <=> Always continue moTrueContinuator continuator; - moNeutralHC neutralHC(neighborhood,eval,cueval,nbStep,continuator); + moNeutralHC neutralHC(neighborhood,eval,gpuEval,nbStep,continuator); /* ========================================================= * - * Execute the neutralHill climbing from random sollution + * Execute the neutral Hill climbing from random sollution * * ========================================================= */