diff --git a/trunk/paradiseo-peo/CMakeLists.txt b/trunk/paradiseo-peo/CMakeLists.txt index 61a1aef56..d305808a6 100644 --- a/trunk/paradiseo-peo/CMakeLists.txt +++ b/trunk/paradiseo-peo/CMakeLists.txt @@ -1,28 +1,4 @@ -###################################################################################### -### 0) Preliminary checking: no WIN and libxml2 -###################################################################################### - -#IF(WIN32) -# MESSAGE (FATAL_ERROR "ParadisEO-PEO can not be generated on Windows systems") -#ENDIF(WIN32) - -# check libxml2 -FIND_PROGRAM(XML2_CONFIG_PROGRAM NAMES xml2-config PATHS /usr/local/bin /usr/bin DOC "The libxml2 (www.xmlsoft.org) configuration tool") - -IF(NOT XML2_CONFIG_PROGRAM) - #MESSAGE(FATAL_ERROR "Libxml2 cannot be found on your system. Libxml2 is required for ParadisEO-PEO install") -ENDIF(NOT XML2_CONFIG_PROGRAM) - -# set libxml2 cflags in XML2_CFLAGS -EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --cflags OUTPUT_VARIABLE XML2_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) -SET(XML2_CFLAGS_WITH_WHITESPACE " ${XML2_CFLAGS}") - -# set libxml2 libs in XML2_LIBS -EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --libs OUTPUT_VARIABLE XML2_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) -###################################################################################### - - ###################################################################################### ### 1) If you want to set your variables in peo-conf.cmake and avoid the cmd line ###################################################################################### @@ -40,43 +16,17 @@ INCLUDE(peo-conf.cmake OPTIONAL) PROJECT(ParadisEO-PEO) SET(PACKAGE_BUGREPORT "paradiseo-help@lists.gforge.inria.fr" CACHE STRING "Package bug report" FORCE) -SET(PACKAGE_NAME "ParadisEO-PEO Moving Objects" CACHE STRING "Package name" FORCE) +SET(PACKAGE_NAME "ParadisEO-PEO - Parallel and Distributed Evolving Objects" CACHE STRING "Package name" FORCE) SET(PACKAGE_STRING "ParadisEO-PEO 1.0" CACHE STRING "Package string full name" FORCE) SET(PACKAGE_VERSION "1.0" CACHE STRING "Package version" FORCE) SET(GLOBAL_VERSION "1.0" CACHE STRING "Global version" FORCE) SET(VERSION "1.0" CACHE STRING "Version" FORCE) - -# check cmake version compatibility -CMAKE_MINIMUM_REQUIRED(VERSION 2.4 FATAL_ERROR) - -# regular expression checking -INCLUDE_REGULAR_EXPRESSION("^.*$" "^$") - -# set a language for the entire project. -ENABLE_LANGUAGE(CXX) -ENABLE_LANGUAGE(C) - ##################################################################################### ##################################################################################### ### 3) Include required modules ##################################################################################### -INCLUDE(CMakeBackwardCompatibilityCXX) - -INCLUDE(FindDoxygen) - -INCLUDE(FindGnuplot) - -# check for some functions -INCLUDE(CheckLibraryExists) - -###################################################################################### - - -###################################################################################### -### 4) Include the main configuration variables -###################################################################################### # The "config" variable must be provided on the command line IF(NOT DEFINED config OR NOT config) @@ -94,71 +44,47 @@ INCLUDE(${config}) ### 4) Paths checking ###################################################################################### +#IF(WIN32) +# SET (ABSOLUTE_PATH_REGEX "^[A-Z]:|^[a-z]:") +#ELSE(WIN32) +# SET (ABSOLUTE_PATH_REGEX "^/") +#ENDIF(WIN32) + +#SET(REQUIRED_PATHS "EO_SRC_DIR" "EO_BIN_DIR" "MO_SRC_DIR" "MO_BIN_DIR" "MOEO_SRC_DIR" "MOEO_BIN_DIR") +#FOREACH (path ${REQUIRED_PATHS}) +# IF(EXISTS ${${path}}) +# MESSAGE (STATUS "Using ${path}=${${path}}") +# ELSE(EXISTS ${${path}}) +# MESSAGE (FATAL_ERROR "\n Cannot find \"${${path}}\". Please, fill \"${config}\" with a correct value for ${path} variable") +# ENDIF(EXISTS ${${path}}) +# +# IF(NOT ${${path}} MATCHES "${ABSOLUTE_PATH_REGEX}") +# MESSAGE (FATAL_ERROR "${${path}} MUST BE an absolute path") +# ENDIF(NOT ${${path}} MATCHES "${ABSOLUTE_PATH_REGEX}") +#ENDFOREACH (path ${REQUIRED_PATHS}) +###################################################################################### + + +###################################################################################### +### 0) Preliminary checking: no WIN and libxml2 +###################################################################################### + IF(WIN32) - SET (ABSOLUTE_PATH_REGEX "^[A-Z]:|^[a-z]:") -ELSE(WIN32) - SET (ABSOLUTE_PATH_REGEX "^/") + MESSAGE (FATAL_ERROR "ParadisEO-PEO can not be generated on Windows systems") ENDIF(WIN32) -SET(REQUIRED_PATHS "EO_SRC_DIR" "EO_BIN_DIR" "MO_SRC_DIR" "MO_BIN_DIR" "MOEO_SRC_DIR" "MOEO_BIN_DIR") -FOREACH (path ${REQUIRED_PATHS}) - IF(EXISTS ${${path}}) - MESSAGE (STATUS "Using ${path}=${${path}}") - ELSE(EXISTS ${${path}}) - MESSAGE (FATAL_ERROR "\n Cannot find \"${${path}}\". Please, fill \"${config}\" with a correct value for ${path} variable") - ENDIF(EXISTS ${${path}}) - - IF(NOT ${${path}} MATCHES "${ABSOLUTE_PATH_REGEX}") - MESSAGE (FATAL_ERROR "${${path}} MUST BE an absolute path") - ENDIF(NOT ${${path}} MATCHES "${ABSOLUTE_PATH_REGEX}") -ENDFOREACH (path ${REQUIRED_PATHS}) +# check libxml2 +FIND_PROGRAM(XML2_CONFIG_PROGRAM NAMES xml2-config PATHS /usr/local/bin /usr/bin DOC "The libxml2 (www.xmlsoft.org) configuration tool") + +IF(NOT XML2_CONFIG_PROGRAM) + #MESSAGE(FATAL_ERROR "Libxml2 cannot be found on your system. Libxml2 is required for ParadisEO-PEO install") +ENDIF(NOT XML2_CONFIG_PROGRAM) + +# set libxml2 cflags in XML2_CFLAGS +EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --cflags OUTPUT_VARIABLE XML2_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) + +# set libxml2 libs in XML2_LIBS +EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --libs OUTPUT_VARIABLE XML2_LIBS) ###################################################################################### -##################################################################################### -### 5) Manage the build type -##################################################################################### - -# the user should choose the build type on windows environments,excepted under cygwin (default=none) -SET(CMAKE_DEFAULT_BUILD_TYPE "Release" CACHE STRING "Variable that stores the default CMake build type" FORCE) - -IF(WIN32 AND NOT CYGWIN) - IF(NOT CMAKE_BUILD_TYPE) - SET( CMAKE_BUILD_TYPE - ${CMAKE_DEFAULT_BUILD_TYPE} CACHE STRING - "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." - FORCE) - ENDIF(NOT CMAKE_BUILD_TYPE) -ELSE(WIN32 AND NOT CYGWIN) - IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -Wno-import -Winit-self -Wmissing-include-dirs -Wunused-parameter -Wundef -Wshadow -Wunsafe-loop-optimizations -Wcast-align -Wconversion -Wsign-compare -Winline -Wdisabled-optimization") - ENDIF(CMAKE_COMPILER_IS_GNUCXX) -ENDIF(WIN32 AND NOT CYGWIN) - -IF(CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS(-DCMAKE_VERBOSE_MAKEFILE=ON) -ENDIF(CMAKE_BUILD_TYPE MATCHES Debug) - -##################################################################################### - - -###################################################################################### -### 6) Where must cmake go now ? -###################################################################################### - -SUBDIRS(doc src test tutorial) - -###################################################################################### - - -###################################################################################### -### 7) Test config -###################################################################################### - -SET(ENABLE_CMAKE_TESTING TRUE CACHE BOOL "Should we test using Dart") - -IF (ENABLE_CMAKE_TESTING) - ENABLE_TESTING() -ENDIF (ENABLE_CMAKE_TESTING) - -###################################################################################### diff --git a/trunk/paradiseo-peo/DartConfig.cmake b/trunk/paradiseo-peo/DartConfig.cmake new file mode 100644 index 000000000..35c7dae83 --- /dev/null +++ b/trunk/paradiseo-peo/DartConfig.cmake @@ -0,0 +1,9 @@ + +############################################################################# +# Dart config for report submission +############################################################################# + +SET (DROP_METHOD "xmlrpc") +SET (DROP_SITE "http://dart.irisa.fr") +SET (DROP_LOCATION "ParadisEO") +############################################################################# \ No newline at end of file diff --git a/trunk/paradiseo-peo/doc/peo.doxyfile.cmake b/trunk/paradiseo-peo/doc/peo.doxyfile.cmake index 70be700cf..3ce2bd9c0 100644 --- a/trunk/paradiseo-peo/doc/peo.doxyfile.cmake +++ b/trunk/paradiseo-peo/doc/peo.doxyfile.cmake @@ -75,7 +75,7 @@ FILE_VERSION_FILTER = QUIET = YES WARNINGS = NO WARN_IF_UNDOCUMENTED = NO -WARN_IF_DOC_ERROR = NO +WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = diff --git a/trunk/paradiseo-peo/src/core/CMakeLists.txt b/trunk/paradiseo-peo/src/core/CMakeLists.txt index 0bc45159e..b1bb92c83 100644 --- a/trunk/paradiseo-peo/src/core/CMakeLists.txt +++ b/trunk/paradiseo-peo/src/core/CMakeLists.txt @@ -43,35 +43,3 @@ SET(CORE_VERSION ${GLOBAL_VERSION}) SET_TARGET_PROPERTIES(peo PROPERTIES VERSION "${CORE_VERSION}") ###################################################################################### - -###################################################################################### -### 4) Windows advanced config - especially for Microsoft Visual Studio 8 -###################################################################################### - - IF(CMAKE_CXX_COMPILER MATCHES cl) - IF(NOT WITH_SHARED_LIBS) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") - SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") - SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") - - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - ENDIF(NOT WITH_SHARED_LIBS) - ENDIF(CMAKE_CXX_COMPILER MATCHES cl) -###################################################################################### - - -###################################################################################### -### 5) Where must cmake go now ? -###################################################################################### - -# nothing to be compiled in the subdirs - -###################################################################################### - - - - diff --git a/trunk/paradiseo-peo/src/rmc/mpi/CMakeLists.txt b/trunk/paradiseo-peo/src/rmc/mpi/CMakeLists.txt index 5ab0ccd94..0a84e6777 100644 --- a/trunk/paradiseo-peo/src/rmc/mpi/CMakeLists.txt +++ b/trunk/paradiseo-peo/src/rmc/mpi/CMakeLists.txt @@ -5,6 +5,7 @@ SET(CMAKE_CXX_FLAGS_RELEASE "-O0 -g") SET(CMAKE_CXX_FLAGS_MINSIZEREL "-O0 -g") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 -g") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XML2_CFLAGS}") ###################################################################################### ### 0) Set the compiler ###################################################################################### @@ -19,7 +20,7 @@ SET (CMAKE_CXX_COMPILER mpicxx) ###################################################################################### INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src) -INCLUDE_DIRECTORIES(${XML2_CFLAGS_WITH_WHITESPACE}) +#INCLUDE_DIRECTORIES(${XML2_CFLAGS_WITH_WHITESPACE}) ###################################################################################### @@ -71,32 +72,3 @@ SET_TARGET_PROPERTIES(rmc_mpi PROPERTIES VERSION "${RMC_MPI_VERSION}") ###################################################################################### - -###################################################################################### -### 5) Windows advanced config - especially for Microsoft Visual Studio 8 -###################################################################################### - - IF(CMAKE_CXX_COMPILER MATCHES cl) - IF(NOT WITH_SHARED_LIBS) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") - SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") - SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") - - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - ENDIF(NOT WITH_SHARED_LIBS) - ENDIF(CMAKE_CXX_COMPILER MATCHES cl) -###################################################################################### - - -###################################################################################### -### 6) Where must cmake go now ? -###################################################################################### - -# nothing to be compiled in the subdirs - -###################################################################################### - diff --git a/trunk/paradiseo-peo/tutorial/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/CMakeLists.txt index d81c4d52d..8faaf0d9b 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 Lesson6 Lesson7 Lesson8) +SUBDIRS(examples Lesson1 Lesson2 Lesson3 Lesson4 Lesson5) ###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson1/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson1/CMakeLists.txt index 9827cfc22..8471c7464 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson1/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson1/CMakeLists.txt @@ -78,26 +78,3 @@ TARGET_LINK_LIBRARIES(pso ${XML2_LIBS} peo rmc_mpi eo eoutils) TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils) ###################################################################################### - - -###################################################################################### -### 6) Windows advanced config - especially for Microsoft Visual Studio 8 -###################################################################################### - - IF(CMAKE_CXX_COMPILER MATCHES cl) - IF(NOT WITH_SHARED_LIBS) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") - SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") - SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") - - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - ENDIF(NOT WITH_SHARED_LIBS) - ENDIF(CMAKE_CXX_COMPILER MATCHES cl) -###################################################################################### - - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson2/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson2/CMakeLists.txt index b5bd31249..9056238f7 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson2/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson2/CMakeLists.txt @@ -74,26 +74,3 @@ SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${LESSON2_VERSION}") TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils) ###################################################################################### - - -###################################################################################### -### 6) Windows advanced config - especially for Microsoft Visual Studio 8 -###################################################################################### - - IF(CMAKE_CXX_COMPILER MATCHES cl) - IF(NOT WITH_SHARED_LIBS) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") - SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") - SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") - - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - ENDIF(NOT WITH_SHARED_LIBS) - ENDIF(CMAKE_CXX_COMPILER MATCHES cl) -###################################################################################### - - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson3/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson3/CMakeLists.txt index a1f006c06..576600262 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson3/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson3/CMakeLists.txt @@ -79,25 +79,3 @@ TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils) ###################################################################################### - -###################################################################################### -### 6) Windows advanced config - especially for Microsoft Visual Studio 8 -###################################################################################### - - IF(CMAKE_CXX_COMPILER MATCHES cl) - IF(NOT WITH_SHARED_LIBS) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") - SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") - SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") - - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - ENDIF(NOT WITH_SHARED_LIBS) - ENDIF(CMAKE_CXX_COMPILER MATCHES cl) -###################################################################################### - - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson4/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson4/CMakeLists.txt index ebcbb9b29..6b16a0a72 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson4/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson4/CMakeLists.txt @@ -81,26 +81,3 @@ TARGET_LINK_LIBRARIES(lsea ${XML2_LIBS} tsp peo rmc_mpi eo eoutils) TARGET_LINK_LIBRARIES(eals ${XML2_LIBS} tsp peo rmc_mpi eo eoutils) ###################################################################################### - - -###################################################################################### -### 6) Windows advanced config - especially for Microsoft Visual Studio 8 -###################################################################################### - - IF(CMAKE_CXX_COMPILER MATCHES cl) - IF(NOT WITH_SHARED_LIBS) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") - SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") - SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") - - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - ENDIF(NOT WITH_SHARED_LIBS) - ENDIF(CMAKE_CXX_COMPILER MATCHES cl) -###################################################################################### - - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson5/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson5/CMakeLists.txt index b89275562..84d924dcb 100644 --- a/trunk/paradiseo-peo/tutorial/Lesson5/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/Lesson5/CMakeLists.txt @@ -79,24 +79,3 @@ SET_TARGET_PROPERTIES(pso PROPERTIES VERSION "${WALKTHROUGH_VERSION}") TARGET_LINK_LIBRARIES(pso ${XML2_LIBS} peo rmc_mpi eo eoutils) ###################################################################################### - - -###################################################################################### -### 6) Windows advanced config - especially for Microsoft Visual Studio 8 -###################################################################################### - - IF(CMAKE_CXX_COMPILER MATCHES cl) - IF(NOT WITH_SHARED_LIBS) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") - SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") - SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") - - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - ENDIF(NOT WITH_SHARED_LIBS) - ENDIF(CMAKE_CXX_COMPILER MATCHES cl) -###################################################################################### - diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson6/CMakeLists.txt deleted file mode 100644 index 43a86ba78..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/CMakeLists.txt +++ /dev/null @@ -1,82 +0,0 @@ - -###################################################################################### -### 0) Set the compiler and define targets to easily run the lessons -###################################################################################### - -SET (CMAKE_CXX_COMPILER mpicxx) -SET(MAKE_SRC_DIR "${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/make" CACHE PATH "Make source directory" FORCE) - -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/FlowShopEA.param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/schema.xml) - -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/FlowShopEA.param - ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6) -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/param - ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6) -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/schema.xml - ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6) - -###################################################################################### - - -###################################################################################### -### 1) Include the sources -###################################################################################### - -INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src ${MOEO_SRC_DIR}/src ${FLOWSHOP_SRC_DIR} ${MO_SRC_DIR}/src ${ParadisEO-PEO_SOURCE_DIR}/src ${TSP_SRC_DIR} ${MAKE_SRC_DIR}) - -###################################################################################### - - -###################################################################################### -### 2) Specify where CMake can find the libraries (mandatory: before 3) ) -###################################################################################### - -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${MOEO_BIN_DIR}/lib ${FLOWSHOP_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib ${TSP_BINARY_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) - - - -###################################################################################### - - -###################################################################################### -### 3) Define your target(s): just an executable here -###################################################################################### - -ADD_EXECUTABLE(example main.cpp) -ADD_DEPENDENCIES(example flowshop moeo peo rmc_mpi) - - -###################################################################################### - - -###################################################################################### -### 4) Optionnal: define your target(s)'s version: no effect for windows -###################################################################################### - - -###################################################################################### - -###################################################################################### -### 5) Link the librairies -###################################################################################### - -TARGET_LINK_LIBRARIES(example ${XML2_LIBS} flowshop moeo peo rmc_mpi eo eoutils) - -###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/FlowShopEA.param b/trunk/paradiseo-peo/tutorial/Lesson6/FlowShopEA.param deleted file mode 100644 index ac4abc1a8..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/FlowShopEA.param +++ /dev/null @@ -1,49 +0,0 @@ -###### General ###### ---help=0 # -h : Prints this message ---stopOnUnknownParam=1 # Stop if unkown param entered -# --seed=1183379758 # -S : Random number seed - -###### Evolution Engine ###### ---popSize=20 # -P : Population Size ---updateArch=1 # Update the archive at each gen. ---fitness=FastNonDominatedSorting # -F : Fitness assignment scheme: Dummy, FastNonDominatedSorting or IndicatorBased ---indicator=Epsilon # -i : Binary indicator for IndicatorBased: Epsilon, Hypervolume ---rho=1.1 # -r : reference point for the hypervolume indicator ---kappa=0.05 # -k : Scaling factor kappa for IndicatorBased ---diversity=Crowding # -D : Diversity assignment scheme: Dummy, Sharing(nicheSize) or Crowding ---comparator=FitnessThenDiversity # -C : Comparator scheme: FitnessThenDiversity, DiversityThenFitness or Aggregative ---selection=DetTour(2) # -S : Selection scheme: DetTour(T), StochTour(t) or Random ---replacement=Elitist # -R : Replacement scheme: Elitist, Environmental or Generational ---nbOffspring=100% # -O : Number of offspring (percentage or absolute) - -###### Output ###### -#--resDir=Res # Directory to store DISK outputs ---eraseDir=1 # erase files in dirName if any ---printPop=0 # Print sorted pop. every gen. ---storeArch=0 # Store the archive's objective vectors at each gen. ---contribution=0 # Store the contribution of the archive at each gen. ---entropy=0 # Store the entropy of the archive at each gen. - -###### Persistence ###### ---Load= # -L : A save file to restart from ---recomputeFitness=0 # -r : Recompute the fitness after re-loading the pop.? ---saveFrequency=0 # Save every F generation (0 = only final state, absent = never) ---saveTimeInterval=0 # Save every T seconds (0 or absent = never) ---status=./FlowShopEA.status # Status file - -###### Representation ###### ---BenchmarkFile=../../../../paradiseo-moeo/tutorial/examples/flowshop/benchs/020_10_01.txt # -B : Benchmark file name REQUIRED - -###### Stopping criterion ###### ---maxGen=100 # -G : Maximum number of generations (0 = none) ---maxEval=0 # -E : Maximum number of evaluations (0 = none) ---maxTime=0 # -T : Maximum running time in seconds (0 = none) -#--CtrlC=1 # -C : Terminate current generation upon Ctrl C (only available on Unix platforms) - -###### Variation Operators ###### ---crossRate=1 # Relative rate for the only crossover ---shiftMutRate=0.5 # Relative rate for shift mutation ---exchangeMutRate=0.5 # Relative rate for exchange mutation ---pCross=0.25 # -c : Probability of Crossover ---pMut=0.35 # -m : Probability of Mutation - diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/main.cpp b/trunk/paradiseo-peo/tutorial/Lesson6/main.cpp deleted file mode 100644 index 82f4c73fb..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/main.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, INRIA, 2007 -* -* Alexandru-Adrian Tantar, 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 -#include -#include -#include - - - -int main(int argc, char* argv[]) -{ - - peo :: init( argc,argv ); - eoParser parser(argc, argv); - eoState state; - peoMoeoPopEval& eval = do_make_para_eval(parser, state); - eoInit& init = do_make_genotype(parser, state); - eoGenOp& op = do_make_op(parser, state); - eoPop& pop = do_make_pop(parser, state, init); - moeoArchive arch; - eoContinue& term = do_make_continue_moeo(parser, state, eval); - eoCheckPoint& checkpoint = do_make_checkpoint_moeo(parser, state, eval, term, pop, arch); - eoAlgo& algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch); - peoWrapper parallelMOEO( algo, pop); - eval.setOwner(parallelMOEO); - peo :: run(); - peo :: finalize(); - if (getNodeRank()==1) - { - pop.sort(); - std::cout << "Final population :\n" << pop << std::endl; - } -} diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_checkpoint_moeo.h b/trunk/paradiseo-peo/tutorial/Lesson6/make/make_checkpoint_moeo.h deleted file mode 100644 index f2e8ffa37..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_checkpoint_moeo.h +++ /dev/null @@ -1,201 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -* -*/ -//----------------------------------------------------------------------------- - -#ifndef MAKE_CHECKPOINT_MOEO_H_ -#define MAKE_CHECKPOINT_MOEO_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -bool testDirRes(std::string _dirName, bool _erase); - -/** - * This functions allows to build an eoCheckPoint for multi-objective optimization from the parser (partly taken from make_checkpoint_pareto.h) - * @param _parser the parser - * @param _state to store allocated objects - * @param _eval the funtions evaluator - * @param _continue the stopping crietria - * @param _pop the population - * @param _archive the archive of non-dominated solutions - */ -template < class MOEOT > -eoCheckPoint < MOEOT > & do_make_checkpoint_moeo (eoParser & _parser, eoState & _state, eoPopEvalFunc < MOEOT > & _eval, eoContinue < MOEOT > & _continue, eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _archive) -{ - eoCheckPoint < MOEOT > & checkpoint = _state.storeFunctor(new eoCheckPoint < MOEOT > (_continue)); - /* the objective vector type */ - typedef typename MOEOT::ObjectiveVector ObjectiveVector; - - /////////////////// - // Counters - ////////////////// - // is nb Eval to be used as counter? - //bool useEval = _parser.getORcreateParam(true, "useEval", "Use nb of eval. as counter (vs nb of gen.)", '\0', "Output").value(); - // Create anyway a generation-counter parameter - eoValueParam *generationCounter = new eoValueParam(0, "Gen."); - // Create an incrementor (sub-class of eoUpdater). - eoIncrementor & increment = _state.storeFunctor( new eoIncrementor(generationCounter->value()) ); - // Add it to the checkpoint - checkpoint.add(increment); - // dir for DISK output - std::string & dirName = _parser.getORcreateParam(std::string("Res"), "resDir", "Directory to store DISK outputs", '\0', "Output").value(); - // shoudl we empty it if exists - eoValueParam& eraseParam = _parser.getORcreateParam(true, "eraseDir", "erase files in dirName if any", '\0', "Output"); - bool dirOK = false; // not tested yet - - // Dump of the whole population - //----------------------------- - bool printPop = _parser.getORcreateParam(false, "printPop", "Print sorted pop. every gen.", '\0', "Output").value(); - eoSortedPopStat * popStat; - if ( printPop ) // we do want pop dump - { - popStat = & _state.storeFunctor(new eoSortedPopStat); - checkpoint.add(*popStat); - } - - ////////////////////////////////// - // State savers - ////////////////////////////// - // feed the state to state savers - // save state every N generation - eoValueParam& saveFrequencyParam = _parser.createParam((unsigned int)(0), "saveFrequency", "Save every F generation (0 = only final state, absent = never)", '\0', "Persistence" ); - if (_parser.isItThere(saveFrequencyParam)) - { - // first make sure dirName is OK - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE - unsigned int freq = (saveFrequencyParam.value()>0 ? saveFrequencyParam.value() : UINT_MAX ); -#ifdef _MSVC - std::string stmp = dirName + "\generations"; -#else - std::string stmp = dirName + "/generations"; -#endif - eoCountedStateSaver *stateSaver1 = new eoCountedStateSaver(freq, _state, stmp); - _state.storeFunctor(stateSaver1); - checkpoint.add(*stateSaver1); - } - // save state every T seconds - eoValueParam& saveTimeIntervalParam = _parser.getORcreateParam((unsigned int)(0), "saveTimeInterval", "Save every T seconds (0 or absent = never)", '\0',"Persistence" ); - if (_parser.isItThere(saveTimeIntervalParam) && saveTimeIntervalParam.value()>0) - { - // first make sure dirName is OK - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE -#ifdef _MSVC - std::string stmp = dirName + "\time"; -#else - std::string stmp = dirName + "/time"; -#endif - eoTimedStateSaver *stateSaver2 = new eoTimedStateSaver(saveTimeIntervalParam.value(), _state, stmp); - _state.storeFunctor(stateSaver2); - checkpoint.add(*stateSaver2); - } - - /////////////////// - // Archive - ////////////////// - // update the archive every generation - bool updateArch = _parser.getORcreateParam(true, "updateArch", "Update the archive at each gen.", '\0', "Evolution Engine").value(); - if (updateArch) - { - moeoArchiveUpdater < MOEOT > * updater = new moeoArchiveUpdater < MOEOT > (_archive, _pop); - _state.storeFunctor(updater); - checkpoint.add(*updater); - } - // store the objective vectors contained in the archive every generation - bool storeArch = _parser.getORcreateParam(false, "storeArch", "Store the archive's objective vectors at each gen.", '\0', "Output").value(); - if (storeArch) - { - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE -#ifdef _MSVC - std::string stmp = dirName + "\arch"; -#else - std::string stmp = dirName + "/arch"; -#endif - moeoArchiveObjectiveVectorSavingUpdater < MOEOT > * save_updater = new moeoArchiveObjectiveVectorSavingUpdater < MOEOT > (_archive, stmp); - _state.storeFunctor(save_updater); - checkpoint.add(*save_updater); - } - // store the contribution of the non-dominated solutions - bool cont = _parser.getORcreateParam(false, "contribution", "Store the contribution of the archive at each gen.", '\0', "Output").value(); - if (cont) - { - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE -#ifdef _MSVC - std::string stmp = dirName + "\contribution"; -#else - std::string stmp = dirName + "/contribution"; -#endif - moeoContributionMetric < ObjectiveVector > * contribution = new moeoContributionMetric < ObjectiveVector >; - moeoBinaryMetricSavingUpdater < MOEOT > * contribution_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*contribution, _archive, stmp); - _state.storeFunctor(contribution_updater); - checkpoint.add(*contribution_updater); - } - // store the entropy of the non-dominated solutions - bool ent = _parser.getORcreateParam(false, "entropy", "Store the entropy of the archive at each gen.", '\0', "Output").value(); - if (ent) - { - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE -#ifdef _MSVC - std::string stmp = dirName + "\entropy"; -#else - std::string stmp = dirName + "/entropy"; -#endif - moeoEntropyMetric < ObjectiveVector > * entropy = new moeoEntropyMetric < ObjectiveVector >; - moeoBinaryMetricSavingUpdater < MOEOT > * entropy_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*entropy, _archive, stmp); - _state.storeFunctor(entropy_updater); - checkpoint.add(*entropy_updater); - } - - // and that's it for the (control and) output - return checkpoint; -} - -#endif /*MAKE_CHECKPOINT_MOEO_H_*/ diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_continue_moeo.h b/trunk/paradiseo-peo/tutorial/Lesson6/make/make_continue_moeo.h deleted file mode 100644 index 954ebb4ac..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_continue_moeo.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -* -*/ -//----------------------------------------------------------------------------- - -#ifndef MAKE_CONTINUE_MOEO_H_ -#define MAKE_CONTINUE_MOEO_H_ -#include -#include -#include -#include -#include -#ifndef _MSC_VER -#include -#endif -#include -#include - - -/** - * Helper function - * @param _combined the eoCombinedContinue object - * @param _cont the eoContinue to add - */ -template -eoCombinedContinue * make_combinedContinue(eoCombinedContinue *_combined, eoContinue *_cont) -{ - if (_combined) // already exists - _combined->add(*_cont); - else - _combined = new eoCombinedContinue(*_cont); - return _combined; -} - - -/** - * This functions allows to build a eoContinue for multi-objective optimization from the parser (partly taken from make_continue_pareto.h) - * @param _parser the parser - * @param _state to store allocated objects - * @param _eval the funtions evaluator - */ -template -eoContinue & do_make_continue_moeo(eoParser& _parser, eoState& _state, eoPopEvalFunc & _eval) -{ - // the combined continue - to be filled - eoCombinedContinue *continuator = NULL; - // First the eoGenContinue - need a default value so you can run blind - // but we also need to be able to avoid it <--> 0 - eoValueParam& maxGenParam = _parser.createParam((unsigned int)(100), "maxGen", "Maximum number of generations (0 = none)",'G',"Stopping criterion"); - if (maxGenParam.value()) // positive: -> define and store - { - eoGenContinue *genCont = new eoGenContinue(maxGenParam.value()); - _state.storeFunctor(genCont); - // and "add" to combined - continuator = make_combinedContinue(continuator, genCont); - } - // maxEval - eoValueParam& maxEvalParam = _parser.getORcreateParam((unsigned long)(0), "maxEval", "Maximum number of evaluations (0 = none)", 'E', "Stopping criterion"); - /* if (maxEvalParam.value()) - { - eoEvalContinue *evalCont = new eoEvalContinue(_eval, maxEvalParam.value()); - _state.storeFunctor(evalCont); - // and "add" to combined - continuator = make_combinedContinue(continuator, evalCont); - }*/ - // maxTime - eoValueParam& maxTimeParam = _parser.getORcreateParam((unsigned long)(0), "maxTime", "Maximum running time in seconds (0 = none)", 'T', "Stopping criterion"); - if (maxTimeParam.value()) // positive: -> define and store - { - eoTimeContinue *timeCont = new eoTimeContinue(maxTimeParam.value()); - _state.storeFunctor(timeCont); - // and "add" to combined - continuator = make_combinedContinue(continuator, timeCont); - } - // CtrlC -#ifndef _MSC_VER - // the CtrlC interception (Linux only I'm afraid) - eoCtrlCContinue *ctrlCCont; - eoValueParam& ctrlCParam = _parser.createParam(true, "CtrlC", "Terminate current generation upon Ctrl C",'C', "Stopping criterion"); - if (_parser.isItThere(ctrlCParam)) - { - ctrlCCont = new eoCtrlCContinue; - // store - _state.storeFunctor(ctrlCCont); - // add to combinedContinue - continuator = make_combinedContinue(continuator, ctrlCCont); - } -#endif - // now check that there is at least one! - if (!continuator) - throw std::runtime_error("You MUST provide a stopping criterion"); - // OK, it's there: store in the eoState - _state.storeFunctor(continuator); - // and return - return *continuator; -} - -#endif /*MAKE_CONTINUE_MOEO_H_*/ diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_ea_moeo.h b/trunk/paradiseo-peo/tutorial/Lesson6/make/make_ea_moeo.h deleted file mode 100644 index 49bd3b968..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_ea_moeo.h +++ /dev/null @@ -1,297 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -* -*/ -//----------------------------------------------------------------------------- - -#ifndef MAKE_EA_MOEO_H_ -#define MAKE_EA_MOEO_H_ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/** - * This functions allows to build a moeoEA from the parser - * @param _parser the parser - * @param _state to store allocated objects - * @param _eval the funtions evaluator - * @param _continue the stopping crietria - * @param _op the variation operators - * @param _archive the archive of non-dominated solutions - */ -template < class MOEOT > -moeoEA < MOEOT > & do_make_ea_moeo(eoParser & _parser, eoState & _state, eoPopEvalFunc < MOEOT > & _eval, eoContinue < MOEOT > & _continue, eoGenOp < MOEOT > & _op, moeoArchive < MOEOT > & _archive) -{ - - /* the objective vector type */ - typedef typename MOEOT::ObjectiveVector ObjectiveVector; - - - /* the fitness assignment strategy */ - std::string & fitnessParam = _parser.createParam(std::string("FastNonDominatedSorting"), "fitness", - "Fitness assignment scheme: Dummy, FastNonDominatedSorting or IndicatorBased", 'F', - "Evolution Engine").value(); - std::string & indicatorParam = _parser.createParam(std::string("Epsilon"), "indicator", - "Binary indicator for IndicatorBased: Epsilon, Hypervolume", 'i', - "Evolution Engine").value(); - double rho = _parser.createParam(1.1, "rho", "reference point for the hypervolume indicator", 'r', - "Evolution Engine").value(); - double kappa = _parser.createParam(0.05, "kappa", "Scaling factor kappa for IndicatorBased", 'k', - "Evolution Engine").value(); - moeoFitnessAssignment < MOEOT > * fitnessAssignment; - if (fitnessParam == std::string("Dummy")) - { - fitnessAssignment = new moeoDummyFitnessAssignment < MOEOT> (); - } - else if (fitnessParam == std::string("FastNonDominatedSorting")) - { - fitnessAssignment = new moeoFastNonDominatedSortingFitnessAssignment < MOEOT> (); - } - else if (fitnessParam == std::string("IndicatorBased")) - { - // metric - moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > *metric; - if (indicatorParam == std::string("Epsilon")) - { - metric = new moeoAdditiveEpsilonBinaryMetric < ObjectiveVector >; - } - else if (indicatorParam == std::string("Hypervolume")) - { - metric = new moeoHypervolumeBinaryMetric < ObjectiveVector > (rho); - } - else - { - std::string stmp = std::string("Invalid binary quality indicator: ") + indicatorParam; - throw std::runtime_error(stmp.c_str()); - } - fitnessAssignment = new moeoExpBinaryIndicatorBasedFitnessAssignment < MOEOT > (*metric, kappa); - } - else - { - std::string stmp = std::string("Invalid fitness assignment strategy: ") + fitnessParam; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(fitnessAssignment); - - - /* the diversity assignment strategy */ - eoValueParam & diversityParam = _parser.createParam(eoParamParamType("Dummy"), "diversity", - "Diversity assignment scheme: Dummy, Sharing(nicheSize) or Crowding", 'D', "Evolution Engine"); - eoParamParamType & diversityParamValue = diversityParam.value(); - moeoDiversityAssignment < MOEOT > * diversityAssignment; - if (diversityParamValue.first == std::string("Dummy")) - { - diversityAssignment = new moeoDummyDiversityAssignment < MOEOT> (); - } - else if (diversityParamValue.first == std::string("Sharing")) - { - double nicheSize; - if (!diversityParamValue.second.size()) // no parameter added - { - std::cerr << "WARNING, no niche size given for Sharing, using 0.5" << std::endl; - nicheSize = 0.5; - diversityParamValue.second.push_back(std::string("0.5")); - } - else - { - nicheSize = atoi(diversityParamValue.second[0].c_str()); - } - diversityAssignment = new moeoFrontByFrontSharingDiversityAssignment < MOEOT> (nicheSize); - } - else if (diversityParamValue.first == std::string("Crowding")) - { - diversityAssignment = new moeoFrontByFrontCrowdingDiversityAssignment < MOEOT> (); - } - else - { - std::string stmp = std::string("Invalid diversity assignment strategy: ") + diversityParamValue.first; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(diversityAssignment); - - - /* the comparator strategy */ - std::string & comparatorParam = _parser.createParam(std::string("FitnessThenDiversity"), "comparator", - "Comparator scheme: FitnessThenDiversity, DiversityThenFitness or Aggregative", 'C', "Evolution Engine").value(); - moeoComparator < MOEOT > * comparator; - if (comparatorParam == std::string("FitnessThenDiversity")) - { - comparator = new moeoFitnessThenDiversityComparator < MOEOT> (); - } - else if (comparatorParam == std::string("DiversityThenFitness")) - { - comparator = new moeoDiversityThenFitnessComparator < MOEOT> (); - } - else if (comparatorParam == std::string("Aggregative")) - { - comparator = new moeoAggregativeComparator < MOEOT> (); - } - else - { - std::string stmp = std::string("Invalid comparator strategy: ") + comparatorParam; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(comparator); - - - /* the selection strategy */ - eoValueParam < eoParamParamType > & selectionParam = _parser.createParam(eoParamParamType("DetTour(2)"), "selection", - "Selection scheme: DetTour(T), StochTour(t) or Random", 'S', "Evolution Engine"); - eoParamParamType & ppSelect = selectionParam.value(); - moeoSelectOne < MOEOT > * select; - if (ppSelect.first == std::string("DetTour")) - { - unsigned int tSize; - if (!ppSelect.second.size()) // no parameter added - { - std::cerr << "WARNING, no parameter passed to DetTour, using 2" << std::endl; - tSize = 2; - // put back 2 in parameter for consistency (and status file) - ppSelect.second.push_back(std::string("2")); - } - else // parameter passed by user as DetTour(T) - { - tSize = atoi(ppSelect.second[0].c_str()); - } - select = new moeoDetTournamentSelect < MOEOT > (*comparator, tSize); - } - else if (ppSelect.first == std::string("StochTour")) - { - double tRate; - if (!ppSelect.second.size()) // no parameter added - { - std::cerr << "WARNING, no parameter passed to StochTour, using 1" << std::endl; - tRate = 1; - // put back 1 in parameter for consistency (and status file) - ppSelect.second.push_back(std::string("1")); - } - else // parameter passed by user as StochTour(T) - { - tRate = atof(ppSelect.second[0].c_str()); - } - select = new moeoStochTournamentSelect < MOEOT > (*comparator, tRate); - } - /* - else if (ppSelect.first == string("Roulette")) - { - // TO DO ! - // ... - } - */ - else if (ppSelect.first == std::string("Random")) - { - select = new moeoRandomSelect (); - } - else - { - std::string stmp = std::string("Invalid selection strategy: ") + ppSelect.first; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(select); - - - /* the replacement strategy */ - std::string & replacementParam = _parser.createParam(std::string("Elitist"), "replacement", - "Replacement scheme: Elitist, Environmental or Generational", 'R', "Evolution Engine").value(); - moeoReplacement < MOEOT > * replace; - if (replacementParam == std::string("Elitist")) - { - replace = new moeoElitistReplacement < MOEOT> (*fitnessAssignment, *diversityAssignment, *comparator); - } - else if (replacementParam == std::string("Environmental")) - { - replace = new moeoEnvironmentalReplacement < MOEOT> (*fitnessAssignment, *diversityAssignment, *comparator); - } - else if (replacementParam == std::string("Generational")) - { - replace = new moeoGenerationalReplacement < MOEOT> (); - } - else - { - std::string stmp = std::string("Invalid replacement strategy: ") + replacementParam; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(replace); - - - /* the number of offspring */ - eoValueParam < eoHowMany > & offspringRateParam = _parser.createParam(eoHowMany(1.0), "nbOffspring", - "Number of offspring (percentage or absolute)", 'O', "Evolution Engine"); - - - // the general breeder - eoGeneralBreeder < MOEOT > * breed = new eoGeneralBreeder < MOEOT > (*select, _op, offspringRateParam.value()); - _state.storeFunctor(breed); - // the eoEasyEA - moeoEA < MOEOT > * algo = new moeoEasyEA < MOEOT > (_continue, _eval, *breed, *replace, *fitnessAssignment, *diversityAssignment); - _state.storeFunctor(algo); - return *algo; - -} - -#endif /*MAKE_EA_MOEO_H_*/ diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_library.h b/trunk/paradiseo-peo/tutorial/Lesson6/make/make_library.h deleted file mode 100644 index cd0554da0..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_library.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -#include -#include -#include -#include -#include -#include -#include diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_para_eval.h b/trunk/paradiseo-peo/tutorial/Lesson6/make/make_para_eval.h deleted file mode 100644 index a9b6db3cc..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/make/make_para_eval.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -#include -#include - -peoMoeoPopEval & do_make_para_eval(eoParser& _parser, eoState& _state) -{ - std::string benchmarkFileName = _parser.getORcreateParam(std::string(), "BenchmarkFile", "Benchmark file name (benchmarks are available at www.lifl.fr/~liefooga/benchmarks)", 'B',"Representation", true).value(); - if (benchmarkFileName == "") - { - std::string stmp = "*** Missing name of the benchmark file\n"; - stmp += " Type '-B=the_benchmark_file_name' or '--BenchmarkFile=the_benchmark_file_name'\n"; - stmp += " Benchmarks files are available at www.lifl.fr/~liefooga/benchmarks"; - throw std::runtime_error(stmp.c_str()); - } - FlowShopBenchmarkParser fParser(benchmarkFileName); - unsigned int M = fParser.getM(); - unsigned int N = fParser.getN(); - std::vector< std::vector > p = fParser.getP(); - std::vector d = fParser.getD(); - - FlowShopEval* plainEval = new FlowShopEval(M, N, p, d); - peoMoeoPopEval* eval = new peoMoeoPopEval (* plainEval); - _state.storeFunctor(eval); - return *eval; -} diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/paradiseo-peo-lsn.doxyfile b/trunk/paradiseo-peo/tutorial/Lesson6/paradiseo-peo-lsn.doxyfile deleted file mode 100644 index c3dd5bbe6..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/paradiseo-peo-lsn.doxyfile +++ /dev/null @@ -1,242 +0,0 @@ -# Doxyfile 1.4.7 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "ParadisEO-PEO Lesson6" -PROJECT_NUMBER = 0.1 -OUTPUT_DIRECTORY = ../../../doc/html/lesson6 -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = YES -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = YES -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = NO -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = YES -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = . -FILE_PATTERNS = *.cpp \ - *.h \ - NEWS \ - README -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = ../../docs/images -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = YES -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 3 -IGNORE_PREFIX = peo -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = YES -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = YES -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = ../../../paradiseo-mo/docs/eo.doxytag=../../../../../paradiseo-mo/docs/html \ - ../../../paradiseo-mo/docs/mo.doxytag=../../../../../paradiseo-mo/docs/html \ - ../../docs/paradiseo-peo.doxytag=../../ \ - ../shared/paradiseo-peo-lsn-shared.doxytag=../../lsnshared/html -GENERATE_TAGFILE = ../../docs/paradiseo-peo-lsn.doxytag -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = YES - diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/param b/trunk/paradiseo-peo/tutorial/Lesson6/param deleted file mode 100644 index eb843c65f..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/param +++ /dev/null @@ -1,12 +0,0 @@ -## miscallenous parameters - ---debug=false - -## deployment schema - ---schema=schema.xml - -## parameters - ---inst=../examples/tsp/benchs/eil101.tsp - diff --git a/trunk/paradiseo-peo/tutorial/Lesson6/schema.xml b/trunk/paradiseo-peo/tutorial/Lesson6/schema.xml deleted file mode 100644 index 262e2a9d7..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson6/schema.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - 1 - - - - - - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson7/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson7/CMakeLists.txt deleted file mode 100644 index 0ca50b99d..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson7/CMakeLists.txt +++ /dev/null @@ -1,80 +0,0 @@ - -###################################################################################### -### 0) Set the compiler and define targets to easily run the lessons -###################################################################################### - -SET (CMAKE_CXX_COMPILER mpicxx) - -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson7/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson7/schema.xml) - -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson7/param - ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson7) -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson7/schema.xml - ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson7) - -###################################################################################### - - -###################################################################################### -### 1) Include the sources -###################################################################################### - -INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src ${MOEO_SRC_DIR}/src ${MO_SRC_DIR}/src ${ParadisEO-PEO_SOURCE_DIR}/src) - -###################################################################################### - - -###################################################################################### -### 2) Specify where CMake can find the libraries -###################################################################################### - -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) - -# especially for Visual Studio -IF(WIN32 AND NOT CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}\\lib\\${CMAKE_BUILD_TYPE} ${ParadisEO-PEO_BINARY_DIR}\\lib\\${CMAKE_BUILD_TYPE}) -ENDIF(WIN32 AND NOT CYGWIN) -###################################################################################### - - -###################################################################################### -### 3) Define your target(s): just an executable here -###################################################################################### - -ADD_EXECUTABLE(algo main.cpp) -ADD_DEPENDENCIES(algo peo rmc_mpi) -###################################################################################### - - -###################################################################################### -### 4) Optionnal: define properties -###################################################################################### - -SET(Lesson7_VERSION ${GLOBAL_VERSION}) -SET_TARGET_PROPERTIES(algo PROPERTIES VERSION "${Lesson7_VERSION}") -###################################################################################### - - -###################################################################################### -### 5) Link the librairies -###################################################################################### - -TARGET_LINK_LIBRARIES(algo ${XML2_LIBS} peo rmc_mpi eo eoutils) - -###################################################################################### - - - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson7/main.cpp b/trunk/paradiseo-peo/tutorial/Lesson7/main.cpp deleted file mode 100644 index d53c4a3a6..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson7/main.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include - -typedef eoReal Indi; - -double f (const Indi & _indi) -{ - double sum; - sum=_indi[1]-pow(_indi[0],2); - sum=100*pow(sum,2); - sum+=pow((1-_indi[0]),2); - return (-sum); -} - -// Communications between 2 EA and 1 archive - - -int main (int __argc, char *__argv[]) -{ - - peo :: init( __argc, __argv ); - const unsigned int VEC_SIZE = 2; - const unsigned int POP_SIZE = 20; - const unsigned int MAX_GEN = 100; - const double INIT_POSITION_MIN = -2.0; - const double INIT_POSITION_MAX = 2.0; - const float CROSS_RATE = 0.8; - const double EPSILON = 0.01; - const float MUT_RATE = 0.3; - const unsigned int MIG_FREQ = 2; - const unsigned int MIG_SIZE = 2; - rng.reseed (time(0)); - - -// Archive - - peoEvalFunc plainEval(f); - eoEvalFuncCounter < Indi > firstEval(plainEval); - eoPopLoopEval < Indi > evalArchive(firstEval); - eoUniformGenerator < double > uGenArchive (INIT_POSITION_MIN, INIT_POSITION_MAX); - eoInitFixedLength < Indi > randomArchive (VEC_SIZE, uGenArchive); - eoPop < Indi > empty_pop,archive; - archive.append(POP_SIZE, randomArchive); - evalArchive (empty_pop,archive); - archive.sort(); - if (getNodeRank()==1) - std::cout << "Archive before :\n" << archive << std::endl; - - - -// First algorithm - /*****************************************************************************************/ - - RingTopology topology; - - eoGenContinue < Indi > genContPara (MAX_GEN); - eoCombinedContinue continuatorPara (genContPara); - eoCheckPoint checkpoint(continuatorPara); - peoEvalFunc mainEval( f ); - peoPopEval eval(mainEval); - eoUniformGenerator < double >uGen (INIT_POSITION_MIN, INIT_POSITION_MAX); - eoInitFixedLength < Indi > random (VEC_SIZE, uGen); - eoBestSelect selectionStrategy; - eoSelectNumber select(selectionStrategy,POP_SIZE); - eoSegmentCrossover crossover; - eoUniformMutation mutation(EPSILON); - peoTransform transform(crossover,CROSS_RATE,mutation,MUT_RATE); - eoPop < Indi > pop; - pop.append (POP_SIZE, random); - eoPlusReplacement replace; - eoBestSelect mig_select_one; - eoSelector > mig_select (mig_select_one,MIG_SIZE,pop); - eoReplace > mig_replace (replace,pop); - eoPeriodicContinue< Indi > mig_cont( MIG_FREQ ); - eoContinuator cont(mig_cont, pop); - peoAsyncIslandMig< eoPop, eoPop > mig(cont,mig_select, mig_replace, topology); - checkpoint.add(mig); - - - eoRandomSelect mig_select_oneArchive; - eoSelector > mig_selectArchive (mig_select_oneArchive,MIG_SIZE,archive); - eoReplace > mig_replaceArchive (replace,archive); - eoPeriodicContinue< Indi > mig_contArchive( MIG_FREQ ); - eoContinuator contArchive(mig_contArchive, pop); - peoAsyncIslandMig< eoPop, eoPop > migArchive(contArchive,mig_selectArchive, mig_replaceArchive, topology); - checkpoint.add(migArchive); - - eoEasyEA< Indi > eaAlg( checkpoint, eval, select, transform, replace ); - peoWrapper parallelEA( eaAlg, pop); - eval.setOwner(parallelEA); - transform.setOwner(parallelEA); - mig.setOwner(parallelEA); - migArchive.setOwner(parallelEA); - -// Second algorithm -/*****************************************************************************************/ - - eoGenContinue < Indi > genContPara2 (MAX_GEN); - eoCombinedContinue continuatorPara2 (genContPara2); - eoCheckPoint checkpoint2(continuatorPara2); - peoEvalFunc mainEval2( f ); - peoPopEval eval2(mainEval2); - eoUniformGenerator < double >uGen2 (INIT_POSITION_MIN, INIT_POSITION_MAX); - eoInitFixedLength < Indi > random2 (VEC_SIZE, uGen2); - eoBestSelect selectionStrategy2; - eoSelectNumber select2(selectionStrategy2,POP_SIZE); - eoSegmentCrossover crossover2; - eoUniformMutation mutation2(EPSILON); - peoTransform transform2(crossover2,CROSS_RATE,mutation2,MUT_RATE); - eoPop < Indi > pop2; - pop2.append (POP_SIZE, random2); - eoPlusReplacement replace2; - eoBestSelect mig_select_one2; - eoSelector > mig_select2 (mig_select_one2,MIG_SIZE,pop2); - eoReplace > mig_replace2 (replace2,pop2); - eoPeriodicContinue< Indi > mig_cont2( MIG_FREQ ); - eoContinuator cont2(mig_cont2, pop2); - peoAsyncIslandMig< eoPop, eoPop > mig2(cont2,mig_select2, mig_replace2, topology); - checkpoint2.add(mig2); - - - eoRandomSelect mig_select_oneArchive2; - eoSelector > mig_selectArchive2 (mig_select_oneArchive2,MIG_SIZE,archive); - eoReplace > mig_replaceArchive2 (replace2,archive); - eoPeriodicContinue< Indi > mig_contArchive2( MIG_FREQ ); - eoContinuator contArchive2(mig_contArchive2, pop2); - peoAsyncIslandMig< eoPop, eoPop > migArchive2(contArchive2,mig_selectArchive2, mig_replaceArchive2, topology); - checkpoint2.add(migArchive2); - - - - eoEasyEA< Indi > eaAlg2( checkpoint2, eval2, select2, transform2, replace2 ); - peoWrapper parallelEA2( eaAlg2, pop2); - eval2.setOwner(parallelEA2); - transform2.setOwner(parallelEA2); - mig2.setOwner(parallelEA2); - migArchive2.setOwner(parallelEA2); - - - peo :: run(); - peo :: finalize(); - if (getNodeRank()==1) - { - pop.sort(); - pop2.sort(); - archive.sort(); - std::cout << "Final population 1 :\n" << pop << std::endl; - std::cout << "Final population 2 :\n" << pop2 << std::endl; - std::cout << "Archive after :\n" << archive << std::endl; - } -} - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson7/param b/trunk/paradiseo-peo/tutorial/Lesson7/param deleted file mode 100644 index 730f547e1..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson7/param +++ /dev/null @@ -1,9 +0,0 @@ -## miscallenous parameters - ---debug=false - -## deployment schema - ---schema=schema.xml - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson7/schema.xml b/trunk/paradiseo-peo/tutorial/Lesson7/schema.xml deleted file mode 100644 index ba6389de9..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson7/schema.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - 1 - 2 - - - - - - - - - - diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/Lesson8/CMakeLists.txt deleted file mode 100644 index b24dcee6d..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/CMakeLists.txt +++ /dev/null @@ -1,75 +0,0 @@ - -###################################################################################### -### 0) Set the compiler and define targets to easily run the lessons -###################################################################################### - -SET (CMAKE_CXX_COMPILER mpicxx) -SET(MAKE_SRC_DIR "${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/make" CACHE PATH "Make source directory" FORCE) - -ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/schema.xml) - -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/param - ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson8) -ADD_CUSTOM_COMMAND( - TARGET install - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson8/schema.xml - ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson8) - -###################################################################################### - - -###################################################################################### -### 1) Include the sources -###################################################################################### - -INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src ${MOEO_SRC_DIR}/src ${FLOWSHOP_SRC_DIR} ${MO_SRC_DIR}/src ${ParadisEO-PEO_SOURCE_DIR}/src ${TSP_SRC_DIR} ${MAKE_SRC_DIR}) - -###################################################################################### - - -###################################################################################### -### 2) Specify where CMake can find the libraries (mandatory: before 3) ) -###################################################################################### - -IF(NOT WIN32 OR CYGWIN) - LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${MOEO_BIN_DIR}/lib ${FLOWSHOP_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib ${TSP_BINARY_DIR}/lib) -ENDIF(NOT WIN32 OR CYGWIN) - - - -###################################################################################### - - -###################################################################################### -### 3) Define your target(s): just an executable here -###################################################################################### - -ADD_EXECUTABLE(example main.cpp) -ADD_DEPENDENCIES(example flowshop moeo peo rmc_mpi) - - -###################################################################################### - - -###################################################################################### -### 4) Optionnal: define your target(s)'s version: no effect for windows -###################################################################################### - - -###################################################################################### - -###################################################################################### -### 5) Link the librairies -###################################################################################### - -TARGET_LINK_LIBRARIES(example ${XML2_LIBS} flowshop moeo peo rmc_mpi eo eoutils) - -###################################################################################### diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/main.cpp b/trunk/paradiseo-peo/tutorial/Lesson8/main.cpp deleted file mode 100644 index 98a8068e5..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/main.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include -#include -#include "parallelStruct.h" -#include -#include - -int main(int argc, char* argv[]) -{ - - peo :: init( argc,argv ); - const unsigned int MIG_FREQ = 10; - const unsigned int MIG_SIZE = 1; - rng.reseed (time(0)); - - -// Global archive - moeoArchive globalArch; - if (getNodeRank()==1) - std::cout << "Archive before :\n" << globalArch << std::endl; - -/***************************************************/ -/***************** First algorithm *****************/ -/***************************************************/ - - // Topology - RingTopology topology; - - // Algorithm - eoParser parser(argc, argv); - eoState state; - peoMoeoPopEval& eval = do_make_para_eval(parser, state); - eoInit& init = do_make_genotype(parser, state); - eoGenOp& op = do_make_op(parser, state); - eoPop& pop = do_make_pop(parser, state, init); // peoMoeoPop is defined in parallelStruct.h - moeoArchive arch; - eoContinue& term = do_make_continue_moeo(parser, state, eval); - eoCheckPoint < FlowShop> & checkpoint = state.storeFunctor(new eoCheckPoint < FlowShop > (term)); - - // Communication between EA and the global archive - - // Selection mode in the EA - moeoRandomSelect mig_select_one; - moeoSelector > mig_select (mig_select_one,MIG_SIZE,pop); // moeoSelector is defined in parallelStruct.h - // Mode of replacement in the EA - moeoReplace < moeoArchive, eoPop > mig_replace (pop); // moeoReplace is defined in parallelStruct.h - // Continuator for the island - eoPeriodicContinue< FlowShop> mig_cont( MIG_FREQ ); - eoContinuator cont(mig_cont, pop); - // Communication : EA ---> global archive - peoAsyncIslandMig< eoPop, moeoArchive > mig(cont,mig_select, mig_replace, topology); - checkpoint.add(mig); - // Selection mode in the global archive - moeoSelectorArchive < moeoArchive > mig_selectArchive (globalArch); // moeoSelectorArchive is defined in parallelStruct.h - // Mode of replacement in the global archive - moeoReplaceArchive < eoPop, moeoArchive > mig_replaceArchive (globalArch); // moeoReplaceArchive is defined in parallelStruct.h - // Continuator for the island - eoPeriodicContinue< FlowShop> mig_contArchive( MIG_FREQ ); - eoContinuator contArchive(mig_contArchive, pop); - // Communication : global archive ---> EA - peoAsyncIslandMig< moeoArchive, eoPop > migArchive(contArchive, mig_selectArchive, mig_replaceArchive, topology); - checkpoint.add(migArchive); - - eoAlgo& algo = do_make_ea_moeo(parser, state, eval, checkpoint, op, arch); - peoWrapper parallelMOEO( algo, pop); - eval.setOwner(parallelMOEO); - // Migrations - mig.setOwner(parallelMOEO); - migArchive.setOwner(parallelMOEO); - -/***************************************************/ -/***************************************************/ -/***************************************************/ - -// The same one - - RingTopology topology2; - eoParser parser2(argc, argv); - eoState state2; - peoMoeoPopEval& eval2 = do_make_para_eval(parser2, state2); - eoInit& init2 = do_make_genotype(parser2, state2); - eoGenOp& op2 = do_make_op(parser2, state2); - eoPop& pop2 = do_make_pop(parser2, state2, init2); - moeoArchive arch2; - eoContinue& term2 = do_make_continue_moeo(parser2, state2, eval2); - eoCheckPoint < FlowShop> & checkpoint2 = state2.storeFunctor(new eoCheckPoint < FlowShop > (term2)); - moeoRandomSelect mig_select_one2; - moeoSelector > mig_select2 (mig_select_one2,MIG_SIZE,pop2); - moeoReplace < moeoArchive, eoPop > mig_replace2 (pop2); - eoPeriodicContinue< FlowShop> mig_cont2( MIG_FREQ ); - eoContinuator cont2(mig_cont2, pop2); - peoAsyncIslandMig< eoPop, moeoArchive > mig2(cont2,mig_select2, mig_replace2, topology2); - checkpoint2.add(mig2); - moeoSelectorArchive < moeoArchive > mig_selectArchive2 (globalArch); - moeoReplaceArchive < eoPop, moeoArchive > mig_replaceArchive2 (globalArch); - eoPeriodicContinue< FlowShop> mig_contArchive2( MIG_FREQ ); - eoContinuator contArchive2(mig_contArchive2, pop2); - peoAsyncIslandMig< moeoArchive, eoPop > migArchive2(contArchive2, mig_selectArchive2, mig_replaceArchive2, topology2); - checkpoint2.add(migArchive2); - eoAlgo& algo2 = do_make_ea_moeo(parser2, state2, eval2, checkpoint2, op2, arch2); - peoWrapper parallelMOEO2( algo2, pop2); - eval2.setOwner(parallelMOEO2); - mig2.setOwner(parallelMOEO2); - migArchive2.setOwner(parallelMOEO2); - - peo :: run(); - peo :: finalize(); - if (getNodeRank()==1) - { - pop.sort(); - std::cout << "Final population :\n" << pop << std::endl; - pop2.sort(); - std::cout << "Final population :\n" << pop2 << std::endl; - globalArch.sort(); - std::cout << "Archive after :\n" << globalArch << std::endl; - } -} diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_checkpoint_moeo.h b/trunk/paradiseo-peo/tutorial/Lesson8/make/make_checkpoint_moeo.h deleted file mode 100644 index f2e8ffa37..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_checkpoint_moeo.h +++ /dev/null @@ -1,201 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -* -*/ -//----------------------------------------------------------------------------- - -#ifndef MAKE_CHECKPOINT_MOEO_H_ -#define MAKE_CHECKPOINT_MOEO_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -bool testDirRes(std::string _dirName, bool _erase); - -/** - * This functions allows to build an eoCheckPoint for multi-objective optimization from the parser (partly taken from make_checkpoint_pareto.h) - * @param _parser the parser - * @param _state to store allocated objects - * @param _eval the funtions evaluator - * @param _continue the stopping crietria - * @param _pop the population - * @param _archive the archive of non-dominated solutions - */ -template < class MOEOT > -eoCheckPoint < MOEOT > & do_make_checkpoint_moeo (eoParser & _parser, eoState & _state, eoPopEvalFunc < MOEOT > & _eval, eoContinue < MOEOT > & _continue, eoPop < MOEOT > & _pop, moeoArchive < MOEOT > & _archive) -{ - eoCheckPoint < MOEOT > & checkpoint = _state.storeFunctor(new eoCheckPoint < MOEOT > (_continue)); - /* the objective vector type */ - typedef typename MOEOT::ObjectiveVector ObjectiveVector; - - /////////////////// - // Counters - ////////////////// - // is nb Eval to be used as counter? - //bool useEval = _parser.getORcreateParam(true, "useEval", "Use nb of eval. as counter (vs nb of gen.)", '\0', "Output").value(); - // Create anyway a generation-counter parameter - eoValueParam *generationCounter = new eoValueParam(0, "Gen."); - // Create an incrementor (sub-class of eoUpdater). - eoIncrementor & increment = _state.storeFunctor( new eoIncrementor(generationCounter->value()) ); - // Add it to the checkpoint - checkpoint.add(increment); - // dir for DISK output - std::string & dirName = _parser.getORcreateParam(std::string("Res"), "resDir", "Directory to store DISK outputs", '\0', "Output").value(); - // shoudl we empty it if exists - eoValueParam& eraseParam = _parser.getORcreateParam(true, "eraseDir", "erase files in dirName if any", '\0', "Output"); - bool dirOK = false; // not tested yet - - // Dump of the whole population - //----------------------------- - bool printPop = _parser.getORcreateParam(false, "printPop", "Print sorted pop. every gen.", '\0', "Output").value(); - eoSortedPopStat * popStat; - if ( printPop ) // we do want pop dump - { - popStat = & _state.storeFunctor(new eoSortedPopStat); - checkpoint.add(*popStat); - } - - ////////////////////////////////// - // State savers - ////////////////////////////// - // feed the state to state savers - // save state every N generation - eoValueParam& saveFrequencyParam = _parser.createParam((unsigned int)(0), "saveFrequency", "Save every F generation (0 = only final state, absent = never)", '\0', "Persistence" ); - if (_parser.isItThere(saveFrequencyParam)) - { - // first make sure dirName is OK - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE - unsigned int freq = (saveFrequencyParam.value()>0 ? saveFrequencyParam.value() : UINT_MAX ); -#ifdef _MSVC - std::string stmp = dirName + "\generations"; -#else - std::string stmp = dirName + "/generations"; -#endif - eoCountedStateSaver *stateSaver1 = new eoCountedStateSaver(freq, _state, stmp); - _state.storeFunctor(stateSaver1); - checkpoint.add(*stateSaver1); - } - // save state every T seconds - eoValueParam& saveTimeIntervalParam = _parser.getORcreateParam((unsigned int)(0), "saveTimeInterval", "Save every T seconds (0 or absent = never)", '\0',"Persistence" ); - if (_parser.isItThere(saveTimeIntervalParam) && saveTimeIntervalParam.value()>0) - { - // first make sure dirName is OK - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE -#ifdef _MSVC - std::string stmp = dirName + "\time"; -#else - std::string stmp = dirName + "/time"; -#endif - eoTimedStateSaver *stateSaver2 = new eoTimedStateSaver(saveTimeIntervalParam.value(), _state, stmp); - _state.storeFunctor(stateSaver2); - checkpoint.add(*stateSaver2); - } - - /////////////////// - // Archive - ////////////////// - // update the archive every generation - bool updateArch = _parser.getORcreateParam(true, "updateArch", "Update the archive at each gen.", '\0', "Evolution Engine").value(); - if (updateArch) - { - moeoArchiveUpdater < MOEOT > * updater = new moeoArchiveUpdater < MOEOT > (_archive, _pop); - _state.storeFunctor(updater); - checkpoint.add(*updater); - } - // store the objective vectors contained in the archive every generation - bool storeArch = _parser.getORcreateParam(false, "storeArch", "Store the archive's objective vectors at each gen.", '\0', "Output").value(); - if (storeArch) - { - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE -#ifdef _MSVC - std::string stmp = dirName + "\arch"; -#else - std::string stmp = dirName + "/arch"; -#endif - moeoArchiveObjectiveVectorSavingUpdater < MOEOT > * save_updater = new moeoArchiveObjectiveVectorSavingUpdater < MOEOT > (_archive, stmp); - _state.storeFunctor(save_updater); - checkpoint.add(*save_updater); - } - // store the contribution of the non-dominated solutions - bool cont = _parser.getORcreateParam(false, "contribution", "Store the contribution of the archive at each gen.", '\0', "Output").value(); - if (cont) - { - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE -#ifdef _MSVC - std::string stmp = dirName + "\contribution"; -#else - std::string stmp = dirName + "/contribution"; -#endif - moeoContributionMetric < ObjectiveVector > * contribution = new moeoContributionMetric < ObjectiveVector >; - moeoBinaryMetricSavingUpdater < MOEOT > * contribution_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*contribution, _archive, stmp); - _state.storeFunctor(contribution_updater); - checkpoint.add(*contribution_updater); - } - // store the entropy of the non-dominated solutions - bool ent = _parser.getORcreateParam(false, "entropy", "Store the entropy of the archive at each gen.", '\0', "Output").value(); - if (ent) - { - if (! dirOK ) - dirOK = testDirRes(dirName, eraseParam.value()); // TRUE -#ifdef _MSVC - std::string stmp = dirName + "\entropy"; -#else - std::string stmp = dirName + "/entropy"; -#endif - moeoEntropyMetric < ObjectiveVector > * entropy = new moeoEntropyMetric < ObjectiveVector >; - moeoBinaryMetricSavingUpdater < MOEOT > * entropy_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*entropy, _archive, stmp); - _state.storeFunctor(entropy_updater); - checkpoint.add(*entropy_updater); - } - - // and that's it for the (control and) output - return checkpoint; -} - -#endif /*MAKE_CHECKPOINT_MOEO_H_*/ diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_continue_moeo.h b/trunk/paradiseo-peo/tutorial/Lesson8/make/make_continue_moeo.h deleted file mode 100644 index 954ebb4ac..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_continue_moeo.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -* -*/ -//----------------------------------------------------------------------------- - -#ifndef MAKE_CONTINUE_MOEO_H_ -#define MAKE_CONTINUE_MOEO_H_ -#include -#include -#include -#include -#include -#ifndef _MSC_VER -#include -#endif -#include -#include - - -/** - * Helper function - * @param _combined the eoCombinedContinue object - * @param _cont the eoContinue to add - */ -template -eoCombinedContinue * make_combinedContinue(eoCombinedContinue *_combined, eoContinue *_cont) -{ - if (_combined) // already exists - _combined->add(*_cont); - else - _combined = new eoCombinedContinue(*_cont); - return _combined; -} - - -/** - * This functions allows to build a eoContinue for multi-objective optimization from the parser (partly taken from make_continue_pareto.h) - * @param _parser the parser - * @param _state to store allocated objects - * @param _eval the funtions evaluator - */ -template -eoContinue & do_make_continue_moeo(eoParser& _parser, eoState& _state, eoPopEvalFunc & _eval) -{ - // the combined continue - to be filled - eoCombinedContinue *continuator = NULL; - // First the eoGenContinue - need a default value so you can run blind - // but we also need to be able to avoid it <--> 0 - eoValueParam& maxGenParam = _parser.createParam((unsigned int)(100), "maxGen", "Maximum number of generations (0 = none)",'G',"Stopping criterion"); - if (maxGenParam.value()) // positive: -> define and store - { - eoGenContinue *genCont = new eoGenContinue(maxGenParam.value()); - _state.storeFunctor(genCont); - // and "add" to combined - continuator = make_combinedContinue(continuator, genCont); - } - // maxEval - eoValueParam& maxEvalParam = _parser.getORcreateParam((unsigned long)(0), "maxEval", "Maximum number of evaluations (0 = none)", 'E', "Stopping criterion"); - /* if (maxEvalParam.value()) - { - eoEvalContinue *evalCont = new eoEvalContinue(_eval, maxEvalParam.value()); - _state.storeFunctor(evalCont); - // and "add" to combined - continuator = make_combinedContinue(continuator, evalCont); - }*/ - // maxTime - eoValueParam& maxTimeParam = _parser.getORcreateParam((unsigned long)(0), "maxTime", "Maximum running time in seconds (0 = none)", 'T', "Stopping criterion"); - if (maxTimeParam.value()) // positive: -> define and store - { - eoTimeContinue *timeCont = new eoTimeContinue(maxTimeParam.value()); - _state.storeFunctor(timeCont); - // and "add" to combined - continuator = make_combinedContinue(continuator, timeCont); - } - // CtrlC -#ifndef _MSC_VER - // the CtrlC interception (Linux only I'm afraid) - eoCtrlCContinue *ctrlCCont; - eoValueParam& ctrlCParam = _parser.createParam(true, "CtrlC", "Terminate current generation upon Ctrl C",'C', "Stopping criterion"); - if (_parser.isItThere(ctrlCParam)) - { - ctrlCCont = new eoCtrlCContinue; - // store - _state.storeFunctor(ctrlCCont); - // add to combinedContinue - continuator = make_combinedContinue(continuator, ctrlCCont); - } -#endif - // now check that there is at least one! - if (!continuator) - throw std::runtime_error("You MUST provide a stopping criterion"); - // OK, it's there: store in the eoState - _state.storeFunctor(continuator); - // and return - return *continuator; -} - -#endif /*MAKE_CONTINUE_MOEO_H_*/ diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_ea_moeo.h b/trunk/paradiseo-peo/tutorial/Lesson8/make/make_ea_moeo.h deleted file mode 100644 index 49bd3b968..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_ea_moeo.h +++ /dev/null @@ -1,297 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -* -*/ -//----------------------------------------------------------------------------- - -#ifndef MAKE_EA_MOEO_H_ -#define MAKE_EA_MOEO_H_ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/** - * This functions allows to build a moeoEA from the parser - * @param _parser the parser - * @param _state to store allocated objects - * @param _eval the funtions evaluator - * @param _continue the stopping crietria - * @param _op the variation operators - * @param _archive the archive of non-dominated solutions - */ -template < class MOEOT > -moeoEA < MOEOT > & do_make_ea_moeo(eoParser & _parser, eoState & _state, eoPopEvalFunc < MOEOT > & _eval, eoContinue < MOEOT > & _continue, eoGenOp < MOEOT > & _op, moeoArchive < MOEOT > & _archive) -{ - - /* the objective vector type */ - typedef typename MOEOT::ObjectiveVector ObjectiveVector; - - - /* the fitness assignment strategy */ - std::string & fitnessParam = _parser.createParam(std::string("FastNonDominatedSorting"), "fitness", - "Fitness assignment scheme: Dummy, FastNonDominatedSorting or IndicatorBased", 'F', - "Evolution Engine").value(); - std::string & indicatorParam = _parser.createParam(std::string("Epsilon"), "indicator", - "Binary indicator for IndicatorBased: Epsilon, Hypervolume", 'i', - "Evolution Engine").value(); - double rho = _parser.createParam(1.1, "rho", "reference point for the hypervolume indicator", 'r', - "Evolution Engine").value(); - double kappa = _parser.createParam(0.05, "kappa", "Scaling factor kappa for IndicatorBased", 'k', - "Evolution Engine").value(); - moeoFitnessAssignment < MOEOT > * fitnessAssignment; - if (fitnessParam == std::string("Dummy")) - { - fitnessAssignment = new moeoDummyFitnessAssignment < MOEOT> (); - } - else if (fitnessParam == std::string("FastNonDominatedSorting")) - { - fitnessAssignment = new moeoFastNonDominatedSortingFitnessAssignment < MOEOT> (); - } - else if (fitnessParam == std::string("IndicatorBased")) - { - // metric - moeoNormalizedSolutionVsSolutionBinaryMetric < ObjectiveVector, double > *metric; - if (indicatorParam == std::string("Epsilon")) - { - metric = new moeoAdditiveEpsilonBinaryMetric < ObjectiveVector >; - } - else if (indicatorParam == std::string("Hypervolume")) - { - metric = new moeoHypervolumeBinaryMetric < ObjectiveVector > (rho); - } - else - { - std::string stmp = std::string("Invalid binary quality indicator: ") + indicatorParam; - throw std::runtime_error(stmp.c_str()); - } - fitnessAssignment = new moeoExpBinaryIndicatorBasedFitnessAssignment < MOEOT > (*metric, kappa); - } - else - { - std::string stmp = std::string("Invalid fitness assignment strategy: ") + fitnessParam; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(fitnessAssignment); - - - /* the diversity assignment strategy */ - eoValueParam & diversityParam = _parser.createParam(eoParamParamType("Dummy"), "diversity", - "Diversity assignment scheme: Dummy, Sharing(nicheSize) or Crowding", 'D', "Evolution Engine"); - eoParamParamType & diversityParamValue = diversityParam.value(); - moeoDiversityAssignment < MOEOT > * diversityAssignment; - if (diversityParamValue.first == std::string("Dummy")) - { - diversityAssignment = new moeoDummyDiversityAssignment < MOEOT> (); - } - else if (diversityParamValue.first == std::string("Sharing")) - { - double nicheSize; - if (!diversityParamValue.second.size()) // no parameter added - { - std::cerr << "WARNING, no niche size given for Sharing, using 0.5" << std::endl; - nicheSize = 0.5; - diversityParamValue.second.push_back(std::string("0.5")); - } - else - { - nicheSize = atoi(diversityParamValue.second[0].c_str()); - } - diversityAssignment = new moeoFrontByFrontSharingDiversityAssignment < MOEOT> (nicheSize); - } - else if (diversityParamValue.first == std::string("Crowding")) - { - diversityAssignment = new moeoFrontByFrontCrowdingDiversityAssignment < MOEOT> (); - } - else - { - std::string stmp = std::string("Invalid diversity assignment strategy: ") + diversityParamValue.first; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(diversityAssignment); - - - /* the comparator strategy */ - std::string & comparatorParam = _parser.createParam(std::string("FitnessThenDiversity"), "comparator", - "Comparator scheme: FitnessThenDiversity, DiversityThenFitness or Aggregative", 'C', "Evolution Engine").value(); - moeoComparator < MOEOT > * comparator; - if (comparatorParam == std::string("FitnessThenDiversity")) - { - comparator = new moeoFitnessThenDiversityComparator < MOEOT> (); - } - else if (comparatorParam == std::string("DiversityThenFitness")) - { - comparator = new moeoDiversityThenFitnessComparator < MOEOT> (); - } - else if (comparatorParam == std::string("Aggregative")) - { - comparator = new moeoAggregativeComparator < MOEOT> (); - } - else - { - std::string stmp = std::string("Invalid comparator strategy: ") + comparatorParam; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(comparator); - - - /* the selection strategy */ - eoValueParam < eoParamParamType > & selectionParam = _parser.createParam(eoParamParamType("DetTour(2)"), "selection", - "Selection scheme: DetTour(T), StochTour(t) or Random", 'S', "Evolution Engine"); - eoParamParamType & ppSelect = selectionParam.value(); - moeoSelectOne < MOEOT > * select; - if (ppSelect.first == std::string("DetTour")) - { - unsigned int tSize; - if (!ppSelect.second.size()) // no parameter added - { - std::cerr << "WARNING, no parameter passed to DetTour, using 2" << std::endl; - tSize = 2; - // put back 2 in parameter for consistency (and status file) - ppSelect.second.push_back(std::string("2")); - } - else // parameter passed by user as DetTour(T) - { - tSize = atoi(ppSelect.second[0].c_str()); - } - select = new moeoDetTournamentSelect < MOEOT > (*comparator, tSize); - } - else if (ppSelect.first == std::string("StochTour")) - { - double tRate; - if (!ppSelect.second.size()) // no parameter added - { - std::cerr << "WARNING, no parameter passed to StochTour, using 1" << std::endl; - tRate = 1; - // put back 1 in parameter for consistency (and status file) - ppSelect.second.push_back(std::string("1")); - } - else // parameter passed by user as StochTour(T) - { - tRate = atof(ppSelect.second[0].c_str()); - } - select = new moeoStochTournamentSelect < MOEOT > (*comparator, tRate); - } - /* - else if (ppSelect.first == string("Roulette")) - { - // TO DO ! - // ... - } - */ - else if (ppSelect.first == std::string("Random")) - { - select = new moeoRandomSelect (); - } - else - { - std::string stmp = std::string("Invalid selection strategy: ") + ppSelect.first; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(select); - - - /* the replacement strategy */ - std::string & replacementParam = _parser.createParam(std::string("Elitist"), "replacement", - "Replacement scheme: Elitist, Environmental or Generational", 'R', "Evolution Engine").value(); - moeoReplacement < MOEOT > * replace; - if (replacementParam == std::string("Elitist")) - { - replace = new moeoElitistReplacement < MOEOT> (*fitnessAssignment, *diversityAssignment, *comparator); - } - else if (replacementParam == std::string("Environmental")) - { - replace = new moeoEnvironmentalReplacement < MOEOT> (*fitnessAssignment, *diversityAssignment, *comparator); - } - else if (replacementParam == std::string("Generational")) - { - replace = new moeoGenerationalReplacement < MOEOT> (); - } - else - { - std::string stmp = std::string("Invalid replacement strategy: ") + replacementParam; - throw std::runtime_error(stmp.c_str()); - } - _state.storeFunctor(replace); - - - /* the number of offspring */ - eoValueParam < eoHowMany > & offspringRateParam = _parser.createParam(eoHowMany(1.0), "nbOffspring", - "Number of offspring (percentage or absolute)", 'O', "Evolution Engine"); - - - // the general breeder - eoGeneralBreeder < MOEOT > * breed = new eoGeneralBreeder < MOEOT > (*select, _op, offspringRateParam.value()); - _state.storeFunctor(breed); - // the eoEasyEA - moeoEA < MOEOT > * algo = new moeoEasyEA < MOEOT > (_continue, _eval, *breed, *replace, *fitnessAssignment, *diversityAssignment); - _state.storeFunctor(algo); - return *algo; - -} - -#endif /*MAKE_EA_MOEO_H_*/ diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_library.h b/trunk/paradiseo-peo/tutorial/Lesson8/make/make_library.h deleted file mode 100644 index cd0554da0..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_library.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -#include -#include -#include -#include -#include -#include -#include diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_para_eval.h b/trunk/paradiseo-peo/tutorial/Lesson8/make/make_para_eval.h deleted file mode 100644 index a9b6db3cc..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/make/make_para_eval.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -* -* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 -* (C) OPAC Team, LIFL, 2002-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 -#include -#include - -peoMoeoPopEval & do_make_para_eval(eoParser& _parser, eoState& _state) -{ - std::string benchmarkFileName = _parser.getORcreateParam(std::string(), "BenchmarkFile", "Benchmark file name (benchmarks are available at www.lifl.fr/~liefooga/benchmarks)", 'B',"Representation", true).value(); - if (benchmarkFileName == "") - { - std::string stmp = "*** Missing name of the benchmark file\n"; - stmp += " Type '-B=the_benchmark_file_name' or '--BenchmarkFile=the_benchmark_file_name'\n"; - stmp += " Benchmarks files are available at www.lifl.fr/~liefooga/benchmarks"; - throw std::runtime_error(stmp.c_str()); - } - FlowShopBenchmarkParser fParser(benchmarkFileName); - unsigned int M = fParser.getM(); - unsigned int N = fParser.getN(); - std::vector< std::vector > p = fParser.getP(); - std::vector d = fParser.getD(); - - FlowShopEval* plainEval = new FlowShopEval(M, N, p, d); - peoMoeoPopEval* eval = new peoMoeoPopEval (* plainEval); - _state.storeFunctor(eval); - return *eval; -} diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/parallelStruct.h b/trunk/paradiseo-peo/tutorial/Lesson8/parallelStruct.h deleted file mode 100644 index ff44b64ee..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/parallelStruct.h +++ /dev/null @@ -1,89 +0,0 @@ -template < class EOT, class TYPE> class moeoSelector : public selector< TYPE > - { - public: - - - moeoSelector(moeoSelectOne & _select, unsigned _nb_select, const TYPE & _source): selector (_select), nb_select(_nb_select), source(_source) - {} - - // Example - virtual void operator()(TYPE & _dest) - { - size_t target = static_cast(nb_select); - _dest.resize(target); - for (size_t i = 0; i < _dest.size(); ++i) - _dest[i] = selector(source); - } - - protected: - moeoSelectOne & selector ; - unsigned nb_select; - const TYPE & source; - }; - - - template < class TYPESOUR, class TYPEDEST> class moeoReplaceArchive : public replacement< TYPESOUR > - { - public: - - moeoReplaceArchive(TYPEDEST & _destination): destination(_destination) - {} - - // Example - virtual void operator()(TYPESOUR & _source) - { - destination.update (_source); - } - - protected: - TYPEDEST & destination; - }; - - - - template < class TYPESOUR, class TYPEDEST> class moeoReplace : public replacement< TYPESOUR > - { - public: - - moeoReplace(TYPEDEST & _destination): destination(_destination) - {} - - // Example - virtual void operator()(TYPESOUR & _source) - { - for(unsigned i=0;i<_source.size();i++) - { - unsigned ind=0; - double worst=destination[0].fitness(); - for (unsigned j=1;j class moeoSelectorArchive : public selector< TYPE > - { - public: - - - moeoSelectorArchive(const TYPE & _source): source(_source) - {} - - // Example - virtual void operator()(TYPE & _dest) - { - _dest.update (source); - } - - protected: - const TYPE & source; -}; diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/param b/trunk/paradiseo-peo/tutorial/Lesson8/param deleted file mode 100644 index f2deaa9d6..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/param +++ /dev/null @@ -1,63 +0,0 @@ -###### General ###### ---help=0 # -h : Prints this message -#--stopOnUnknownParam=1 # Stop if unkown param entered -# --seed=1183379758 # -S : Random number seed - -###### Evolution Engine ###### ---popSize=20 # -P : Population Size ---updateArch=1 # Update the archive at each gen. ---fitness=FastNonDominatedSorting # -F : Fitness assignment scheme: Dummy, FastNonDominatedSorting or IndicatorBased ---indicator=Epsilon # -i : Binary indicator for IndicatorBased: Epsilon, Hypervolume ---rho=1.1 # -r : reference point for the hypervolume indicator ---kappa=0.05 # -k : Scaling factor kappa for IndicatorBased ---diversity=Crowding # -D : Diversity assignment scheme: Dummy, Sharing(nicheSize) or Crowding ---comparator=FitnessThenDiversity # -C : Comparator scheme: FitnessThenDiversity, DiversityThenFitness or Aggregative ---selection=DetTour(2) # -S : Selection scheme: DetTour(T), StochTour(t) or Random ---replacement=Elitist # -R : Replacement scheme: Elitist, Environmental or Generational ---nbOffspring=100% # -O : Number of offspring (percentage or absolute) - -###### Output ###### -#--resDir=Res # Directory to store DISK outputs -#--eraseDir=1 # erase files in dirName if any ---printPop=0 # Print sorted pop. every gen. ---storeArch=0 # Store the archive's objective vectors at each gen. ---contribution=0 # Store the contribution of the archive at each gen. ---entropy=0 # Store the entropy of the archive at each gen. - -###### Persistence ###### ---Load= # -L : A save file to restart from ---recomputeFitness=0 # -r : Recompute the fitness after re-loading the pop.? ---saveFrequency=0 # Save every F generation (0 = only final state, absent = never) ---saveTimeInterval=0 # Save every T seconds (0 or absent = never) -#--status=./FlowShopEA.status # Status file - -###### Representation ###### ---BenchmarkFile=../../../../paradiseo-moeo/tutorial/examples/flowshop/benchs/020_10_01.txt # -B : Benchmark file name REQUIRED - -###### Stopping criterion ###### ---maxGen=100 # -G : Maximum number of generations (0 = none) ---maxEval=0 # -E : Maximum number of evaluations (0 = none) ---maxTime=0 # -T : Maximum running time in seconds (0 = none) -#--CtrlC=1 # -C : Terminate current generation upon Ctrl C (only available on Unix platforms) - -###### Variation Operators ###### ---crossRate=1 # Relative rate for the only crossover ---shiftMutRate=0.5 # Relative rate for shift mutation ---exchangeMutRate=0.5 # Relative rate for exchange mutation ---pCross=0.25 # -c : Probability of Crossover ---pMut=0.35 # -m : Probability of Mutation - - - -## miscallenous parameters - ---debug=false - -## deployment schema - ---schema=schema.xml - -## parameters - ---inst=../examples/tsp/benchs/eil101.tsp - diff --git a/trunk/paradiseo-peo/tutorial/Lesson8/schema.xml b/trunk/paradiseo-peo/tutorial/Lesson8/schema.xml deleted file mode 100644 index 23da1d55e..000000000 --- a/trunk/paradiseo-peo/tutorial/Lesson8/schema.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - 1 - 2 - - - - - - - diff --git a/trunk/paradiseo-peo/tutorial/examples/tsp/CMakeLists.txt b/trunk/paradiseo-peo/tutorial/examples/tsp/CMakeLists.txt index b22a7fe63..bc82988f8 100644 --- a/trunk/paradiseo-peo/tutorial/examples/tsp/CMakeLists.txt +++ b/trunk/paradiseo-peo/tutorial/examples/tsp/CMakeLists.txt @@ -80,31 +80,3 @@ SET(TSP_VERSION ${GLOBAL_VERSION}) SET_TARGET_PROPERTIES(tsp PROPERTIES VERSION "${TSP_VERSION}") ###################################################################################### - -###################################################################################### -### 4) Windows advanced config - especially for Microsoft Visual Studio 8 -###################################################################################### - - IF(CMAKE_CXX_COMPILER MATCHES cl) - IF(NOT WITH_SHARED_LIBS) - IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - SET(CMAKE_CXX_FLAGS "/nologo /W3 /Gy") - SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od") - SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2") - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") - - ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005") - ENDIF(NOT WITH_SHARED_LIBS) - ENDIF(CMAKE_CXX_COMPILER MATCHES cl) -###################################################################################### - - -###################################################################################### -### 5) Where must cmake go now ? -###################################################################################### - -# nothing to be compiled in the subdirs - -######################################################################################