From 0c7e11a8b5d3d0bf64b6be2fb95ee1725c20100a Mon Sep 17 00:00:00 2001 From: jhumeau Date: Wed, 20 Jan 2010 10:02:57 +0000 Subject: [PATCH] =?UTF-8?q?Full=20Eval=20modifi=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1656 331e1502-861f-0410-8da2-ba01fb791d7f --- branches/newMo/src/eval/moFullEvalByCopy.h | 8 ++--- branches/newMo/src/eval/moFullEvalByModif.h | 33 ++++++++++--------- .../{eval => unused}/moFullEvalBitNeighbor.h | 0 3 files changed, 22 insertions(+), 19 deletions(-) rename branches/newMo/src/{eval => unused}/moFullEvalBitNeighbor.h (100%) diff --git a/branches/newMo/src/eval/moFullEvalByCopy.h b/branches/newMo/src/eval/moFullEvalByCopy.h index 12d9a2cf5..f1a1aaa03 100644 --- a/branches/newMo/src/eval/moFullEvalByCopy.h +++ b/branches/newMo/src/eval/moFullEvalByCopy.h @@ -2,7 +2,7 @@ #define moFullEvalByCopy_H #include -#include +#include /** @@ -12,8 +12,8 @@ template class moFullEvalByCopy : public moEval { public: - using moEval::EOT EOT; - using moEval::Fitness Fitness; + typedef typename moEval::EOT EOT; + typedef typename moEval::Fitness Fitness; /** * Ctor @@ -31,7 +31,7 @@ public: // tmp solution EOT tmp(_sol); // move tmp solution wrt _neighbor - _neighbor.(tmp); + _neighbor.move(tmp); // eval copy tmp.invalidate(); eval(tmp); diff --git a/branches/newMo/src/eval/moFullEvalByModif.h b/branches/newMo/src/eval/moFullEvalByModif.h index 7d2d586ac..018f25c52 100644 --- a/branches/newMo/src/eval/moFullEvalByModif.h +++ b/branches/newMo/src/eval/moFullEvalByModif.h @@ -27,24 +27,27 @@ public: */ void operator()(EOT & _sol, BackableNeighbor & _neighbor) { - // tmp fitness value of the current solution - Fitness tmpFit; + // tmp fitness value of the current solution + Fitness tmpFit; - // save current fitness value - tmpFit = _sol.fitness(); + // save current fitness value + tmpFit = _sol.fitness(); - // move the current solution wrt _neighbor - _neighbor.move(_sol); - // eval the modified solution - _sol.invalidate(); - eval(_sol); - // set the fitness value to the neighbor - _neighbor.fitness(_sol.fitness()); - // move the current solution back - _neighbor.moveBack(_sol); - // set the fitness back - _sol.fitness(tmpFit); + // move the current solution wrt _neighbor + _neighbor.move(_sol); + // eval the modified solution + _sol.invalidate(); + eval(_sol); + + // set the fitness value to the neighbor + _neighbor.fitness(_sol.fitness()); + + // move the current solution back + _neighbor.moveBack(_sol); + + // set the fitness back + _sol.fitness(tmpFit); } diff --git a/branches/newMo/src/eval/moFullEvalBitNeighbor.h b/branches/newMo/src/unused/moFullEvalBitNeighbor.h similarity index 100% rename from branches/newMo/src/eval/moFullEvalBitNeighbor.h rename to branches/newMo/src/unused/moFullEvalBitNeighbor.h