From ae4f8808274d8157c3b57ede5cc0cdf960aa32ac Mon Sep 17 00:00:00 2001 From: jboisson Date: Wed, 5 Mar 2008 15:55:41 +0000 Subject: [PATCH] Package have been updated according to the tests under Windows git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1078 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-mo/tutorial/CMakeLists.txt | 64 +++++++++++++++++-- .../tutorial/Lesson1/CMakeLists.txt | 14 +--- .../tutorial/Lesson1/minimize_function.cpp | 2 +- trunk/paradiseo-mo/tutorial/Lesson1/param | 2 +- .../tutorial/Lesson2/CMakeLists.txt | 14 +--- .../tutorial/Lesson2/hill_climbing.cpp | 15 ----- .../tutorial/Lesson3/CMakeLists.txt | 15 +---- .../tutorial/Lesson3/tabu_search.cpp | 15 ----- .../tutorial/Lesson4/CMakeLists.txt | 15 +---- .../tutorial/Lesson4/simulated_annealing.cpp | 15 ----- .../tutorial/Lesson5/CMakeLists.txt | 14 +--- .../Lesson5/iterated_local_search.cpp | 15 ----- .../tutorial/examples/function/CMakeLists.txt | 4 +- .../examples/function/affectation_init.h | 2 +- .../examples/function/deviation_incr_eval.cpp | 4 -- .../examples/function/deviation_incr_eval.h | 2 +- .../examples/function/deviation_next.cpp | 10 +-- .../tutorial/examples/tsp/CMakeLists.txt | 21 +----- 18 files changed, 83 insertions(+), 160 deletions(-) diff --git a/trunk/paradiseo-mo/tutorial/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/CMakeLists.txt index 2618942fa..8a762d254 100644 --- a/trunk/paradiseo-mo/tutorial/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/CMakeLists.txt @@ -3,11 +3,11 @@ ### 1) Definitions (required for tsp target) ###################################################################################### -SET(TSP_SRC_DIR ${ParadisEO-MO_SOURCE_DIR}/tutorial/examples/tsp CACHE PATH "TSP src directory") -SET(TSP_BINARY_DIR ${ParadisEO-MO_BINARY_DIR}/tutorial/examples/tsp CACHE PATH "TSP binary directory") +SET(TSP_SRC_DIR ${MO_SRC_DIR}/tutorial/examples/tsp CACHE PATH "TSP src directory") +SET(TSP_BIN_DIR ${MO_BIN_DIR}/tutorial/examples/tsp CACHE PATH "TSP binary directory") -SET(FUNCTION_SRC_DIR ${ParadisEO-MO_SOURCE_DIR}/tutorial/examples/function CACHE PATH "FUNCTION src directory") -SET(FUNCTION_BINARY_DIR ${ParadisEO-MO_BINARY_DIR}/tutorial/examples/function CACHE PATH "FUNCTION binary directory") +SET(FUNCTION_SRC_DIR ${MO_SRC_DIR}/tutorial/examples/function CACHE PATH "FUNCTION src directory") +SET(FUNCTION_BIN_DIR ${MO_BIN_DIR}/tutorial/examples/function CACHE PATH "FUNCTION binary directory") ###################################################################################### @@ -18,3 +18,59 @@ SET(FUNCTION_BINARY_DIR ${ParadisEO-MO_BINARY_DIR}/tutorial/examples/function CA SUBDIRS(examples Lesson1 Lesson2 Lesson3 Lesson4 Lesson5) ###################################################################################### + + +ADD_CUSTOM_TARGET(install DEPENDS ${MO_SRC_DIR}/tutorial/examples/tsp/benchs + ${MO_SRC_DIR}/tutorial/Lesson1/param + ${MO_SRC_DIR}/tutorial/Lesson2/param + ${MO_SRC_DIR}/tutorial/Lesson3/param + ${MO_SRC_DIR}/tutorial/Lesson4/param + ${MO_SRC_DIR}/tutorial/Lesson5/param ) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_directory + ${MO_SRC_DIR}/tutorial/examples/tsp/benchs + ${MO_BIN_DIR}/tutorial/examples/tsp/benchs) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${MO_SRC_DIR}/tutorial/Lesson1/param + ${MO_BIN_DIR}/tutorial/Lesson1) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${MO_SRC_DIR}/tutorial/Lesson2/param + ${MO_BIN_DIR}/tutorial/Lesson2) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${MO_SRC_DIR}/tutorial/Lesson3/param + ${MO_BIN_DIR}/tutorial/Lesson3) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${MO_SRC_DIR}/tutorial/Lesson4/param + ${MO_BIN_DIR}/tutorial/Lesson4) + +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${MO_SRC_DIR}/tutorial/Lesson5/param + ${MO_BIN_DIR}/tutorial/Lesson5) diff --git a/trunk/paradiseo-mo/tutorial/Lesson1/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/Lesson1/CMakeLists.txt index a985fbe93..68186cff2 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson1/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/Lesson1/CMakeLists.txt @@ -4,27 +4,17 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils) -INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${FUNCTION_SRC_DIR}) ###################################################################################### -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson1/param ) - -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson1/param - ${ParadisEO-MO_BINARY_DIR}/tutorial/Lesson1) - ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${FUNCTION_BINARY_DIR}/lib) + LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${FUNCTION_BIN_DIR}/lib) ENDIF(NOT WIN32 OR CYGWIN) # especially for Visual Studio diff --git a/trunk/paradiseo-mo/tutorial/Lesson1/minimize_function.cpp b/trunk/paradiseo-mo/tutorial/Lesson1/minimize_function.cpp index f24786ee7..c69acd9f8 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson1/minimize_function.cpp +++ b/trunk/paradiseo-mo/tutorial/Lesson1/minimize_function.cpp @@ -114,7 +114,7 @@ manage_configuration_file(eoParser & _parser) _parser.createParam((double)1, "searchBound", "Bound for neighbourhood exploration.", 0, "Configuration", false); - _parser.createParam((double)0.5, "searchStep", "Step between two values during the neighbourhood exploration.", + _parser.createParam((double)1, "searchStep", "Step between two values during the neighbourhood exploration.", 0, "Configuration", false); _parser.createParam(std::string("First"), "selectionType", "Type of the selection: 'Best', 'First' or 'Random'.", diff --git a/trunk/paradiseo-mo/tutorial/Lesson1/param b/trunk/paradiseo-mo/tutorial/Lesson1/param index fac431e63..726b2e29f 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson1/param +++ b/trunk/paradiseo-mo/tutorial/Lesson1/param @@ -6,5 +6,5 @@ ###### Configuration ###### # --initialBound=1 # Bound for the initial affectation. # --searchBound=1 # Bound for neighbourhood exploration. -# --searchStep=0.5 # Step between two values during the neighbourhood exploration. +# --searchStep=1 # Step between two values during the neighbourhood exploration. # --selectionType=First # Type of the selection: 'Best', 'First' or 'Random'. diff --git a/trunk/paradiseo-mo/tutorial/Lesson2/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/Lesson2/CMakeLists.txt index cacd22894..0c5ef5d5b 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson2/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/Lesson2/CMakeLists.txt @@ -6,26 +6,16 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils) -INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${TSP_SRC_DIR}) ###################################################################################### -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson2/param ) - -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson2/param - ${ParadisEO-MO_BINARY_DIR}/tutorial/Lesson2) - ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BINARY_DIR}/lib) + LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib) ENDIF(NOT WIN32 OR CYGWIN) # especially for Visual Studio diff --git a/trunk/paradiseo-mo/tutorial/Lesson2/hill_climbing.cpp b/trunk/paradiseo-mo/tutorial/Lesson2/hill_climbing.cpp index 7a29c8694..94fc3ae34 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson2/hill_climbing.cpp +++ b/trunk/paradiseo-mo/tutorial/Lesson2/hill_climbing.cpp @@ -110,23 +110,8 @@ manage_configuration_file(eoParser & _parser) { std::ofstream os; -#ifdef _MSVC - os.open("..\examples\tsp\benchs\berlin52.tsp"); - if(os.is_open()) - { - _parser.createParam(std::string("..\examples\tsp\benchs\berlin52.tsp"), "instancePath", "Path to the instance.", - 0, "Configuration", false); - } - else - { - _parser.createParam(std::string("..\..\examples\tsp\benchs\berlin52.tsp"), "instancePath", "Path to the instance.", - 0, "Configuration", false); - } - os.close(); -#else _parser.createParam(std::string("../examples/tsp/benchs/berlin52.tsp"), "instancePath", "Path to the instance.", 0, "Configuration", false); -#endif _parser.getORcreateParam((unsigned int)time(0), "seed", "Seed for rand.", 0, "Configuration", false); diff --git a/trunk/paradiseo-mo/tutorial/Lesson3/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/Lesson3/CMakeLists.txt index 3c7e8a761..454da7e3a 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson3/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/Lesson3/CMakeLists.txt @@ -6,27 +6,16 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils) -INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${TSP_SRC_DIR}) ###################################################################################### -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson3/param ) - -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson3/param - ${ParadisEO-MO_BINARY_DIR}/tutorial/Lesson3) - - ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BINARY_DIR}/lib) + LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib) ENDIF(NOT WIN32 OR CYGWIN) # especially for Visual Studio diff --git a/trunk/paradiseo-mo/tutorial/Lesson3/tabu_search.cpp b/trunk/paradiseo-mo/tutorial/Lesson3/tabu_search.cpp index 12ae801ec..ce67cbbec 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson3/tabu_search.cpp +++ b/trunk/paradiseo-mo/tutorial/Lesson3/tabu_search.cpp @@ -117,23 +117,8 @@ manage_configuration_file(eoParser & _parser) { std::ofstream os; -#ifdef _MSVC - os.open("..\examples\tsp\benchs\berlin52.tsp"); - if(os.is_open()) - { - _parser.createParam(std::string("..\examples\tsp\benchs\berlin52.tsp"), "instancePath", "Path to the instance.", - 0, "Configuration", false); - } - else - { - _parser.createParam(std::string("..\..\examples\tsp\benchs\berlin52.tsp"), "instancePath", "Path to the instance.", - 0, "Configuration", false); - } - os.close(); -#else _parser.createParam(std::string("../examples/tsp/benchs/berlin52.tsp"), "instancePath", "Path to the instance.", 0, "Configuration", false); -#endif _parser.getORcreateParam((unsigned int)time(0), "seed", "Seed for rand.", 0, "Configuration", false); diff --git a/trunk/paradiseo-mo/tutorial/Lesson4/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/Lesson4/CMakeLists.txt index 0544cf360..b5e1329a6 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson4/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/Lesson4/CMakeLists.txt @@ -6,27 +6,16 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils) -INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${TSP_SRC_DIR}) ###################################################################################### -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson4/param ) - -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson4/param - ${ParadisEO-MO_BINARY_DIR}/tutorial/Lesson4) - - ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BINARY_DIR}/lib) + LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib) ENDIF(NOT WIN32 OR CYGWIN) # especially for Visual Studio diff --git a/trunk/paradiseo-mo/tutorial/Lesson4/simulated_annealing.cpp b/trunk/paradiseo-mo/tutorial/Lesson4/simulated_annealing.cpp index b37569c5e..5f5274806 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson4/simulated_annealing.cpp +++ b/trunk/paradiseo-mo/tutorial/Lesson4/simulated_annealing.cpp @@ -114,23 +114,8 @@ manage_configuration_file(eoParser & _parser) { std::ofstream os; -#ifdef _MSVC - os.open("..\examples\tsp\benchs\berlin52.tsp"); - if(os.is_open()) - { - _parser.createParam(std::string("..\examples\tsp\benchs\berlin52.tsp"), "instancePath", "Path to the instance.", - 0, "Configuration", false); - } - else - { - _parser.createParam(std::string("..\..\examples\tsp\benchs\berlin52.tsp"), "instancePath", "Path to the instance.", - 0, "Configuration", false); - } - os.close(); -#else _parser.createParam(std::string("../examples/tsp/benchs/berlin52.tsp"), "instancePath", "Path to the instance.", 0, "Configuration", false); -#endif _parser.getORcreateParam((unsigned int)time(0), "seed", "Seed for rand.", 0, "Configuration", false); diff --git a/trunk/paradiseo-mo/tutorial/Lesson5/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/Lesson5/CMakeLists.txt index 8d253ce7b..c390b64bc 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson5/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/Lesson5/CMakeLists.txt @@ -6,26 +6,16 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils) -INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src) INCLUDE_DIRECTORIES(${TSP_SRC_DIR}) ###################################################################################### -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson5/param ) - -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-MO_SOURCE_DIR}/tutorial/Lesson5/param - ${ParadisEO-MO_BINARY_DIR}/tutorial/Lesson5) - ###################################################################################### ### 2) Specify where CMake can find the libraries ###################################################################################### IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BINARY_DIR}/lib) + LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib) ENDIF(NOT WIN32 OR CYGWIN) # especially for Visual Studio diff --git a/trunk/paradiseo-mo/tutorial/Lesson5/iterated_local_search.cpp b/trunk/paradiseo-mo/tutorial/Lesson5/iterated_local_search.cpp index 6be41e4a9..8d8b42324 100644 --- a/trunk/paradiseo-mo/tutorial/Lesson5/iterated_local_search.cpp +++ b/trunk/paradiseo-mo/tutorial/Lesson5/iterated_local_search.cpp @@ -94,23 +94,8 @@ manage_configuration_file(eoParser & _parser) { std::ofstream os; -#ifdef _MSVC - os.open("..\examples\tsp\benchs\berlin52.tsp"); - if(os.is_open()) - { - _parser.createParam(std::string("..\examples\tsp\benchs\berlin52.tsp"), "instancePath", "Path to the instance.", - 0, "Configuration", false); - } - else - { - _parser.createParam(std::string("..\..\examples\tsp\benchs\berlin52.tsp"), "instancePath", "Path to the instance.", - 0, "Configuration", false); - } - os.close(); -#else _parser.createParam(std::string("../examples/tsp/benchs/berlin52.tsp"), "instancePath", "Path to the instance.", 0, "Configuration", false); -#endif _parser.getORcreateParam((unsigned int)time(0), "seed", "Seed for rand.", 0, "Configuration", false); diff --git a/trunk/paradiseo-mo/tutorial/examples/function/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/examples/function/CMakeLists.txt index 2407bf81b..c7c61e3c1 100644 --- a/trunk/paradiseo-mo/tutorial/examples/function/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/examples/function/CMakeLists.txt @@ -3,7 +3,7 @@ ###################################################################################### INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src) -INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src) ###################################################################################### @@ -12,7 +12,7 @@ INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) ### 1) Define your target(s): just the tsp here ###################################################################################### -SET(FUNCTION_LIB_OUTPUT_PATH ${FUNCTION_BINARY_DIR}/lib) +SET(FUNCTION_LIB_OUTPUT_PATH ${FUNCTION_BIN_DIR}/lib) SET(LIBRARY_OUTPUT_PATH ${FUNCTION_LIB_OUTPUT_PATH}) SET (FUNCTION_SOURCES affectation_eval.cpp diff --git a/trunk/paradiseo-mo/tutorial/examples/function/affectation_init.h b/trunk/paradiseo-mo/tutorial/examples/function/affectation_init.h index 4e01be428..a0be33a69 100644 --- a/trunk/paradiseo-mo/tutorial/examples/function/affectation_init.h +++ b/trunk/paradiseo-mo/tutorial/examples/function/affectation_init.h @@ -50,7 +50,7 @@ class AffectationInit : public eoInit void operator () (Affectation & _affectation) ; - //! A bound for the initial value for the deviations + //! A bound for the initial value for the affectation double bound; } ; diff --git a/trunk/paradiseo-mo/tutorial/examples/function/deviation_incr_eval.cpp b/trunk/paradiseo-mo/tutorial/examples/function/deviation_incr_eval.cpp index 28c0c10e2..440b18ae8 100644 --- a/trunk/paradiseo-mo/tutorial/examples/function/deviation_incr_eval.cpp +++ b/trunk/paradiseo-mo/tutorial/examples/function/deviation_incr_eval.cpp @@ -46,10 +46,6 @@ functionFitness DeviationIncrEval :: operator () (const Deviation & _move, const deltaX1=_move.first; deltaX2=_move.second; - /*std::cout << (_affectation.fitness() - + ( 2*deltaX1*deltaX1 ) + ( deltaX2*deltaX2 ) + ( deltaX1*deltaX2 ) - ( 2*deltaX1 ) - deltaX2 - + ( deltaX1 * ( (4*x1) + x2 ) ) + ( x2*deltaX1 )) << std::endl;*/ - return _affectation.fitness() + ( 2*deltaX1*deltaX1 ) + ( deltaX2*deltaX2 ) + ( deltaX1*deltaX2 ) - ( 2*deltaX1 ) - deltaX2 + ( deltaX1 * ( (4*x1) + x2 ) ) + ( x2*deltaX1 ); diff --git a/trunk/paradiseo-mo/tutorial/examples/function/deviation_incr_eval.h b/trunk/paradiseo-mo/tutorial/examples/function/deviation_incr_eval.h index 66530b41b..b3f4cda25 100644 --- a/trunk/paradiseo-mo/tutorial/examples/function/deviation_incr_eval.h +++ b/trunk/paradiseo-mo/tutorial/examples/function/deviation_incr_eval.h @@ -44,7 +44,7 @@ class DeviationIncrEval : public moMoveIncrEval { public : - functionFitness operator () (const Deviation & _move, const Affectation & _route) ; + functionFitness operator () (const Deviation & _move, const Affectation & _affectation); } ; diff --git a/trunk/paradiseo-mo/tutorial/examples/function/deviation_next.cpp b/trunk/paradiseo-mo/tutorial/examples/function/deviation_next.cpp index eaad2ae4e..bb36ae695 100644 --- a/trunk/paradiseo-mo/tutorial/examples/function/deviation_next.cpp +++ b/trunk/paradiseo-mo/tutorial/examples/function/deviation_next.cpp @@ -40,21 +40,21 @@ DeviationNext::DeviationNext(double _bound, double _step): bound(_bound), step(_ { if(bound<0.0) { - std::cout << "[affectation_next.cpp][DeviationNext]: bound is negative, " << bound << " is tranformed to "; + std::cout << "[deviation_next.cpp][DeviationNext]: bound is negative, " << bound << " is tranformed to "; bound=-bound; std::cout << bound << "." << std::endl; } if(step<0.0) { - std::cout << "[affectation_next.cpp][DeviationNext]: step is negative, " << step << " is tranformed to "; + std::cout << "[deviation_next.cpp][DeviationNext]: step is negative, " << step << " is tranformed to "; step=-step; std::cout << step << "." << std::endl; } if(step>bound) { - std::cout << "[affectation_next.cpp][DeviationNext]: step is higher than bound, " << step << " is tranformed to "; + std::cout << "[deviation_next.cpp][DeviationNext]: step is higher than bound, " << step << " is tranformed to "; step = bound / 2; std::cout << step << "." << std::endl; } @@ -71,12 +71,12 @@ bool DeviationNext::operator () (Deviation & _move, const Affectation & _affecta //std::cout << "deltaX1 = " << deltaX1 << ", deltaX2 = " << deltaX2 << std::endl; - if( (deltaX1>=bound) && (deltaX2)>=bound ) + if( (deltaX1 >= bound) && (deltaX2 > bound) ) { return false; } - if(deltaX2 >= bound) + if(deltaX2 > bound) { deltaX1+=step; deltaX2=-bound; diff --git a/trunk/paradiseo-mo/tutorial/examples/tsp/CMakeLists.txt b/trunk/paradiseo-mo/tutorial/examples/tsp/CMakeLists.txt index af8712140..46f666724 100755 --- a/trunk/paradiseo-mo/tutorial/examples/tsp/CMakeLists.txt +++ b/trunk/paradiseo-mo/tutorial/examples/tsp/CMakeLists.txt @@ -1,26 +1,9 @@ - -###################################################################################### -### 0) Copy the "benchs" directory in the build directory to easily run the lessons -###################################################################################### - -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MO_SOURCE_DIR}/tutorial/examples/tsp/benchs) -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_directory - ${ParadisEO-MO_SOURCE_DIR}/tutorial/examples/tsp/benchs - ${ParadisEO-MO_BINARY_DIR}/tutorial/examples/tsp/benchs) - -###################################################################################### - - ###################################################################################### ### 1) Include the sources ###################################################################################### INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src) -INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) +INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src) ###################################################################################### @@ -29,7 +12,7 @@ INCLUDE_DIRECTORIES(${ParadisEO-MO_SOURCE_DIR}/src) ### 2) Define your target(s): just the tsp here ###################################################################################### -SET(TSP_LIB_OUTPUT_PATH ${TSP_BINARY_DIR}/lib) +SET(TSP_LIB_OUTPUT_PATH ${TSP_BIN_DIR}/lib) SET(LIBRARY_OUTPUT_PATH ${TSP_LIB_OUTPUT_PATH}) SET (TSP_SOURCES graph.cpp