add hybrid lesson and test of ILS

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1799 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jhumeau 2010-05-07 12:11:00 +00:00
commit 5f85276ea5
9 changed files with 344 additions and 20 deletions

View file

@ -175,7 +175,7 @@ void main_function(int argc, char **argv)
* ========================================================= */
//Basic Constructor of the Tabu Search
moTS<shiftNeighbor> ts(orderShiftNH, fullEval, shiftEval, 5, 7);
moTS<shiftNeighbor> ts(orderShiftNH, fullEval, shiftEval, 1, 7);
eoSwapMutation<Queen> mut;
@ -185,9 +185,17 @@ void main_function(int argc, char **argv)
//Simple Constructor of the Iterated Local Search
//Be carefull, template of the continuator must be a dummyNeighbor!!!
moIterContinuator<moDummyNeighbor<Queen> > cont(4);
moIterContinuator<moDummyNeighbor<Queen> > cont(4, false);
moILS<shiftNeighbor> localSearch2(ts, fullEval, mut, cont);
//General Constructor of the Iterated Local Search
moMonOpPerturb<shiftNeighbor> perturb(mut, fullEval);
moSolComparator<Queen> solComp;
moBetterAcceptCrit<shiftNeighbor> accept(solComp);
moILS<shiftNeighbor> localSearch3(ts, fullEval, cont, perturb, accept);
std::cout << "Iterated Local Search 1:" << std::endl;
std::cout << "--------------" << std::endl;
std::cout << "initial: " << sol1 << std::endl ;
@ -200,6 +208,12 @@ void main_function(int argc, char **argv)
localSearch2(sol2);
std::cout << "final: " << sol2 << std::endl << std::endl;
std::cout << "Iterated Local Search 3:" << std::endl;
std::cout << "--------------" << std::endl;
std::cout << "initial: " << sol3 << std::endl ;
localSearch3(sol3);
std::cout << "final: " << sol3 << std::endl << std::endl;
}
// A main that catches the exceptions