diff --git a/eo/test/t-eoOptional.cpp b/eo/test/t-eoOptional.cpp index bee58957c..5b4a9fbc2 100644 --- a/eo/test/t-eoOptional.cpp +++ b/eo/test/t-eoOptional.cpp @@ -27,3 +27,4 @@ int main(int ac, char** av) T t(666); MyClass mc3(t); } + diff --git a/mo/src/algo/moSA.h b/mo/src/algo/moSA.h index c126f31fc..31c98cc7d 100644 --- a/mo/src/algo/moSA.h +++ b/mo/src/algo/moSA.h @@ -37,6 +37,8 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include #include +#include +#include /** * Simulated Annealing @@ -60,38 +62,60 @@ public: * @param _span number of iteration with equal temperature for cooling schedule (default = 100) * @param _finalT final temperature, threshold of the stopping criteria for cooling schedule (default = 0.01) */ - moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, double _initT=10, double _alpha=0.9, unsigned _span=100, double _finalT=0.01): - moLocalSearch(explorer, trueCont, _fullEval), - defaultCool(_initT, _alpha, _span, _finalT), - explorer(_neighborhood, _eval, defaultSolNeighborComp, defaultCool) - {} + /*moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, double _initT=10, double _alpha=0.9, unsigned _span=100, double _finalT=0.01) + : defaultCool(_initT, _alpha, _span, _finalT), + explorer(_neighborhood, _eval, defaultSolNeighborComp, defaultCool), + moLocalSearch(explorer, trueCont, _fullEval) + { }*/ + moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, double _initT=10, double _alpha=0.9, unsigned _span=100, double _finalT=0.01) + : moLocalSearch(*(explorer = new moSAexplorer(_neighborhood, _eval, *defaultSolNeighborComp, *defaultCool)), *(trueCont = new moTrueContinuator()), _fullEval), + defaultCool(new moSimpleCoolingSchedule(_initT, _alpha, _span, _finalT)), + default_eval(NULL), // removed in C++11 with unique_ptr + defaultSolNeighborComp(new moSolNeighborComparator()) + //explorer(_neighborhood, _eval, *defaultSolNeighborComp, *defaultCool) + { } - /** - * Simple constructor for a simulated annealing - * @param _neighborhood the neighborhood - * @param _fullEval the full evaluation function - * @param _eval neighbor's evaluation function - * @param _cool a cooling schedule - */ - moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, moCoolingSchedule& _cool): - moLocalSearch(explorer, trueCont, _fullEval), - defaultCool(0, 0, 0, 0), - explorer(_neighborhood, _eval, defaultSolNeighborComp, _cool) - {} - - /** - * General constructor for a simulated annealing - * @param _neighborhood the neighborhood - * @param _fullEval the full evaluation function - * @param _eval neighbor's evaluation function - * @param _cool a cooling schedule - * @param _cont an external continuator - */ - moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, moCoolingSchedule& _cool, moContinuator& _cont): - moLocalSearch(explorer, _cont, _fullEval), - defaultCool(0, 0, 0, 0), - explorer(_neighborhood, _eval, defaultSolNeighborComp, _cool) - {} +// /** +// * Simple constructor for a simulated annealing +// * @param _neighborhood the neighborhood +// * @param _fullEval the full evaluation function +// * @param _eval neighbor's evaluation function +// * @param _cool a cooling schedule +// */ +// moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, moCoolingSchedule& _cool): +// moLocalSearch(explorer, trueCont, _fullEval), +// defaultCool(0, 0, 0, 0), +// explorer(_neighborhood, _eval, defaultSolNeighborComp, _cool) +// {} +// +// /** +// * General constructor for a simulated annealing +// * @param _neighborhood the neighborhood +// * @param _fullEval the full evaluation function +// * @param _eval neighbor's evaluation function +// * @param _cool a cooling schedule +// * @param _cont an external continuator +// */ +// moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, moCoolingSchedule& _cool, moContinuator& _cont): +// moLocalSearch(explorer, _cont, _fullEval), +// defaultCool(0, 0, 0, 0), +// explorer(_neighborhood, _eval, defaultSolNeighborComp, _cool) +// {} +// +// /** +// * General constructor for a simulated annealing +// * @param _neighborhood the neighborhood +// * @param _fullEval the full evaluation function +// * @param _eval neighbor's evaluation function +// * @param _cool a cooling schedule +// * @param _comp a solution vs neighbor comparator +// * @param _cont an external continuator +// */ +// moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, moCoolingSchedule& _cool, moSolNeighborComparator& _comp, moContinuator& _cont): +// moLocalSearch(explorer, _cont, _fullEval), +// defaultCool(0, 0, 0, 0), +// explorer(_neighborhood, _eval, _comp, _cool) +// {} /** * General constructor for a simulated annealing @@ -102,19 +126,75 @@ public: * @param _comp a solution vs neighbor comparator * @param _cont an external continuator */ - moSA(Neighborhood& _neighborhood, eoEvalFunc& _fullEval, moEval& _eval, moCoolingSchedule& _cool, moSolNeighborComparator& _comp, moContinuator& _cont): - moLocalSearch(explorer, _cont, _fullEval), - defaultCool(0, 0, 0, 0), - explorer(_neighborhood, _eval, _comp, _cool) - {} - - + moSA ( + Neighborhood& _neighborhood, + eoEvalFunc& _fullEval, + moCoolingSchedule& _cool, + eoOptional< moEval > _eval = NULL, + eoOptional< moContinuator > _cont = NULL, + eoOptional< moSolNeighborComparator > _comp = NULL + ) + /*: moLocalSearch(explorer, _cont.hasValue()? _cont.get(): *(trueCont = new moTrueContinuator()), _fullEval), + defaultCool(NULL), // removed in C++11 with unique_ptr + default_eval(NULL), // removed in C++11 with unique_ptr + defaultSolNeighborComp(NULL), // removed in C++11 with unique_ptr + trueCont(NULL), // removed in C++11 with unique_ptr + explorer ( + _neighborhood, + _eval.hasValue()? _eval.get(): *(default_eval = new moFullEvalByCopy(_fullEval)), + // C++11: _eval.hasValue()? _eval.get(): default_eval = new moFullEvalByCopy(), + _comp.hasValue()? _comp.get(): *(defaultSolNeighborComp = new moSolNeighborComparator()), + _cool ) + { }*/ + : moLocalSearch ( + *(explorer = new moSAexplorer ( + _neighborhood, + _eval.hasValue()? _eval.get(): *(default_eval = new moFullEvalByCopy(_fullEval)), + // C++11: _eval.hasValue()? _eval.get(): default_eval = new moFullEvalByCopy(), + _comp.hasValue()? _comp.get(): *(defaultSolNeighborComp = new moSolNeighborComparator()), + _cool )), + _cont.hasValue()? _cont.get(): *(trueCont = new moTrueContinuator()), _fullEval ), + defaultCool(NULL), // removed in C++11 with unique_ptr + default_eval(NULL), // removed in C++11 with unique_ptr + trueCont(NULL), // removed in C++11 with unique_ptr + defaultSolNeighborComp(NULL) // removed in C++11 with unique_ptr + { } + + moSA ( + moSAexplorer& _explorer, + eoOptional< moContinuator > _cont = NULL, + ) + : moLocalSearch ( + *(explorer = &_explorer), + _cont.hasValue()? _cont.get(): *(trueCont = new moTrueContinuator()), _fullEval ), + defaultCool(NULL), // removed in C++11 with unique_ptr + default_eval(NULL), // removed in C++11 with unique_ptr + trueCont(NULL), // removed in C++11 with unique_ptr + defaultSolNeighborComp(NULL) // removed in C++11 with unique_ptr + { } + + virtual ~moSA () + { + // Note: using unique_ptr would allow us to remove this explicit destructor, but they were only introduced in C++11 + if (trueCont != NULL) + delete trueCont; + if (defaultSolNeighborComp != NULL) + delete defaultSolNeighborComp; + if (default_eval != NULL) + delete default_eval; + if (defaultCool != NULL) + delete defaultCool; + delete explorer; + } private: - moTrueContinuator trueCont; - moSimpleCoolingSchedule defaultCool; - moSolNeighborComparator defaultSolNeighborComp; - moSAexplorer explorer; + moSAexplorer* explorer; // Not NULL + moSimpleCoolingSchedule* defaultCool; // C++11: const std::unique_ptr> + moFullEvalByCopy* default_eval; + moTrueContinuator* trueCont; + moSolNeighborComparator* defaultSolNeighborComp; }; #endif + + diff --git a/mo/src/continuator/moFitnessMomentsStat.h b/mo/src/continuator/moFitnessMomentsStat.h index 794d113b8..0aaa5ad48 100644 --- a/mo/src/continuator/moFitnessMomentsStat.h +++ b/mo/src/continuator/moFitnessMomentsStat.h @@ -1,35 +1,26 @@ /* - - Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 - Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau +(c) Thales group, 2010 - This software is governed by the CeCILL license under French law and - abiding by the rules of distribution of free software. You can use, - modify and/ or redistribute the software under the terms of the CeCILL - license as circulated by CEA, CNRS and INRIA at the following URL - "http://www.cecill.info". + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; + version 2 of the License. - As a counterpart to the access to the source code and rights to copy, - modify and redistribute granted by the license, users are provided only - with a limited warranty and the software's author, the holder of the - economic rights, and the successive licensors have only limited liability. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. - In this respect, the user's attention is drawn to the risks associated - with loading, using, modifying and/or developing or reproducing the - software by the user in light of its specific status of free software, - that may mean that it is complicated to manipulate, and that also - therefore means that it is reserved for developers and experienced - professionals having in-depth computer knowledge. Users are therefore - encouraged to load and test the software's suitability as regards their - requirements in conditions enabling the security of their systems and/or - data to be ensured and, more generally, to use and operate it in the - same conditions as regards security. - The fact that you are presently reading this means that you have had - knowledge of the CeCILL license and that you accept its terms. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Contact: http://eodev.sourceforge.net + +Authors: +Lionel Parreaux - ParadisEO WebSite : http://paradiseo.gforge.inria.fr - Contact: paradiseo-help@lists.gforge.inria.fr */ #ifndef moFitnessMomentsStat_h diff --git a/mo/src/coolingSchedule/moTrikiCoolingSchedule.h b/mo/src/coolingSchedule/moTrikiCoolingSchedule.h index e120f9440..202b2d2f2 100644 --- a/mo/src/coolingSchedule/moTrikiCoolingSchedule.h +++ b/mo/src/coolingSchedule/moTrikiCoolingSchedule.h @@ -141,10 +141,10 @@ public: //costs_sum += _solution.fitness(); //varStat(_solution); if (statIsInitialized) - momStat(_solution); - else momStat.init(_solution), statIsInitialized = true; + momentStat(_solution); + else momentStat.init(_solution), statIsInitialized = true; - //cout << _solution.fitness() << " avgCost=" << momStat.value().first << endl; + //cout << _solution.fitness() << " avgCost=" << momentStat.value().first << endl; } @@ -167,21 +167,20 @@ public: //double avgCost = costs_sum/(double)accepted; //double stdDev = sqrt(varStat.value()); // WARNING: IT'S NO MORE THE AVG COST, NOW IT'S THE STD DEV! //double variance = varStat.value(); - double avgCost = momStat.value().first; - double variance = momStat.value().second; + double avgCost = momentStat.value().first; + double variance = momentStat.value().second; double stdDev = sqrt(variance); double sigma = stdDev; double delta = sigma/mu2; //outf << avgCost << endl; - //outf << _temp << endl; - outf << prevAvgCost-delta << endl; + outf << _temp << endl; + //outf << prevAvgCost-delta << endl; accepted = generated = costs_sum = 0; - //varStat.init(_solution);//TODON use next chain's first sol - //momStat.init(_solution);//TODONE use next chain's first sol + //momentStat.init(_solution);//TODONE use next chain's first sol statIsInitialized = false; /// @@ -342,7 +341,7 @@ private: bool reinitializing, terminated; //moFitnessVarianceStat varStat; - moFitnessMomentsStat momStat; + moFitnessMomentsStat momentStat; bool statIsInitialized; ofstream outf; diff --git a/mo/src/explorer/moSAexplorer.h b/mo/src/explorer/moSAexplorer.h index 37fa57955..a3e729330 100644 --- a/mo/src/explorer/moSAexplorer.h +++ b/mo/src/explorer/moSAexplorer.h @@ -68,7 +68,16 @@ public: * @param _solNeighborComparator a solution vs neighbor comparator * @param _coolingSchedule the cooling schedule */ - moSAexplorer(Neighborhood& _neighborhood, moEval& _eval, moSolNeighborComparator& _solNeighborComparator, moCoolingSchedule& _coolingSchedule) : moNeighborhoodExplorer(_neighborhood, _eval), solNeighborComparator(_solNeighborComparator), coolingSchedule(_coolingSchedule) { + moSAexplorer ( + Neighborhood& _neighborhood, + moEval& _eval, + moSolNeighborComparator& _solNeighborComparator, + moCoolingSchedule& _coolingSchedule + ) + : moNeighborhoodExplorer(_neighborhood, _eval), + solNeighborComparator(_solNeighborComparator), + coolingSchedule(_coolingSchedule) + { isAccept = false; if (!neighborhood.isRandom()) { diff --git a/mo/src/mo.h b/mo/src/mo.h index 2a56a86a5..3e65f8081 100755 --- a/mo/src/mo.h +++ b/mo/src/mo.h @@ -105,6 +105,7 @@ #include #include #include +#include #include #include @@ -112,6 +113,7 @@ #include #include #include +#include #include #include @@ -207,5 +209,6 @@ #include #include #include +#include #endif diff --git a/mo/src/trikisa b/mo/src/trikisa deleted file mode 100644 index 63f59ff9a..000000000 --- a/mo/src/trikisa +++ /dev/null @@ -1,22 +0,0 @@ -// (c) Thales group, 2010 -/* - Authors: - Johann Dreo - Caner Candan -*/ - -#ifndef _trikisa_ -#define _trikisa_ - -#include "moRealNeighbor.h" -#include "moRealNeighborhood.h" -#include "moStdDevEstimator.h" -#include "moTrikiCoolingSchedule.h" -#include "moFitnessVarianceStat.h" // TODO rm -#include "moFitnessMomentsStat.h" - -#endif // !_trikisa_ - -// Local Variables: -// mode: C++ -// End: diff --git a/mo/test/t-moTriki.cpp b/mo/test/t-moTriki.cpp index e69de29bb..d8f5e7119 100644 --- a/mo/test/t-moTriki.cpp +++ b/mo/test/t-moTriki.cpp @@ -0,0 +1,155 @@ +//============================================================================ +// Name : Trikitest.cpp +// Author : +// Version : +// Copyright : Your copyright notice +// Description : Hello World in C++, Ansi-style +//============================================================================ + +//#define HAVE_GNUPLOT + +#include +using namespace std; + +#include +#include + +//Representation and initializer +#include +#include +#include + +/* +// fitness function +#include +#include +#include + +//Neighbors and Neighborhoods +#include +#include + +//Algorithm and its components +#include +#include + +//comparator +#include + +//continuators +#include +#include +#include +#include +#include +*/ + +//----------------------------------------------------------------------------- +// Define types of the representation solution, different neighbors and neighborhoods +//----------------------------------------------------------------------------- +typedef eoInt Queen; //Permutation (Queen's problem representation) + +typedef moShiftNeighbor shiftNeighbor; //shift Neighbor +typedef moRndWithReplNeighborhood rndShiftNeighborhood; //rnd shift Neighborhood (Indexed) + + + + +int main() { + //cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!! + //return 0; + + unsigned vecSize = 8; + + + queenEval fullEval; + + + /* ========================================================= + * + * Initilization of the solution + * + * ========================================================= */ + + eoInitPermutation init(vecSize); + + /* ========================================================= + * + * evaluation of a neighbor solution + * + * ========================================================= */ + + moFullEvalByCopy shiftEval(fullEval); /// by default + + /* ========================================================= + * + * the neighborhood of a solution + * + * ========================================================= */ + + rndShiftNeighborhood rndShiftNH((vecSize-1) * (vecSize-1)); + + /* ========================================================= + * + * the cooling schedule of the process + * + * ========================================================= */ + + /* ========================================================= + * + * the local search algorithm + * + * ========================================================= */ + + /* ========================================================= + * + * execute the local search from random solution + * + * ========================================================= */ + + Queen solution1; + + init(solution1); + + fullEval(solution1); + + moStdDevEstimator initTemp (500, rndShiftNH, fullEval); + + moTrueContinuator continuator; + moCheckpoint checkpoint(continuator); + moFitnessStat fitStat; + checkpoint.add(fitStat); + eoFileMonitor monitor("triki.out", ""); + eoGnuplot1DMonitor monitor2("trikignu.out", true); + moCounterMonitorSaver countMon(100, monitor); + checkpoint.add(countMon); + moCounterMonitorSaver gnuMon (1, monitor2); + checkpoint.add(gnuMon); + monitor.add(fitStat); + monitor2.add(fitStat); + //#ifdef HAVE_GNUPLOT + + + moTrikiCoolingSchedule coolingSchedule(rndShiftNH, shiftEval, initTemp(solution1)); + moSA localSearch1(rndShiftNH, fullEval, coolingSchedule, shiftEval, checkpoint); + + + std::cout << "#########################################" << std::endl; + std::cout << "initial solution1: " << solution1 << std::endl ; + + localSearch1(solution1); + + std::cout << "final solution1: " << solution1 << std::endl ; + std::cout << "#########################################" << std::endl; + + + +} + + + + + + + + diff --git a/mo/test/t-moTrikiReal.cpp b/mo/test/t-moTrikiReal.cpp index 9b8038ba7..0ee694652 100644 --- a/mo/test/t-moTrikiReal.cpp +++ b/mo/test/t-moTrikiReal.cpp @@ -28,8 +28,6 @@ Lionel Parreaux #include #include -//#include - #include #include "neighborhood/moRealNeighbor.h" @@ -40,10 +38,6 @@ Lionel Parreaux #include "coolingSchedule/moTrikiCoolingSchedule.h" -//#include "moRealInitTemperature.h" - -//#include "do/make_real_init_temperature.h" - typedef eoReal< eoMinimizingFitness > EOT; typedef moRealNeighbor< EOT > Neighbor; @@ -52,9 +46,9 @@ double objective_function(const EOT & sol) double sum = 0; for ( size_t i = 0; i < sol.size(); ++i ) - { - sum += sol[i] * sol[i]; - } + { + sum += sol[i] * sol[i]; + } return sum; } @@ -66,18 +60,10 @@ int main( int ac, char** av ) eoState state; eoEvalFuncPtr< EOT, double > eval( objective_function ); - moFullEvalByCopy< Neighbor > fullEval( eval ); - - //moNeighborhood< Neighbor >* neighborhood; + moFullEvalByCopy< Neighbor > neval( eval ); int dimSize = 20; - //moRealInitTemperature< EOT >& real_init = do_make_real_init_temperature( parser, state, eval ); - //moInitTemperature< EOT, Neighbor >& real_init = do_make_real_init_temperature( parser, state, eval, neval ); - //moInitTemperature< EOT, Neighbor >& real_init = do_make_init_temperature( parser, state, eval, neval, neighborhood ); - //moStdDevEstimator< EOT, Neighbor >& real_init = do_make_init_temperature( parser, state, eval, neval, neighborhood, dimSize ); - - //------------------------------------------------------- // Parameters //------------------------------------------------------- @@ -87,8 +73,7 @@ int main( int ac, char** av ) unsigned int dimension_size = parser.getORcreateParam( (unsigned int)dimSize, "dimension-size", "Dimension size", 'd', section ).value(); double jump_bound = parser.getORcreateParam( (double)1, "jump-bound", "Bound of jump", '\0', section ).value(); unsigned int maxiter = parser.getORcreateParam( (unsigned int)10, "max-iter", "Maximum number of iterations", '\0', section ).value(); - //unsigned int ratio = parser.getORcreateParam( (unsigned int)1, "ratio", "Bounder ratio", '\0', section ).value(); // not used - + //------------------------------------------------------- @@ -102,13 +87,9 @@ int main( int ac, char** av ) edoSamplerUniform< EOT > sampler( bounder_search ); - //moRealNeighborhood< edoUniform< EOT >, Neighbor >* neighborhood = new moRealNeighborhood< edoUniform< EOT >, Neighbor >( *distrib, *sampler, *bounder_search ); moRealNeighborhood< edoUniform< EOT >, Neighbor > neighborhood( distrib, sampler, bounder_search ); - //state.storeFunctor(neighborhood);state.storeFunctor(neighborhood); - - //moStdDevEstimator< EOT, Neighbor >* init = new moStdDevEstimator< EOT, Neighbor >( *neighborhood, fullEval, eval, maxiter ); - //moStdDevEstimator< EOT, Neighbor > init( maxiter, neighborhood, fullEval, eval ); - moStdDevEstimator< EOT, Neighbor > init( maxiter, neighborhood, fullEval ); + + moStdDevEstimator< EOT, Neighbor > init( maxiter, neighborhood, eval ); //------------------------------------------------------- @@ -129,57 +110,52 @@ int main( int ac, char** av ) //------------------------------------------------------- - - //EOT solution(2, 5); + EOT solution(dimSize, 5); - /* - real_init( solution ); - - std::cout << "do_make_real_init_temperature( parser, eval ): " - << real_init.value() - << std::endl; - */ - - std::cout << "do_make_real_init_temperature( parser, eval ): " - << init( solution ) - << std::endl; + + std::cout << "init temp: " + << init( solution ) + << std::endl; - moTrueContinuator continuator; - moCheckpoint checkpoint(continuator); - moFitnessStat fitStat; - checkpoint.add(fitStat); - eoFileMonitor monitor("triki.out", ""); - //eoGnuplot1DMonitor monitor2("trikignu.out", true); - moCounterMonitorSaver countMon(1, monitor); - checkpoint.add(countMon); - //moCounterMonitorSaver gnuMon (1, monitor2); - //checkpoint.add(gnuMon); - monitor.add(fitStat); - //monitor2.add(fitStat); - + moTrueContinuator continuator; + moCheckpoint checkpoint(continuator); + moFitnessStat fitStat; + checkpoint.add(fitStat); + eoFileMonitor monitor("triki.out", ""); + //eoGnuplot1DMonitor monitor2("trikignu.out", true); + moCounterMonitorSaver countMon(1, monitor); + checkpoint.add(countMon); + //moCounterMonitorSaver gnuMon (1, monitor2); + //checkpoint.add(gnuMon); + monitor.add(fitStat); + //monitor2.add(fitStat); - moTrikiCoolingSchedule coolingSchedule ( - neighborhood, neval, init( solution ), - //50, - 200, //150, - //100 - 350 // 250 - ); - moSA localSearch(*neighborhood, eval, fullEval, coolingSchedule, checkpoint); - - std::cout << "#########################################" << std::endl; - std::cout << "initial solution1: " << solution << std::endl ; - - localSearch(solution); - - std::cout << "final solution1: " << solution << std::endl ; - std::cout << "#########################################" << std::endl; - - //delete neighborhood; + + moTrikiCoolingSchedule coolingSchedule ( + neighborhood, neval, init( solution ), + //50, + 200, //150, + //100 + 350 // 250 + ); + //moSA localSearch(neighborhood, eval, neval, coolingSchedule, checkpoint); + //moSA localSearch(neighborhood, eval, neval); + //moSA localSearch(neighborhood, eval, coolingSchedule, neval, checkpoint); + //moSA localSearch(neighborhood, eval, coolingSchedule); + moSA localSearch(neighborhood, eval, coolingSchedule, neval, checkpoint); + + std::cout << "#########################################" << std::endl; + std::cout << "initial solution1: " << solution << std::endl ; + + localSearch(solution); + + std::cout << "final solution1: " << solution << std::endl ; + std::cout << "#########################################" << std::endl; + return 0; }