diff --git a/trunk/paradiseo-peo/README b/trunk/paradiseo-peo/README index d60eb05c3..d74cb5d67 100755 --- a/trunk/paradiseo-peo/README +++ b/trunk/paradiseo-peo/README @@ -61,19 +61,13 @@ structure: | +-- examples TSP | - +-- Introduction Technical introduction - | +-- Lesson1 Parallel evaluation for EA and PSO | +-- Lesson2 Parallel transformation (crossover + mutation) for EA | +-- Lesson3 Insular model for PSO and EA | - +-- Lesson4 PSO and EA completely parallel - | - +-- Lesson5 Hybridization - | - +-- Lesson6 Multi-start : several local searches + +-- Lesson4 Hybridization =================================================================== NOTES diff --git a/trunk/paradiseo-peo/tutorial/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/CMakeLists.txt index 8faaf0d9b..d80c2e91b 100644 --- a/trunk/paradiseo-peo/tutorial/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/CMakeLists.txt @@ -14,6 +14,6 @@ SET(FLOWSHOP_BIN_DIR "${MOEO_BIN_DIR}/tutorial/examples/flowshop" CACHE PATH "Fl ### 2) Where must cmake go now ? ###################################################################################### -SUBDIRS(examples Lesson1 Lesson2 Lesson3 Lesson4 Lesson5) +SUBDIRS(examples Lesson1 Lesson2 Lesson3 Lesson4) ###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson1/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson1/CMakeLists.txt index 8471c7464..44e559876 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson1/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson1/CMakeLists.txt @@ -74,7 +74,7 @@ SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${LESSON1_VERSION}") ### 5) Link the librairies ###################################################################################### -TARGET_LINK_LIBRARIES(pso ${XML2_LIBS} peo rmc_mpi eo eoutils) -TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils) +TARGET_LINK_LIBRARIES(pso ${XML2_LIBS} peo rmc_mpi eo eoutils peo) +TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils peo) ###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson2/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson2/CMakeLists.txt index 9056238f7..2946186b4 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson2/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson2/CMakeLists.txt @@ -71,6 +71,6 @@ SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${LESSON2_VERSION}") ### 5) Link the librairies ###################################################################################### -TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils) +TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils peo) ###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson3/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson3/CMakeLists.txt index 576600262..aa315bab6 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson3/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson3/CMakeLists.txt @@ -74,8 +74,8 @@ SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${LESSON3_VERSION}") ### 5) Link the librairies ###################################################################################### -TARGET_LINK_LIBRARIES(pso ${XML2_LIBS} peo rmc_mpi eo eoutils) -TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils) +TARGET_LINK_LIBRARIES(pso ${XML2_LIBS} peo rmc_mpi eo eoutils peo) +TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils peo) ###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson4/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson4/CMakeLists.txt index 6b16a0a72..230c3d91f 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson4/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson4/CMakeLists.txt @@ -54,8 +54,6 @@ ENDIF(WIN32 AND NOT CYGWIN) ### 3) Define your target(s): just an executable here ###################################################################################### -ADD_EXECUTABLE(lsea mainLSEA.cpp) -ADD_DEPENDENCIES(lsea tsp peo rmc_mpi) ADD_EXECUTABLE(eals mainEALS.cpp) ADD_DEPENDENCIES(eals tsp peo rmc_mpi) @@ -67,7 +65,6 @@ ADD_DEPENDENCIES(eals tsp peo rmc_mpi) ###################################################################################### SET(LESSON4_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(lsea PROPERTIES VERSION "${LESSON4_VERSION}") SET_TARGET_PROPERTIES(eals PROPERTIES VERSION "${LESSON4_VERSION}") ###################################################################################### @@ -77,7 +74,6 @@ SET_TARGET_PROPERTIES(eals PROPERTIES VERSION "${LESSON4_VERSION}") ### 5) Link the librairies ###################################################################################### -TARGET_LINK_LIBRARIES(lsea ${XML2_LIBS} tsp peo rmc_mpi eo eoutils) -TARGET_LINK_LIBRARIES(eals ${XML2_LIBS} tsp peo rmc_mpi eo eoutils) +TARGET_LINK_LIBRARIES(eals ${XML2_LIBS} tsp peo rmc_mpi eo eoutils peo) ###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson4/mainLSEA.cpp b/trunk/paradiseo-peo/tutorial/Lesson4/mainLSEA.cpp deleted file mode 100644 index 78a5cda45..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson4/mainLSEA.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, INRIA, 2007 -* -* Clive Canape -* -* 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". -* -* 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. -* -* 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. -* -* ParadisEO WebSite : http://paradiseo.gforge.inria.fr -* Contact: paradiseo-help@lists.gforge.inria.fr -* -*/ - -#include "param.h" -#include "route_init.h" -#include "route_eval.h" -#include "order_xover.h" -#include "edge_xover.h" -#include "partial_mapped_xover.h" -#include "city_swap.h" -#include "part_route_eval.h" -#include "merge_route_eval.h" -#include "two_opt_init.h" -#include "two_opt_next.h" -#include "two_opt_incr_eval.h" - -#include - -#define POP_SIZE 10 -#define NUM_GEN 200 -#define CROSS_RATE 1.0 -#define MUT_RATE 0.1 - - -int main (int __argc, char * * __argv) -{ - - peo :: init (__argc, __argv); - loadParameters (__argc, __argv); - RouteInit route_init; - RouteEval full_eval; - OrderXover order_cross; - PartialMappedXover pm_cross; - EdgeXover edge_cross; - CitySwap city_swap_mut; - -// Local search - TwoOptInit pmx_two_opt_init; - TwoOptNext pmx_two_opt_next; - TwoOptIncrEval pmx_two_opt_incr_eval; - moBestImprSelect pmx_two_opt_move_select; - moHC hc (pmx_two_opt_init, pmx_two_opt_next, pmx_two_opt_incr_eval, pmx_two_opt_move_select, full_eval); - eoPop pop (POP_SIZE, route_init); - peoMultiStart initParallelHC (hc); - peoWrapper parallelHC (initParallelHC, pop); - initParallelHC.setOwner(parallelHC); - peo :: run( ); - peo :: finalize( ); - - if (getNodeRank()==1) - { - std :: cout << "\nResult before the EA\n"; - pop.sort(); - for (unsigned i=0;i cont (NUM_GEN); - eoCheckPoint checkpoint (cont); - eoEvalFuncCounter< Route > eval(full_eval); - eoStochTournamentSelect select_one; - eoSelectNumber select (select_one, POP_SIZE); - eoSGATransform transform (order_cross, CROSS_RATE, city_swap_mut, MUT_RATE); - eoEPReplacement replace (2); - eoEasyEA< Route > eaAlg( checkpoint, eval, select, transform, replace ); - peoWrapper parallelEA( eaAlg, pop); - peo :: run (); - peo :: finalize (); - - if (getNodeRank()==1) - { - std :: cout << "\nResult after the EA\n"; - pop.sort(); - for (unsigned i=0;i