Add the notion of currentNeighbor in the moVNSExplorer
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2546 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
6f6770e6de
commit
5f108b9b74
1 changed files with 7 additions and 7 deletions
|
|
@ -83,7 +83,7 @@ public:
|
||||||
if ((*this).moveApplied()) {
|
if ((*this).moveApplied()) {
|
||||||
selection.init(_solution);
|
selection.init(_solution);
|
||||||
} else
|
} else
|
||||||
if (selection.cont(current)) {
|
if (selection.cont(currentSol)) {
|
||||||
selection.next(_solution);
|
selection.next(_solution);
|
||||||
} else
|
} else
|
||||||
stop = true;
|
stop = true;
|
||||||
|
|
@ -102,9 +102,9 @@ public:
|
||||||
eoMonOp<EOT> & shake = selection.getShake();
|
eoMonOp<EOT> & shake = selection.getShake();
|
||||||
eoMonOp<EOT> & ls = selection.getLocalSearch();
|
eoMonOp<EOT> & ls = selection.getLocalSearch();
|
||||||
|
|
||||||
current = _solution;
|
currentSol = _solution;
|
||||||
shake(current);
|
shake(currentSol);
|
||||||
ls(current);
|
ls(currentSol);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -121,7 +121,7 @@ public:
|
||||||
* @param _solution the solution to move
|
* @param _solution the solution to move
|
||||||
*/
|
*/
|
||||||
virtual void move(EOT & _solution) {
|
virtual void move(EOT & _solution) {
|
||||||
_solution = current;
|
_solution = currentSol;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -130,7 +130,7 @@ public:
|
||||||
* @return true if the neighbor ameliorate the fitness
|
* @return true if the neighbor ameliorate the fitness
|
||||||
*/
|
*/
|
||||||
virtual bool accept(EOT & _solution) {
|
virtual bool accept(EOT & _solution) {
|
||||||
return acceptCrit(_solution, current);
|
return acceptCrit(_solution, currentSol);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -145,7 +145,7 @@ private:
|
||||||
moVariableNeighborhoodSelection<EOT>& selection;
|
moVariableNeighborhoodSelection<EOT>& selection;
|
||||||
moAcceptanceCriterion<Neighbor>& acceptCrit;
|
moAcceptanceCriterion<Neighbor>& acceptCrit;
|
||||||
bool stop;
|
bool stop;
|
||||||
EOT current;
|
EOT currentSol;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue