diff --git a/trunk/paradiseo-mo/tutorial/Lesson9/VNS.cpp b/trunk/paradiseo-mo/tutorial/Lesson9/VNS.cpp index d0c0107df..eaf68511d 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson9/VNS.cpp +++ b/trunk/paradiseo-mo/tutorial/Lesson9/VNS.cpp @@ -39,14 +39,16 @@ using namespace std; #include #include #include -//#include +#include #include -//#include +#include //Algorithm and its components #include #include #include +#include +#include #include @@ -160,7 +162,7 @@ void main_function(int argc, char **argv) * ========================================================= */ shiftNeighborhood shiftNH((vecSize-1) * (vecSize-1)); - swapNeighborhood swapNH(100); + swapNeighborhood swapNH(vecSize * (vecSize-1) / 2); /* ========================================================= * @@ -174,18 +176,23 @@ void main_function(int argc, char **argv) eoSwapMutation swapMut; eoShiftMutation shiftMut; - moForwardVectorVNSelection selectNH(ls1, shiftMut, true); + // moForwardVectorVNSelection selectNH(ls1, shiftMut, true); + // moBackwardVectorVNSelection selectNH(ls1, shiftMut, true); + moRndVectorVNSelection selectNH(ls1, shiftMut, true); selectNH.add(ls2, swapMut); moAlwaysAcceptCrit acceptCrit; - moVNSexplorer explorer(selectNH, acceptCrit); + // moVNSexplorer explorer(selectNH, acceptCrit); - moTimeContinuator cont(5); + moTimeContinuator cont(3); - moLocalSearch vns(explorer, cont, fullEval); + // moLocalSearch vns(explorer, cont, fullEval); + moVNS vns(selectNH, acceptCrit, fullEval, cont); + moSimpleVNS svns(ls1, shiftMut, fullEval, cont); + svns.add(ls2, swapMut); /* ========================================================= * @@ -206,6 +213,18 @@ void main_function(int argc, char **argv) std::cout << "final sol: " << sol << std::endl ; std::cout << "#########################################" << std::endl; + + init(sol); + + fullEval(sol); + + std::cout << "#########################################" << std::endl; + std::cout << "initial sol: " << sol << std::endl ; + + svns(sol); + + std::cout << "final sol: " << sol << std::endl ; + std::cout << "#########################################" << std::endl; // // // /* =========================================================