From e9f949994e464a71d11610f67f570d834ee983a3 Mon Sep 17 00:00:00 2001 From: verel Date: Tue, 6 Dec 2011 10:59:22 +0000 Subject: [PATCH] Add the notion of currentNeighbor in the moFirstImprHCexplorer git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2540 331e1502-861f-0410-8da2-ba01fb791d7f --- .../src/explorer/moFirstImprHCexplorer.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/trunk/paradiseo-mo/src/explorer/moFirstImprHCexplorer.h b/trunk/paradiseo-mo/src/explorer/moFirstImprHCexplorer.h index 922ad7351..d51aff6a3 100644 --- a/trunk/paradiseo-mo/src/explorer/moFirstImprHCexplorer.h +++ b/trunk/paradiseo-mo/src/explorer/moFirstImprHCexplorer.h @@ -98,17 +98,17 @@ public: //Test if _solution has a Neighbor if (neighborhood.hasNeighbor(_solution)) { //init the first neighbor - neighborhood.init(_solution, (*current)); + neighborhood.init(_solution, currentNeighbor); //eval the _solution moved with the neighbor and stock the result in the neighbor - eval(_solution, (*current)); + eval(_solution, currentNeighbor); //test all others neighbors - while (! solNeighborComparator(_solution, *current) && neighborhood.cont(_solution)) { + while (! solNeighborComparator(_solution, currentNeighbor) && neighborhood.cont(_solution)) { //next neighbor - neighborhood.next(_solution, (*current)); + neighborhood.next(_solution, currentNeighbor); //eval - eval(_solution, (*current)); + eval(_solution, currentNeighbor); } } else { @@ -132,9 +132,9 @@ public: */ virtual void move(EOT & _solution) { //move the solution - (*current).move(_solution); + currentNeighbor.move(_solution); //update its fitness - _solution.fitness((*current).fitness()); + _solution.fitness(currentNeighbor.fitness()); }; /** @@ -144,7 +144,7 @@ public: */ virtual bool accept(EOT & _solution) { if (neighborhood.hasNeighbor(_solution)) { - isAccept = solNeighborComparator(_solution, (*current)) ; + isAccept = solNeighborComparator(_solution, currentNeighbor) ; } return isAccept; }; @@ -155,7 +155,7 @@ private: moSolNeighborComparator& solNeighborComparator; //Pointer on the best and the current neighbor - Neighbor* current; + // Neighbor* current; // true if the move is accepted bool isAccept ;