From 521c7e5bf58fbc50c6e5d3def21d5459795ec071 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 25 Sep 2014 15:28:21 +0200 Subject: [PATCH] * Add problems/DTLZ from http://paradiseo.gforge.inria.fr/index.php?n=Problems.DTLZ --- problems/DTLZ/CMakeLists.txt | 106 +++++ problems/DTLZ/README.txt | 45 ++ problems/DTLZ/application/CMakeLists.txt | 76 ++++ problems/DTLZ/application/DTLZ_IBEA.cpp | 172 ++++++++ problems/DTLZ/application/DTLZ_NSGAII.cpp | 169 ++++++++ problems/DTLZ/application/DTLZ_SPEA2.cpp | 190 +++++++++ problems/DTLZ/application/IBEA.param | 28 ++ problems/DTLZ/application/NSGAII.param | 28 ++ problems/DTLZ/application/SPEA2.param | 30 ++ problems/DTLZ/doc/CMakeLists.txt | 26 ++ problems/DTLZ/doc/html/doxygen.css | 433 ++++++++++++++++++++ problems/DTLZ/doc/html/doxygen.png | Bin 0 -> 1281 bytes problems/DTLZ/doc/html/ftv2blank.png | Bin 0 -> 174 bytes problems/DTLZ/doc/html/ftv2doc.png | Bin 0 -> 255 bytes problems/DTLZ/doc/html/ftv2folderclosed.png | Bin 0 -> 259 bytes problems/DTLZ/doc/html/ftv2folderopen.png | Bin 0 -> 261 bytes problems/DTLZ/doc/html/ftv2lastnode.png | Bin 0 -> 233 bytes problems/DTLZ/doc/html/ftv2link.png | Bin 0 -> 358 bytes problems/DTLZ/doc/html/ftv2mlastnode.png | Bin 0 -> 160 bytes problems/DTLZ/doc/html/ftv2mnode.png | Bin 0 -> 194 bytes problems/DTLZ/doc/html/ftv2node.png | Bin 0 -> 235 bytes problems/DTLZ/doc/html/ftv2plastnode.png | Bin 0 -> 165 bytes problems/DTLZ/doc/html/ftv2pnode.png | Bin 0 -> 200 bytes problems/DTLZ/doc/html/ftv2vertline.png | Bin 0 -> 229 bytes problems/DTLZ/doc/html/installdox | 117 ++++++ problems/DTLZ/doc/html/search.idx | Bin 0 -> 279856 bytes problems/DTLZ/doc/html/search.php | 382 +++++++++++++++++ problems/DTLZ/doc/html/tab_b.gif | Bin 0 -> 35 bytes problems/DTLZ/doc/html/tab_l.gif | Bin 0 -> 706 bytes problems/DTLZ/doc/html/tab_r.gif | Bin 0 -> 2585 bytes problems/DTLZ/doc/html/tabs.css | 102 +++++ problems/DTLZ/doc/index.h | 57 +++ problems/DTLZ/doc/moeo.doxyfile.cmake | 237 +++++++++++ problems/DTLZ/install.cmake | 28 ++ problems/DTLZ/run.sh | 50 +++ problems/DTLZ/src/CMakeLists.txt | 33 ++ problems/DTLZ/src/DTLZ.cpp | 44 ++ problems/DTLZ/src/DTLZ.h | 58 +++ problems/DTLZ/src/DTLZ1Eval.cpp | 74 ++++ problems/DTLZ/src/DTLZ1Eval.h | 58 +++ problems/DTLZ/src/DTLZ2Eval.cpp | 73 ++++ problems/DTLZ/src/DTLZ2Eval.h | 57 +++ problems/DTLZ/src/DTLZ3Eval.cpp | 74 ++++ problems/DTLZ/src/DTLZ3Eval.h | 58 +++ problems/DTLZ/src/DTLZ4Eval.cpp | 75 ++++ problems/DTLZ/src/DTLZ4Eval.h | 68 +++ problems/DTLZ/src/DTLZ5Eval.cpp | 82 ++++ problems/DTLZ/src/DTLZ5Eval.h | 59 +++ problems/DTLZ/src/DTLZ6Eval.cpp | 81 ++++ problems/DTLZ/src/DTLZ6Eval.h | 60 +++ problems/DTLZ/src/DTLZ7Eval.cpp | 74 ++++ problems/DTLZ/src/DTLZ7Eval.h | 59 +++ problems/DTLZ/src/DTLZObjectiveVector.h | 47 +++ problems/DTLZ/src/PolynomialMutation.h | 123 ++++++ problems/DTLZ/src/SBXCrossover.h | 194 +++++++++ problems/DTLZ/test/CMakeLists.txt | 62 +++ problems/DTLZ/test/t-DTLZ.cpp | 62 +++ problems/DTLZ/test/t-DTLZ1Eval.cpp | 130 ++++++ problems/DTLZ/test/t-DTLZ2Eval.cpp | 131 ++++++ problems/DTLZ/test/t-DTLZ3Eval.cpp | 131 ++++++ problems/DTLZ/test/t-DTLZ4Eval.cpp | 131 ++++++ problems/DTLZ/test/t-DTLZ5Eval.cpp | 132 ++++++ problems/DTLZ/test/t-DTLZ6Eval.cpp | 133 ++++++ problems/DTLZ/test/t-DTLZ7Eval.cpp | 131 ++++++ 64 files changed, 4770 insertions(+) create mode 100644 problems/DTLZ/CMakeLists.txt create mode 100644 problems/DTLZ/README.txt create mode 100644 problems/DTLZ/application/CMakeLists.txt create mode 100644 problems/DTLZ/application/DTLZ_IBEA.cpp create mode 100644 problems/DTLZ/application/DTLZ_NSGAII.cpp create mode 100644 problems/DTLZ/application/DTLZ_SPEA2.cpp create mode 100644 problems/DTLZ/application/IBEA.param create mode 100644 problems/DTLZ/application/NSGAII.param create mode 100644 problems/DTLZ/application/SPEA2.param create mode 100644 problems/DTLZ/doc/CMakeLists.txt create mode 100644 problems/DTLZ/doc/html/doxygen.css create mode 100644 problems/DTLZ/doc/html/doxygen.png create mode 100644 problems/DTLZ/doc/html/ftv2blank.png create mode 100644 problems/DTLZ/doc/html/ftv2doc.png create mode 100644 problems/DTLZ/doc/html/ftv2folderclosed.png create mode 100644 problems/DTLZ/doc/html/ftv2folderopen.png create mode 100644 problems/DTLZ/doc/html/ftv2lastnode.png create mode 100644 problems/DTLZ/doc/html/ftv2link.png create mode 100644 problems/DTLZ/doc/html/ftv2mlastnode.png create mode 100644 problems/DTLZ/doc/html/ftv2mnode.png create mode 100644 problems/DTLZ/doc/html/ftv2node.png create mode 100644 problems/DTLZ/doc/html/ftv2plastnode.png create mode 100644 problems/DTLZ/doc/html/ftv2pnode.png create mode 100644 problems/DTLZ/doc/html/ftv2vertline.png create mode 100755 problems/DTLZ/doc/html/installdox create mode 100644 problems/DTLZ/doc/html/search.idx create mode 100644 problems/DTLZ/doc/html/search.php create mode 100644 problems/DTLZ/doc/html/tab_b.gif create mode 100644 problems/DTLZ/doc/html/tab_l.gif create mode 100644 problems/DTLZ/doc/html/tab_r.gif create mode 100644 problems/DTLZ/doc/html/tabs.css create mode 100644 problems/DTLZ/doc/index.h create mode 100644 problems/DTLZ/doc/moeo.doxyfile.cmake create mode 100644 problems/DTLZ/install.cmake create mode 100644 problems/DTLZ/run.sh create mode 100644 problems/DTLZ/src/CMakeLists.txt create mode 100644 problems/DTLZ/src/DTLZ.cpp create mode 100644 problems/DTLZ/src/DTLZ.h create mode 100644 problems/DTLZ/src/DTLZ1Eval.cpp create mode 100644 problems/DTLZ/src/DTLZ1Eval.h create mode 100644 problems/DTLZ/src/DTLZ2Eval.cpp create mode 100644 problems/DTLZ/src/DTLZ2Eval.h create mode 100644 problems/DTLZ/src/DTLZ3Eval.cpp create mode 100644 problems/DTLZ/src/DTLZ3Eval.h create mode 100644 problems/DTLZ/src/DTLZ4Eval.cpp create mode 100644 problems/DTLZ/src/DTLZ4Eval.h create mode 100644 problems/DTLZ/src/DTLZ5Eval.cpp create mode 100644 problems/DTLZ/src/DTLZ5Eval.h create mode 100644 problems/DTLZ/src/DTLZ6Eval.cpp create mode 100644 problems/DTLZ/src/DTLZ6Eval.h create mode 100644 problems/DTLZ/src/DTLZ7Eval.cpp create mode 100644 problems/DTLZ/src/DTLZ7Eval.h create mode 100644 problems/DTLZ/src/DTLZObjectiveVector.h create mode 100644 problems/DTLZ/src/PolynomialMutation.h create mode 100644 problems/DTLZ/src/SBXCrossover.h create mode 100644 problems/DTLZ/test/CMakeLists.txt create mode 100644 problems/DTLZ/test/t-DTLZ.cpp create mode 100644 problems/DTLZ/test/t-DTLZ1Eval.cpp create mode 100644 problems/DTLZ/test/t-DTLZ2Eval.cpp create mode 100644 problems/DTLZ/test/t-DTLZ3Eval.cpp create mode 100644 problems/DTLZ/test/t-DTLZ4Eval.cpp create mode 100644 problems/DTLZ/test/t-DTLZ5Eval.cpp create mode 100644 problems/DTLZ/test/t-DTLZ6Eval.cpp create mode 100644 problems/DTLZ/test/t-DTLZ7Eval.cpp diff --git a/problems/DTLZ/CMakeLists.txt b/problems/DTLZ/CMakeLists.txt new file mode 100644 index 000000000..d74bba102 --- /dev/null +++ b/problems/DTLZ/CMakeLists.txt @@ -0,0 +1,106 @@ +###################################################################################### +### 0) Set your application properties +###################################################################################### +# check cmake version compatibility +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +# Define your project name +PROJECT(DTLZ) + +SET(PACKAGE_NAME "DTLZ" CACHE STRING "Package name" FORCE) +SET(PACKAGE_VERSION "1.0" CACHE STRING "Package version" FORCE) + +# regular expression checking +INCLUDE_REGULAR_EXPRESSION("^.*$" "^$") + +# set a language for the entire project. +ENABLE_LANGUAGE(CXX) +ENABLE_LANGUAGE(C) + +###################################################################################### + +###################################################################################### +### 1) Include the install configuration file where are defined the main variables +###################################################################################### + +INCLUDE(${DTLZ_SOURCE_DIR}/install.cmake) + +###################################################################################### + +###################################################################################### +### 2) Include the sources +###################################################################################### +###################################### +### Include required modules & utilities +##################################################################################### +INCLUDE(CMakeBackwardCompatibilityCXX) + +INCLUDE(FindDoxygen) + +INCLUDE(CheckLibraryExists) + +INCLUDE(Dart OPTIONAL) + +# Set a special flag if the environment is windows (should do the same in a config.g file) +IF (WIN32) + ADD_DEFINITIONS(-D_WINDOWS=1) +ENDIF (WIN32) + +###################################################################################### + +##################################################################################### +### 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) + +FIND_PROGRAM(MEMORYCHECK_COMMAND + NAMES purify valgrind + PATHS + "/usr/local/bin /usr/bin [HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]" + DOC "Path to the memory checking command, used for memory error detection.") + +IF(NOT CMAKE_BUILD_TYPE) + SET( CMAKE_BUILD_TYPE + ${CMAKE_DEFAULT_BUILD_TYPE} CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." + FORCE) +ENDIF(NOT CMAKE_BUILD_TYPE) + +IF(WIN32 AND NOT CYGWIN) + IF(CMAKE_CXX_COMPILER MATCHES cl) + IF(NOT WITH_SHARED_LIBS) + IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008") + SET(CMAKE_CXX_FLAGS "/nologo /Gy") + SET(CMAKE_CXX_FLAGS_DEBUG "/W3 /MTd /Z7 /Od") + SET(CMAKE_CXX_FLAGS_RELEASE "/w /MT /O2 /wd4530") + 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" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008") + ENDIF(NOT WITH_SHARED_LIBS) + ENDIF(CMAKE_CXX_COMPILER MATCHES cl) +ELSE(WIN32 AND NOT CYGWIN) + IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -fprofile-arcs -ftest-coverage -Wall -Wextra -Wno-unused-parameter") + SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2") + SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -O6") + 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) + +###################################################################################### +### 3) Link the librairies for your executable +###################################################################################### + +ADD_SUBDIRECTORY(doc) +ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(test) +ADD_SUBDIRECTORY(application) + +###################################################################################### + diff --git a/problems/DTLZ/README.txt b/problems/DTLZ/README.txt new file mode 100644 index 000000000..9fc0a210d --- /dev/null +++ b/problems/DTLZ/README.txt @@ -0,0 +1,45 @@ +This package contains the source code for DTLZ problems. + +# Step 1 - Configuration +------------------------ +Edit the "install.cmake" file by entering the FULL PATH of the "ParadisEO". +On Windows write your path with double antislash (ex: C:\\Users\\...) + + +# Step 2 - Build process +------------------------ +ParadisEO is assumed to be compiled. To download ParadisEO, please visit http://paradiseo.gforge.inria.fr/. +Go to the DLTZ/build/ directory and lunch cmake: +(Unix) > cmake .. +(Windows) > cmake .. -G"Visual Studio 9 2008" + +Note for windows users: if you don't use VisualStudio 9, enter the name of your generator instead of "VisualStudio 9 2008". + + +# Step 3 - Compilation +---------------------- +In the DTLZ/build/ directory: +(Unix) > make +(Windows) Open the VisualStudio solution and compile it (Windows). +You can refer to this tutorial if you don't know how to compile a solution: http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.VisualCTutorial + + +# Step 4 - Execution +--------------------- +A toy example is given to test the components. You can run these tests as following. +To define problem-related components for your own problem, please refer to the tutorials available on the website : http://paradiseo.gforge.inria.fr/. +In the DTLZ/build/ directory: +(Unix) > ctest +Windows users, please refer to this tutorial: http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.VisualCTutorial + +In the directory "application", there are three ".cpp" which instantiate IBEA, NSGAII and SPEA2 on ZDT problems. To change of algorithms, you can compare these three files and see the few changes to do. + +(Unix) After compilation you can run the script "DTLZ/run.sh" and see results in "IBEA.out", "NSGAII.out" and "SPEA2.out". Parameters can be modified in the script. + +(Windows) Add argument "IBEA.param", "SPEA2.param" or "NSGAII.param" and execute the corresponding algorithms. +Windows users, please refer to this tutorial: http://paradiseo.gforge.inria.fr/index.php?n=Paradiseo.VisualCTutorial + +# Documentation +--------------- +The API-documentation is available in doc/html/index.html + diff --git a/problems/DTLZ/application/CMakeLists.txt b/problems/DTLZ/application/CMakeLists.txt new file mode 100644 index 000000000..a3e65fd72 --- /dev/null +++ b/problems/DTLZ/application/CMakeLists.txt @@ -0,0 +1,76 @@ +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src + ${PARADISEO_MO_SRC_DIR}/src + ${PARADISEO_MOEO_SRC_DIR}/src + ${DTLZ_SOURCE_DIR}/src) + +###################################################################################### + + +###################################################################################### +### 2) Specify where CMake can find the libraries +###################################################################################### + +LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib) +LINK_DIRECTORIES(${PARADISEO_MOEO_BIN_DIR}/lib) +LINK_DIRECTORIES(${DTLZ_BINARY_DIR}/lib) +###################################################################################### + + +###################################################################################### +### 3) Define your target: just an executable here +###################################################################################### + +ADD_EXECUTABLE(DTLZ_SPEA2 DTLZ_SPEA2.cpp) +ADD_EXECUTABLE(DTLZ_NSGAII DTLZ_NSGAII.cpp) +ADD_EXECUTABLE(DTLZ_IBEA DTLZ_IBEA.cpp) +ADD_DEPENDENCIES(DTLZ_SPEA2 lDTLZ) +ADD_DEPENDENCIES(DTLZ_NSGAII lDTLZ) +ADD_DEPENDENCIES(DTLZ_IBEA lDTLZ) + +###################################################################################### + + +###################################################################################### +### 4) Link the librairies for your executable +###################################################################################### + +# Only if you need to link libraries +TARGET_LINK_LIBRARIES(DTLZ_SPEA2 moeo eo eoutils lDTLZ) +TARGET_LINK_LIBRARIES(DTLZ_NSGAII moeo eo eoutils lDTLZ) +TARGET_LINK_LIBRARIES(DTLZ_IBEA moeo eo eoutils lDTLZ) + +###################################################################################### + + +###################################################################################### +### 5) Copy the instances and the "param" file in the build path for an easy use. +### +### --> run the "make install" target to copy the parameter file / instances +### in the directory where you build the application +###################################################################################### + +ADD_CUSTOM_TARGET(install DEPENDS ${DTLZ_SOURCE_DIR}/application/IBEA.param + ${DTLZ_SOURCE_DIR}/application/NSGAII.param + ${DTLZ_SOURCE_DIR}/application/SPEA2.param + ${DTLZ_SOURCE_DIR}/application) +ADD_CUSTOM_COMMAND( + TARGET install + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${DTLZ_SOURCE_DIR}/application/IBEA.param + ${DTLZ_BINARY_DIR}/application + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${DTLZ_SOURCE_DIR}/application/NSGAII.param + ${DTLZ_BINARY_DIR}/application + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + ${DTLZ_SOURCE_DIR}/application/SPEA2.param + ${DTLZ_BINARY_DIR}/application) + +###################################################################################### diff --git a/problems/DTLZ/application/DTLZ_IBEA.cpp b/problems/DTLZ/application/DTLZ_IBEA.cpp new file mode 100644 index 000000000..15143abbf --- /dev/null +++ b/problems/DTLZ/application/DTLZ_IBEA.cpp @@ -0,0 +1,172 @@ +// moeo general include + +#include +#include +#include +#include +// how to initialize the population +#include +// the stopping criterion +#include +// outputs (stats, population dumps, ...) +#include +// evolution engine (selection and replacement) +#include +// simple call to the algo +#include + +// checks for help demand, and writes the status file and make_help; in libutils +void make_help(eoParser & _parser); +// definition of the representation +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +int main(int argc, char* argv[]) +{ + try + { + + eoParser parser(argc, argv); // for user-parameter reading + eoState state; // to keep all things allocated + + unsigned int MAX_GEN = parser.createParam((unsigned int)(10000), "maxGen", "Maximum number of generations",'G',"Param").value(); + double P_CROSS = parser.createParam(1.0, "pCross", "Crossover probability",'C',"Param").value(); + double EXT_P_MUT = parser.createParam(1.0, "extPMut", "External Mutation probability",'E',"Param").value(); + double INT_P_MUT = parser.createParam(0.083, "intPMut", "Internal Mutation probability",'I',"Param").value(); + unsigned int VEC_SIZE = parser.createParam((unsigned int)(12), "vecSize", "Genotype Size",'V',"Param").value(); + unsigned int NB_OBJ= parser.createParam((unsigned int)(3), "nbObj", "Number of Objective",'N',"Param").value(); + std::string OUTPUT_FILE = parser.createParam(std::string("dtlz_ibea"), "outputFile", "Path of the output file",'o',"Output").value(); + unsigned int EVAL = parser.createParam((unsigned int)(1), "eval", "Number of the DTLZ evaluation fonction",'F',"Param").value(); + unsigned int DTLZ4_PARAM = parser.createParam((unsigned int)(100), "dtlz4_param", "Parameter of the DTLZ4 evaluation fonction",'P',"Param").value(); + unsigned int NB_EVAL = parser.createParam((unsigned int)(0), "nbEval", "Number of evaluation before Stop",'P',"Param").value(); + unsigned int TIME = parser.createParam((unsigned int)(0), "time", "Time(seconds) before Stop",'T',"Param").value(); + + + + /*** the representation-dependent things ***/ + std::vector bObjectives(NB_OBJ); + for (unsigned int i=0; i * eval; + + if (EVAL == 1) + eval= new DTLZ1Eval; + else if (EVAL == 2) + eval= new DTLZ2Eval; + else if (EVAL == 3) + eval= new DTLZ3Eval; + else if (EVAL == 4) + eval= new DTLZ4Eval(DTLZ4_PARAM); + else if (EVAL == 5) + eval= new DTLZ5Eval; + else if (EVAL == 6) + eval= new DTLZ6Eval; + else if (EVAL == 7) + eval= new DTLZ7Eval; + + // the genotype (through a genotype initializer) + eoRealVectorBounds bounds(VEC_SIZE, 0.0, 1.0); + + eoRealInitBounded init (bounds); + // the variation operators + SBXCrossover < DTLZ > xover(bounds, 15); + + PolynomialMutation < DTLZ > mutation (bounds, INT_P_MUT, 20); + + /*** the representation-independent things ***/ + + // initialization of the population + + // definition of the archive + // stopping criteria + + eoGenContinue term(MAX_GEN); + + eoEvalFuncCounter evalFunc(*eval); + + /*eoTimeContinue timeContinuator(TIME); + eoCheckPoint checkpoint(timeContinuator);*/ + + eoCheckPoint* checkpoint; + + if (TIME > 0) + checkpoint = new eoCheckPoint(*(new eoTimeContinue(TIME))); + else if (NB_EVAL > 0) + checkpoint = new eoCheckPoint(*(new eoEvalContinue(evalFunc, NB_EVAL))); + else { + cout << "ERROR!!! : TIME or NB_EVAL must be > 0 : used option --time or --nbEval\n"; + return EXIT_FAILURE; + } + + checkpoint->add(term); + + /*moeoArchiveObjectiveVectorSavingUpdater < DTLZ > updater(arch, OUTPUT_FILE); + checkpoint->add(updater);*/ + + // algorithm + + eoSGAGenOp < DTLZ > op(xover, P_CROSS, mutation, EXT_P_MUT); + + /* moeoArchiveUpdater < DTLZ > up(arch, pop); + checkpoint.add(up);*/ + + //moeoNSGAII algo(*checkpoint, *eval ,op); + + moeoAdditiveEpsilonBinaryMetric < DTLZObjectiveVector > metric; + moeoIBEA algo(*checkpoint, evalFunc ,op, metric); + + + /*** Go ! ***/ + + // help ? + + + eoPop& pop = do_make_pop(parser, state, init); + + make_help(parser); + + // run the algo + do_run(algo, pop); + + moeoUnboundedArchive finalArchive; + finalArchive(pop); + + // printing of the final population + //cout << "Final Archive \n"; + //finalArchive.sortedPrintOn(outfile); + + ofstream outfile(OUTPUT_FILE.c_str(), ios::app); + if ((unsigned int)outfile.tellp() != 0) + outfile << endl; + + for (unsigned int i=0 ; i < finalArchive.size(); i++) { + for (unsigned int j=0 ; j +#include +#include +#include +// how to initialize the population +#include +// the stopping criterion +#include +// outputs (stats, population dumps, ...) +#include +// evolution engine (selection and replacement) +#include +// simple call to the algo +#include + +// checks for help demand, and writes the status file and make_help; in libutils +void make_help(eoParser & _parser); +// definition of the representation +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +int main(int argc, char* argv[]) +{ + try + { + + eoParser parser(argc, argv); // for user-parameter reading + eoState state; // to keep all things allocated + + unsigned int MAX_GEN = parser.createParam((unsigned int)(10000), "maxGen", "Maximum number of generations",'G',"Param").value(); + double P_CROSS = parser.createParam(1.0, "pCross", "Crossover probability",'C',"Param").value(); + double EXT_P_MUT = parser.createParam(1.0, "extPMut", "External Mutation probability",'E',"Param").value(); + double INT_P_MUT = parser.createParam(0.083, "intPMut", "Internal Mutation probability",'I',"Param").value(); + unsigned int VEC_SIZE = parser.createParam((unsigned int)(12), "vecSize", "Genotype Size",'V',"Param").value(); + unsigned int NB_OBJ= parser.createParam((unsigned int)(3), "nbObj", "Number of Objective",'N',"Param").value(); + std::string OUTPUT_FILE = parser.createParam(std::string("dtlz_nsgaII"), "outputFile", "Path of the output file",'o',"Output").value(); + unsigned int EVAL = parser.createParam((unsigned int)(1), "eval", "Number of the DTLZ evaluation fonction",'F',"Param").value(); + unsigned int DTLZ4_PARAM = parser.createParam((unsigned int)(100), "dtlz4_param", "Parameter of the DTLZ4 evaluation fonction",'P',"Param").value(); + unsigned int NB_EVAL = parser.createParam((unsigned int)(0), "nbEval", "Number of evaluation before Stop",'P',"Param").value(); + unsigned int TIME = parser.createParam((unsigned int)(0), "time", "Time(seconds) before Stop",'T',"Param").value(); + + /*** the representation-dependent things ***/ + std::vector bObjectives(NB_OBJ); + for (unsigned int i=0; i * eval; + + if (EVAL == 1) + eval= new DTLZ1Eval; + else if (EVAL == 2) + eval= new DTLZ2Eval; + else if (EVAL == 3) + eval= new DTLZ3Eval; + else if (EVAL == 4) + eval= new DTLZ4Eval(DTLZ4_PARAM); + else if (EVAL == 5) + eval= new DTLZ5Eval; + else if (EVAL == 6) + eval= new DTLZ6Eval; + else if (EVAL == 7) + eval= new DTLZ7Eval; + + // the genotype (through a genotype initializer) + eoRealVectorBounds bounds(VEC_SIZE, 0.0, 1.0); + + eoRealInitBounded init (bounds); + // the variation operators + SBXCrossover < DTLZ > xover(bounds, 15); + + PolynomialMutation < DTLZ > mutation (bounds, INT_P_MUT, 20); + + /*** the representation-independent things ***/ + + // initialization of the population + + // definition of the archive + // stopping criteria + + eoGenContinue term(MAX_GEN); + + eoEvalFuncCounter evalFunc(*eval); + + /*eoTimeContinue timeContinuator(TIME); + eoCheckPoint checkpoint(timeContinuator);*/ + + eoCheckPoint* checkpoint; + + if (TIME > 0) + checkpoint = new eoCheckPoint(*(new eoTimeContinue(TIME))); + else if (NB_EVAL > 0) + checkpoint = new eoCheckPoint(*(new eoEvalContinue(evalFunc, NB_EVAL))); + else { + cout << "ERROR!!! : TIME or NB_EVAL must be > 0 : used option --time or --nbEval\n"; + return EXIT_FAILURE; + } + + checkpoint->add(term); + + /*moeoArchiveObjectiveVectorSavingUpdater < DTLZ > updater(arch, OUTPUT_FILE); + checkpoint->add(updater);*/ + + // algorithm + + eoSGAGenOp < DTLZ > op(xover, P_CROSS, mutation, EXT_P_MUT); + + /* moeoArchiveUpdater < DTLZ > up(arch, pop); + checkpoint.add(up);*/ + + moeoNSGAII algo(*checkpoint, evalFunc ,op); + + /*moeoAdditiveEpsilonBinaryMetric < DTLZObjectiveVector > metric; + moeoIBEA algo(checkpoint, eval ,op, metric);*/ + + + /*** Go ! ***/ + + // help ? + + + eoPop& pop = do_make_pop(parser, state, init); + + make_help(parser); + // run the algo + do_run(algo, pop); + + moeoUnboundedArchive finalArchive; + finalArchive(pop); + + // printing of the final population + //cout << "Final Archive \n"; + //finalArchive.sortedPrintOn(outfile); + + ofstream outfile(OUTPUT_FILE.c_str(), ios::app); + if ((unsigned int)outfile.tellp() != 0) + outfile << endl; + + for (unsigned int i=0 ; i < finalArchive.size(); i++) { + for (unsigned int j=0 ; j +#include +#include +#include +// how to initialize the population +#include +// the stopping criterion +#include +// outputs (stats, population dumps, ...) +#include +// evolution engine (selection and replacement) +#include +// simple call to the algo +#include + +#include +#include + +// checks for help demand, and writes the status file and make_help; in libutils +void make_help(eoParser & _parser); +// definition of the representation +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +int main(int argc, char* argv[]) +{ + try + { + + eoParser parser(argc, argv); // for user-parameter reading + eoState state; // to keep all things allocated + + unsigned int ARC_SIZE = parser.createParam((unsigned int)(100), "arcSize", "Archive size",'A',"Param").value(); + unsigned int MAX_GEN = parser.createParam((unsigned int)(10000), "maxGen", "Maximum number of generations",'G',"Param").value(); + double P_CROSS = parser.createParam(1.0, "pCross", "Crossover probability",'C',"Param").value(); + double EXT_P_MUT = parser.createParam(1.0, "extPMut", "External Mutation probability",'E',"Param").value(); + double INT_P_MUT = parser.createParam(0.083, "intPMut", "Internal Mutation probability",'I',"Param").value(); + unsigned int VEC_SIZE = parser.createParam((unsigned int)(12), "vecSize", "Genotype Size",'V',"Param").value(); + unsigned int NB_OBJ= parser.createParam((unsigned int)(3), "nbObj", "Number of Objective",'N',"Param").value(); + unsigned int K = parser.createParam((unsigned int)(10), "k", "k-th nearest neighbor",'K',"Param").value(); + std::string OUTPUT_FILE = parser.createParam(std::string("dtlz_spea2"), "outputFile", "Path of the output file",'o',"Output").value(); + unsigned int EVAL = parser.createParam((unsigned int)(1), "eval", "Number of the DTLZ evaluation fonction",'F',"Param").value(); + unsigned int DTLZ4_PARAM = parser.createParam((unsigned int)(100), "dtlz4_param", "Parameter of the DTLZ4 evaluation fonction",'P',"Param").value(); + unsigned int NB_EVAL = parser.createParam((unsigned int)(0), "nbEval", "Number of evaluation before Stop",'P',"Param").value(); + unsigned int TIME = parser.createParam((unsigned int)(0), "time", "Time(seconds) before Stop",'T',"Param").value(); + + /*cout << "ARC_SIZE : " << ARC_SIZE << endl; + cout << "P_CROSS : " << P_CROSS << endl; + cout << "EXT_P_MUT : " << EXT_P_MUT << endl; + cout << "INT_P_MUT : " << INT_P_MUT << endl; + cout << "VEC_SIZE : " << VEC_SIZE << endl; + cout << "NB_OBJ : " << NB_OBJ << endl; + cout << "K : " << K << endl; + cout << "DTLZ EVAL :" << EVAL << endl; + cout << "DTLZ4_PARAM : " << DTLZ4_PARAM << endl; + cout << "NB_EVAL : " << NB_EVAL << endl; + cout << "TIME : " << TIME << endl; */ + + + /*** the representation-dependent things ***/ + std::vector bObjectives(NB_OBJ); + for (unsigned int i=0; i * eval; + + if (EVAL == 1) + eval= new DTLZ1Eval; + else if (EVAL == 2) + eval= new DTLZ2Eval; + else if (EVAL == 3) + eval= new DTLZ3Eval; + else if (EVAL == 4) + eval= new DTLZ4Eval(DTLZ4_PARAM); + else if (EVAL == 5) + eval= new DTLZ5Eval; + else if (EVAL == 6) + eval= new DTLZ6Eval; + else if (EVAL == 7) + eval= new DTLZ7Eval; + + // the genotype (through a genotype initializer) + eoRealVectorBounds bounds(VEC_SIZE, 0.0, 1.0); + + eoRealInitBounded init (bounds); + // the variation operators + SBXCrossover < DTLZ > xover(bounds, 20); + + PolynomialMutation < DTLZ > mutation (bounds, INT_P_MUT, 20); + + /*** the representation-independent things ***/ + + // initialization of the population + + // definition of the archive + moeoSPEA2Archive arch(ARC_SIZE); + //moeoUnboundedArchive arch; + // stopping criteria + + eoGenContinue term(MAX_GEN); + + eoEvalFuncCounter evalFunc(*eval); + + /*eoTimeContinue timeContinuator(TIME); + eoCheckPoint checkpoint(timeContinuator);*/ + + eoCheckPoint* checkpoint; + + if (TIME > 0) + checkpoint = new eoCheckPoint(*(new eoTimeContinue(TIME))); + else if (NB_EVAL > 0) + checkpoint = new eoCheckPoint(*(new eoEvalContinue(evalFunc, NB_EVAL))); + else { + cout << "ERROR!!! : TIME or NB_EVAL must be > 0 : used option --time or --nbEval\n"; + return EXIT_FAILURE; + } + + checkpoint->add(term); + + /*moeoArchiveObjectiveVectorSavingUpdater < DTLZ > updater(arch, OUTPUT_FILE); + checkpoint->add(updater);*/ + + // algorithm + + moeoSPEA2 algo(*checkpoint, evalFunc ,xover, P_CROSS, mutation, EXT_P_MUT, arch, K, false); + /* eoSGAGenOp < DTLZ > op(xover, 1.0, mutation, 1/12); + + moeoArchiveUpdater < DTLZ > up(arch, pop); + checkpoint.add(up); + + moeoNSGAII algo(checkpoint, eval ,op); + + /*moeoAdditiveEpsilonBinaryMetric < DTLZObjectiveVector > metric; + moeoIBEA algo(checkpoint, eval ,op, metric);*/ + + + /*** Go ! ***/ + + // help ? + + eoPop& pop = do_make_pop(parser, state, init); + // run the algo + make_help(parser); + + do_run(algo, pop); + + moeoUnboundedArchive finalArchive; + finalArchive(arch); + + + // printing of the final population + //cout << "Final Archive \n"; + //finalArchive.sortedPrintOn(outfile); + + ofstream outfile(OUTPUT_FILE.c_str(), ios::app); + if ((unsigned int)outfile.tellp() != 0) + outfile << endl; + + for (unsigned int i=0 ; i < finalArchive.size(); i++) { + for (unsigned int j=0 ; j h3 { + margin-top: 0; +} +.directory p { + margin: 0px; + white-space: nowrap; +} +.directory div { + display: none; + margin: 0px; +} +.directory img { + vertical-align: -30%; +} + diff --git a/problems/DTLZ/doc/html/doxygen.png b/problems/DTLZ/doc/html/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..f0a274bbaffdd67f6d784c894d9cf28729db0e14 GIT binary patch literal 1281 zcmaJ>ZA?>F7(Vx-ms?uoS`b@hdRtpo6o^%HU>M$hfGrBvQnk$LE?p^P!kn&ikhyq! zX~V@&tPF5Qt@V?oTL96Bi%aRiwbe1)9DWQI#?)=HxS7QSw`J`5fAJ*eJbB;uNuKA& zdERDo*{Y<(If(#(B$Lr#;nB(8Y#ia=ZCeW?JfPLuQY`=@cW$k}Rivq|vbxGrRq1Tl9;+(gNt?}UtVKM2`T5t1jLzuL@0UIs`S#vlhl4)^ zLgSYrPj@$+`|j?eSbXTmiHGkWxV8V}BzNR?pl9k_s4pDu9vd5a_UzZEPk)}Ad{AV_ zzddrjrh4=Imr`E06;LY{)YYt?o}L~H@7C}F^WB!Ra=v`Q0bj{>5&$66CWF>mf6vjP z2N>RRY6ZYa=K`76>+|_)Xdwko+7wv}7cN|btOhWb(*{sta~6b?S8Omrxw}!4`NhGr zZVpNqpu1@BE`QGWNTpEpcJVW5izu~2B^GlM?1(OPg)zwW;QcP@Ltcclm>XbJL9C|j z=9!2?ua=uIlf0%AndzHsRC}IyTL$EhAee(fdKB`?27KeS^2M8M_7b~PiCFO&r5LC7 z7gl1*a<8;SjNaw#h=843_AV9iZbWQOAp5YOC^&_F*9K0> zB|6%IDb?aM#3viTxkLU4aXg&@+CkNTOnQ1iMP*^?b|^lJy$4C)Zk4isV!|RZ*XhXh zw8q3$=*0LeGC!XI_Wc?dkT~3+*Gu%%yIqP+Wr3H$=&ROMQU6q}Ag^P~>c5vAEO;a- z_dK-3PPeKar%)6$j~vI2#*-YH!1h6HYVtwCX5_wM`iF#UKz&&@9Oo5w3%XGYrX zW>dY~)SG-((Yim%`InwgTvyRC?e=Wh^8KCao!R6Eg&TpVWUY1sN~4G}V?nFnEGo-; zHZ_$eW9-GnC%^WS9b z@p;-$oH#MtC0v>Q$HX%4^JdFdO$0cbv-W)Q TtK}Eh@>>I#ipmV1>S*>q-hkC} literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2blank.png b/problems/DTLZ/doc/html/ftv2blank.png new file mode 100644 index 0000000000000000000000000000000000000000..493c3c0b615ade5b22027bde773faf2c0e076d66 GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr2qYM%T@!Q%(o7{me!&ckj8p!u14)&*MwA5S zr6z#mEsk^N1FBF3sc_EE%}vcKVF=AhO-xa6_jFST&P^;T z2~I3aEm8;rVk12R#UIz>f`J-DJY5_^DsClP9B62eH+WF*G=YJMp~A-KbWwke5Kx}M M)78&qol`;+0EL(^EC2ui literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2doc.png b/problems/DTLZ/doc/html/ftv2doc.png new file mode 100644 index 0000000000000000000000000000000000000000..f72999f92172cca6edaa2538286b3e369bec9f49 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^5yjnX4egh%q=bp-`Pe zR7&bp17l3gfhmh7Fm(iZ2eAfco|q!h5)>qKG?UBh!IC9QGMbJAHf6IEiufk_g|d7~ qkWqJ4k(|I-Aeo-5U~n{Fnc?dN!3Uwu?t6hQVDNPHb6Mw<&;$TLIZ`G7 literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2folderclosed.png b/problems/DTLZ/doc/html/ftv2folderclosed.png new file mode 100644 index 0000000000000000000000000000000000000000..d6d063440cbf13c4128dacd96661b6fce58abf26 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^55uo^`BphW;jCHO69?}tw{JfcdnZ<*@N=4I z?xF5Qc|QYEmKAIZ;JRGVHe=bn*tx1_|J^^vyg*oVM#A1kZlFULJYD@<);T3K0RTgB BWg7qh literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2folderopen.png b/problems/DTLZ/doc/html/ftv2folderopen.png new file mode 100644 index 0000000000000000000000000000000000000000..bbe2c913cf493ee37ad8e3a5132382138d93ac92 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^5u(C zYP)Mg%H-DB+{J~>rPn_#pYTax?r*V6ubqGX{lvROQ{?n5_cbm+cQAOm`njxgN@xNA D92;js literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2lastnode.png b/problems/DTLZ/doc/html/ftv2lastnode.png new file mode 100644 index 0000000000000000000000000000000000000000..e7b9ba90cb0cf71c8ce662956bfee7d64cf60fa6 GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!py+H=+kU?6UZ?L@CkAK|NlRbNhD}!Xpp$P zU;Pg)ksC(lf|p%(p+w2Gk+!>EaktaVt4N i!r*{E4>QXNV>t$uAA#a^n)TVt_DW*G8-srQl%FeIsRSdYm zeDdtWec}u&7@8h5rqv#p7g*pRdwwmugmlS-+cHV~j}#7`Nwj9m+AU)JGGo`8z_}`K z?s#Xsy%Z;1_jl5Y+?Gum8WyK6`MBvup0SAOKJ)mWcHyteJ?WLL>>-)=?&<$H&t5oH Vd!azZ1yDdSc)I$ztaD0e0sw}(dc*(# literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2mlastnode.png b/problems/DTLZ/doc/html/ftv2mlastnode.png new file mode 100644 index 0000000000000000000000000000000000000000..09ceb6adb01054ce799ad20c0e818ab9272f2df2 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr#LU3Jc=+&fg$isFPOjJ*AaIJQGm()YSDb0rfjgNefXW#>UHx3vIVCg! E0ORy6RsaA1 literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2mnode.png b/problems/DTLZ/doc/html/ftv2mnode.png new file mode 100644 index 0000000000000000000000000000000000000000..3254c05112199fbc80aad313611c58a5b388792d GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!py+H=+kU?6Ub2s@Ck7}aNq!ti3c<^Gz9OH zn+a6GSQ6wH%;50sMjDVKR^l2_5}cn_Ql40p%8;I!W>k=uu3)5RqGz-?&YcgaLd(;| zF{I*Fa>4?=2W(CyOv{5p*uLi}G<-ambjQcb>&~4!CzK3KXWY6d$*{eWU47N}X+XCz OFnGH9xvXPg)ksC(lf|p%(p+w2Gk+y>EaktaVt4N l!r*{E4>Lv;t literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2plastnode.png b/problems/DTLZ/doc/html/ftv2plastnode.png new file mode 100644 index 0000000000000000000000000000000000000000..0b07e00913d8069ebbb51bd7fd6d70d8bba88f75 GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr#LU3Jc=+&MJ literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2pnode.png b/problems/DTLZ/doc/html/ftv2pnode.png new file mode 100644 index 0000000000000000000000000000000000000000..2001b797ba2b98a4127f1d3efca64aef08bf6d51 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!py+H=+kU?6Ub2s@Ck7}aNq!ti3c<^Gz9OH zn+a6GSQ6wH%;50sMjDVKR^l2_5}cn_Ql40p%8;I!W>k=uu3)5RqGz-?&Ycga!obtT zF{I*Fa>4?=2W(Dkd1@Anj~<0|oqBMOmqox%*rjK-r)THv+0v0L%h-agt(X~hWwYzA SIxU|Ma*U^|pUXO@geCywmoZiV literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/ftv2vertline.png b/problems/DTLZ/doc/html/ftv2vertline.png new file mode 100644 index 0000000000000000000000000000000000000000..b330f3a33c0085c183ff39fc56b1b274160c1da0 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!py+H=+kU?6UZ?L@CkAK|NlRbNhD}!Xpp$P zU;Pg)ksC(lf|p%(p+w2Gqgt>EaktaVt4N e!r*{^G#i7W2*a|cHZQDzQVgE1elF{r5}E+)J2fZ( literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/installdox b/problems/DTLZ/doc/html/installdox new file mode 100755 index 000000000..1628445b3 --- /dev/null +++ b/problems/DTLZ/doc/html/installdox @@ -0,0 +1,117 @@ +#!/usr/bin/perl + +%subst = ( "eo.doxytag", ""); +$quiet = 0; + +if (open(F,"search.cfg")) +{ + $_= ; s/[ \t\n]*$//g ; $subst{"_doc"} = $_; + $_= ; s/[ \t\n]*$//g ; $subst{"_cgi"} = $_; +} + +while ( @ARGV ) { + $_ = shift @ARGV; + if ( s/^-// ) { + if ( /^l(.*)/ ) { + $v = ($1 eq "") ? shift @ARGV : $1; + ($v =~ /\/$/) || ($v .= "/"); + $_ = $v; + if ( /(.+)\@(.+)/ ) { + if ( exists $subst{$1} ) { + $subst{$1} = $2; + } else { + print STDERR "Unknown tag file $1 given with option -l\n"; + &usage(); + } + } else { + print STDERR "Argument $_ is invalid for option -l\n"; + &usage(); + } + } + elsif ( /^q/ ) { + $quiet = 1; + } + elsif ( /^\?|^h/ ) { + &usage(); + } + else { + print STDERR "Illegal option -$_\n"; + &usage(); + } + } + else { + push (@files, $_ ); + } +} + +foreach $sub (keys %subst) +{ + if ( $subst{$sub} eq "" ) + { + print STDERR "No substitute given for tag file `$sub'\n"; + &usage(); + } + elsif ( ! $quiet && $sub ne "_doc" && $sub ne "_cgi" ) + { + print "Substituting $subst{$sub} for each occurence of tag file $sub\n"; + } +} + +if ( ! @files ) { + if (opendir(D,".")) { + foreach $file ( readdir(D) ) { + $match = ".html"; + next if ( $file =~ /^\.\.?$/ ); + ($file =~ /$match/) && (push @files, $file); + ($file =~ "tree.js") && (push @files, $file); + } + closedir(D); + } +} + +if ( ! @files ) { + print STDERR "Warning: No input files given and none found!\n"; +} + +foreach $f (@files) +{ + if ( ! $quiet ) { + print "Editing: $f...\n"; + } + $oldf = $f; + $f .= ".bak"; + unless (rename $oldf,$f) { + print STDERR "Error: cannot rename file $oldf\n"; + exit 1; + } + if (open(F,"<$f")) { + unless (open(G,">$oldf")) { + print STDERR "Error: opening file $oldf for writing\n"; + exit 1; + } + if ($oldf ne "tree.js") { + while () { + s/doxygen\=\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\" (href|src)=\"\2/doxygen\=\"$1:$subst{$1}\" \3=\"$subst{$1}/g; + print G "$_"; + } + } + else { + while () { + s/\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\", \"\2/\"$1:$subst{$1}\" ,\"$subst{$1}/g; + print G "$_"; + } + } + } + else { + print STDERR "Warning file $f does not exist\n"; + } + unlink $f; +} + +sub usage { + print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n"; + print STDERR "Options:\n"; + print STDERR " -l tagfile\@linkName tag file + URL or directory \n"; + print STDERR " -q Quiet mode\n\n"; + exit 1; +} diff --git a/problems/DTLZ/doc/html/search.idx b/problems/DTLZ/doc/html/search.idx new file mode 100644 index 0000000000000000000000000000000000000000..e4dd70968047dfc6edba245373b45af20a44e919 GIT binary patch literal 279856 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

sT}j04`v z(jBpHD1C>@q@MvAf#0f|b#&jnvUS>bxFO5kzB8&pyBFo$PmxyL54e_cy`d46n#aw@ z_5NXVlk<(m>34IL_fr9c7?xz=+fM~NBOia>l? znI$_yS0S$_*>Q@=hiNvi_#nw?pHj`Jwzo*bgumN(;muSW+mzIs+s zgQ~op@zv{!ew~pcMfQBF8rsb~dqK78yhLR$s+LU4>}3jNm&^@tO!^@=)S@2cUtw}1 zoXC-Jim-DoulSV6h2##I^)9!h2s{39B-b?ZoZ*x@7Rg6>?gd4?&&MNfK<*WFJSa41 zv*wG}D9+0X_ipYDb=(-`-d4v$Ii=(-s%0LVeEYIm<`+y1s}ua0H8G}6|OnB%63OAW}TRjFSjoKq=HZJw!yp%5STPRL#njvhd8~r4~;p{g} zD0#U2_&wUh`+2!^_Uir4cH^6@YwSXGxzGB}|1_0F@45eTsk#iBGl7!u5(7UgC8Dx-llDO?#@vvjW_2GbR_nt=vvxEp|p!aX%~gk zE()bx+*h%CzrL|^PV)0ujPu)c8Gq|cx*M(l=h0>=qR%Kn}cgKd^^EJ7*#kQY9@x6_n z`vKb~=C*IT;&%KPtFzz$AF7A^0n?9ucZjXD(q)VT&5x3v2 zu`<>rk1qUy%07JFTP4 z#hH(pvb)~N`Ke7Zhv<1Z)_TbN%_rzx)nbWq9?U-5d`GZHy^BvfGN_(qaG`S&)? zeVvhba>k^0&+Sd}%Gt=4^AKCbHV-86Lu_EvCu&K2`nySd=AV-I_qBG%>ky4E8J84F zpYwW0HsaT96z@NYWB0gT`Chy~cR$yC29N95op8gmazN0nQ!qo36D>X^O&GA<+=DgGel_=m-#^Jp44Zj?OO_^Zz+^Ditfvr zL!qo46w3UjQ06Ixa-QPzWNgyQi}rLo{r0v+&cK&ELrs>(qubOsD{hJAA z?Ot==edhYXlO}wa{xcM}_uwx`C?;;K$Mx$Tt4ZDI*^ae$<$Lk@l%DJ8SGO*@{qozU zZt)r(uf=XZJa6ucr=82L?&YPrRy8V?bvngpmZ6poK9`%*Wd9OWi|btZb!PDu6U2Sr1OZOJ=>+zSN;C9JAGfe z-x6Yr^nD&jeZEoUd~ECL;ygF_w+9}#FPm`H=aqQutTZ2b-Q%&q-^g@N)(8q^Oj9Uh znnD@V6v`Swp^Ry+dt4^hxBZNh%vJlnBi8A@>Cp#Wd3wwn$;0y@_D;XEU;Yo1PHRD1 zUr@U{`@%Wdy)*Wbb55rljTJfD*>>A+prjq0b?p4@g2z(t-(})&LeqbgZ`Es3+<#P8 z=|2i(y-D|NuX|KR*IE?!N4g!hZ=~KFU+K9k^rQWLkuz+3E}r(xJLBKu;`6vWd+sv# z?O9T(k9d8z{Ud$q;;}Kcz1JMEY4VKNTfcPNe!C>|tyiCrzx0Wn8}9o*UQ=j1$(q9F z2L9cWL;Jg>e6!HCj9dDBQ^qOJ+xS_!C(qJa-u5hA%d;HvHyDNTZ2J7byl!w;xV+=rA$)~aEc-RpRv$${i8nk(BqxTv2!n; z-%70|BmSnKK9KJg?hF2wpisV3DD0TqTE2%U{Q!TXP$=I)H&UF(#}9gzOS|+M*HoUg zfySkbBMPPO_&3M+Ua#lk`H>4D_G;ZA99KUC~ErUWSV}#0}_qcrI8ULo8-uK;a zUFp2!9FJc+FO#wMCcT&DL%-j_?3pncOL6^rjhpx$wMTp?l)BsXRLZt-X?J>kUTvJm z44)A`X~#0vL(akEF7t)bWxh}-dmx1}KPZ&>L7}wilO3LEFN({V(XL+--(>RloEMaT z#r9mG&C+LF7LDQfw*+YmwN2VW;T6yH@v~#rA!DE2XP?bk2f7vqx-Sm%R4%=LYPSie z@0Tz+3-qYF^dpaXdd~J~a>njw5swXe#_ls_Y}kHJdplzqm#bYnr5^NdcP`>_&DZ94 zqGavt{C#d+QbxQU$Ipm8jjOhGm#^(R+Rmc!ezTf!oIZ!9^Y^fpKH_~U?Mi*!v6i~u zG3|Wo_nUpPPW9@CxR0of(nl1!`TJ3xSIADrJ^jWkbD7o+8UJ)GeL$g%e+tE%LK(vp ziqCDv$9+?#t*#XBG+)UezSqkxE{Eqa-Ip;u=hmpC|I+_`DqS|mx6;#B-=e9oz1w%TC8TpNoCcd3wa% zUPfb2#(4LCQ)ydkq%LWvUSpTaPLGZB9@({S+kWU;595AVsqgvOIA5Q7xcX9^WX z%+hgszvQ8_h1^f~Gqt{3u@u-E+Q zjmhk?w$;t0c0Dj!&SWx^6Dn0^5?{zKwY~fZ{Y8gVmi`8}K61qT9oZv~(_c)6Ra5+9 zL8U-{al~)CNLrh?L zI=PbjtD0(x>S_nZ!lMsAazN_I?_ZG1?)tg1=jL2g;H1Q^{OK8(ynB@syT=$AotP-* zr~J~)j6dn+r!tdyZ#F+u$Yy9BWJ;M?JFo;$YLoz`NVw+x?UK2&@aZRh>cFFqCKa~{ zUCm4c+QzIC>UzMqOv`ijUq*eJ|Gtr*=#x2{o*yze+RFM+SgwNU-gIwD#73uPCo|L2 z*-|hYOk|4LQm!|JaQnHa+K??h9-=5fwF_DeWB(` z+xxxNE_tRmO{zgbwv?Zko%E-sgIso&R@CW<$=qzIFjJh&<}yLHt7n{wS&yf3Q<-d` z;AgUVe`10*z!@)?p33DXrgKwMKK%(k*YffBpFnq%?h-y9^DOh<149mYCK$V<#Ww$tF3cP2u8EnT#=4%6G0(6 zH90ez@e9+XLe?)%6@uB^L?&Yozp_l4b8zqeHUq;P;jBn|8(ozWk`Cka5+bkYKbUQ4 z9S1aN*41jUF-ngAw&Qvo|D`s`^jM);xwh#eSKXY+$Tcr^-Ii)KYs%yOjZ9fG;Z4US zg{Q8&i|1F%r-a)Y<*Ii^d1o8Bt6A3rrhm<1B~592u170Jixb7!ATu>FRVbEHE0Uh^@{0bWS#F!dTWYnG*I%u+o9UIbU9MMXd!o?M(dlL- + +Search + + + + +

+
    +
  • Main Page
  • +
  • Related Pages
  • +
  • Classes
  • +
  • Files
  • +
  • +
    + + + + +1 document matching your query."; + } + else // $num>1 + { + return "Found $num documents matching your query. Showing best matches first."; + } +} + +function report_matches() +{ + return "Matches: "; +} +function end_form($value) +{ + echo " \n \n
    \n
    \n
  • \n
\n
\n"; +} + +function readInt($file) +{ + $b1 = ord(fgetc($file)); $b2 = ord(fgetc($file)); + $b3 = ord(fgetc($file)); $b4 = ord(fgetc($file)); + return ($b1<<24)|($b2<<16)|($b3<<8)|$b4; +} + +function readString($file) +{ + $result=""; + while (ord($c=fgetc($file))) $result.=$c; + return $result; +} + +function readHeader($file) +{ + $header =fgetc($file); $header.=fgetc($file); + $header.=fgetc($file); $header.=fgetc($file); + return $header; +} + +function computeIndex($word) +{ + // Fast string hashing + //$lword = strtolower($word); + //$l = strlen($lword); + //for ($i=0;$i<$l;$i++) + //{ + // $c = ord($lword{$i}); + // $v = (($v & 0xfc00) ^ ($v << 6) ^ $c) & 0xffff; + //} + //return $v; + + // Simple hashing that allows for substring search + if (strlen($word)<2) return -1; + // high char of the index + $hi = ord($word{0}); + if ($hi==0) return -1; + // low char of the index + $lo = ord($word{1}); + if ($lo==0) return -1; + // return index + return $hi*256+$lo; +} + +function search($file,$word,&$statsList) +{ + $index = computeIndex($word); + if ($index!=-1) // found a valid index + { + fseek($file,$index*4+4); // 4 bytes per entry, skip header + $index = readInt($file); + if ($index) // found words matching the hash key + { + $start=sizeof($statsList); + $count=$start; + fseek($file,$index); + $w = readString($file); + while ($w) + { + $statIdx = readInt($file); + if ($word==substr($w,0,strlen($word))) + { // found word that matches (as substring) + $statsList[$count++]=array( + "word"=>$word, + "match"=>$w, + "index"=>$statIdx, + "full"=>strlen($w)==strlen($word), + "docs"=>array() + ); + } + $w = readString($file); + } + $totalHi=0; + $totalFreqHi=0; + $totalFreqLo=0; + for ($count=$start;$count $idx, + "freq" => $freq>>1, + "rank" => 0.0, + "hi" => $freq&1 + ); + if ($freq&1) // word occurs in high priority doc + { + $totalHi++; + $totalFreqHi+=$freq*$multiplier; + } + else // word occurs in low priority doc + { + $totalFreqLo+=$freq*$multiplier; + } + } + // read name and url info for the doc + for ($i=0;$i<$numDocs;$i++) + { + fseek($file,$docInfo[$i]["idx"]); + $docInfo[$i]["name"]=readString($file); + $docInfo[$i]["url"]=readString($file); + } + $statInfo["docs"]=$docInfo; + } + $totalFreq=($totalHi+1)*$totalFreqLo + $totalFreqHi; + for ($count=$start;$count$key, + "name"=>$di["name"], + "rank"=>$rank + ); + } + $docs[$key]["words"][] = array( + "word"=>$wordInfo["word"], + "match"=>$wordInfo["match"], + "freq"=>$di["freq"] + ); + } + } + return $docs; +} + +function filter_results($docs,&$requiredWords,&$forbiddenWords) +{ + $filteredDocs=array(); + while (list ($key, $val) = each ($docs)) + { + $words = &$docs[$key]["words"]; + $copy=1; // copy entry by default + if (sizeof($requiredWords)>0) + { + foreach ($requiredWords as $reqWord) + { + $found=0; + foreach ($words as $wordInfo) + { + $found = $wordInfo["word"]==$reqWord; + if ($found) break; + } + if (!$found) + { + $copy=0; // document contains none of the required words + break; + } + } + } + if (sizeof($forbiddenWords)>0) + { + foreach ($words as $wordInfo) + { + if (in_array($wordInfo["word"],$forbiddenWords)) + { + $copy=0; // document contains a forbidden word + break; + } + } + } + if ($copy) $filteredDocs[$key]=$docs[$key]; + } + return $filteredDocs; +} + +function compare_rank($a,$b) +{ + if ($a["rank"] == $b["rank"]) + { + return 0; + } + return ($a["rank"]>$b["rank"]) ? -1 : 1; +} + +function sort_results($docs,&$sorted) +{ + $sorted = $docs; + usort($sorted,"compare_rank"); + return $sorted; +} + +function report_results(&$docs) +{ + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + $numDocs = sizeof($docs); + if ($numDocs==0) + { + echo " \n"; + echo " \n"; + echo " \n"; + } + else + { + echo " \n"; + echo " \n"; + echo " \n"; + $num=1; + foreach ($docs as $doc) + { + echo " \n"; + echo " "; + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + $num++; + } + } + echo "

".search_results()."

".matches_text(0)."
".matches_text($numDocs); + echo "\n"; + echo "
$num.".$doc["name"]."
".report_matches()." "; + foreach ($doc["words"] as $wordInfo) + { + $word = $wordInfo["word"]; + $matchRight = substr($wordInfo["match"],strlen($word)); + echo "$word$matchRight(".$wordInfo["freq"].") "; + } + echo "
\n"; +} + +function main() +{ + if(strcmp('4.1.0', phpversion()) > 0) + { + die("Error: PHP version 4.1.0 or above required!"); + } + if (!($file=fopen("search.idx","rb"))) + { + die("Error: Search index file could NOT be opened!"); + } + if (readHeader($file)!="DOXS") + { + die("Error: Header of index file is invalid!"); + } + $query=""; + if (array_key_exists("query", $_GET)) + { + $query=$_GET["query"]; + } + end_form(ereg_replace("[^[:alnum:]:\\.\\t ]", " ", $query )); + echo " \n
\n"; + $results = array(); + $requiredWords = array(); + $forbiddenWords = array(); + $foundWords = array(); + $word=strtok($query," "); + while ($word) // for each word in the search query + { + if (($word{0}=='+')) { $word=substr($word,1); $requiredWords[]=$word; } + if (($word{0}=='-')) { $word=substr($word,1); $forbiddenWords[]=$word; } + if (!in_array($word,$foundWords)) + { + $foundWords[]=$word; + search($file,strtolower($word),$results); + } + $word=strtok(" "); + } + $docs = array(); + combine_results($results,$docs); + // filter out documents with forbidden word or that do not contain + // required words + $filteredDocs = filter_results($docs,$requiredWords,$forbiddenWords); + // sort the results based on rank + $sorted = array(); + sort_results($filteredDocs,$sorted); + // report results to the user + report_results($sorted); + echo "
\n"; + fclose($file); +} + +main(); + + +?> +
Generated on Mon Mar 30 14:40:04 2009 for DTLZ by  + +doxygen 1.5.5
+ + diff --git a/problems/DTLZ/doc/html/tab_b.gif b/problems/DTLZ/doc/html/tab_b.gif new file mode 100644 index 0000000000000000000000000000000000000000..0d623483ffdf5f9f96900108042a7ab0643fe2a3 GIT binary patch literal 35 ncmZ?wbhEHbWMp7uXkcJy*>IeJfk6j|fqX^=1|}vKMh0sDa2W*H literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/tab_l.gif b/problems/DTLZ/doc/html/tab_l.gif new file mode 100644 index 0000000000000000000000000000000000000000..9b1e6337c9299a700401a2a78a2c6ffced475216 GIT binary patch literal 706 zcmZ?wbhEHbZT`}F1e&(Gg}Y(8=I;HA5#Z$3JI=gGB)FQ#odI(O&E^@q;x zK6mr*m3xOS-#u~t!I@i+u0DKm^U160k6t`|^WpV}&n+8{U%dD9&a>B#U%!9-@yol< zU%&tQ{rk_K|NsC0`}dE5ET99@1@a36+kb~?0UJ*yc&I3X_m z!ND^5$O7$#8OFRuDhG}!?8z?cdZK&!`PWjdR;Aj^wZ` zeK{IEYHBJ)6K8VIp1`BVt++swf6j+=L{p1*nO(VhE`pFexG@5$|>uaCcd z`0m=9m+yak{QmXN#Sc$^{$X9h9&q2jiKAI|&T)a;PPx2K9p`YIdw8HtR5k2Q$2-O2 z*;3y{MQ-RnJTgJfI&R5|O)AHxDf_00XbPvDZPy4t=hHd)nfLPvms&O`Ok(sD()5v$ z5U@&h;a=#xbxVbo2~X&Xj0Ie(f{v>vERH+qC+nTG=B8Nca=wU-O$?1&vUgV~9=!H; zx>3p9Yn%*<>t~sk+&0xfyS8RsPfYBd<~wWK%j-LmpU>O7yX^h#UCp1x-p#i7@bE;py8XI6 zmY<)m>~)W~yIWcMVoiPg{duuf<*)9qZ9l$m*Ph&W&$jlv*Vpa+{pH@n=IQ$L?0$ax ec60Ul|8o2P|NVbd{6P)#weSbE3}s?04AuZvx_~SI literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/tab_r.gif b/problems/DTLZ/doc/html/tab_r.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce9dd9f533cb5486d6941844f442b59d4a9e9175 GIT binary patch literal 2585 zcmbV}`9Bkk1ILFF--w5zJc=ZZT(zjE=;2|_S)Qm~rCWz1Pc)KPl;jv%A#&v2*x}yc zmf2~Jm~&=xjJY?PqwIN}f8qQ2{r$uH{c*nJbmr{cR5??*egHrs-B=MzCF`3%e{FAW z{oL5xTHn~5TM{jaB;@|_Ue5F&Zb@p(kMyG{*;gWDg zyeL|eZf7Qd8=#bXzSiR{yzRgLSj-fJS8>lBjVHN z^o-0eS=nE6a`W;LChBs=`+QAJP~{b93>H^eRb5kCSC1zUNezun%`L5M?RDzv#%jk7 zYVRX=vATPD`+oEfum^{RM@GjuP?-r=yh0!p;Vx^T9G7~`7%5ydH%70=jyJ;;`d;hv92x3R=z{xp+Lg2!*@OK*K15-t&okoPtSED)h&$RLxdbA zseWm^C3d%-yRNi-ryk^!ek+C`n&~cd$#ZWct_cUL{l~i+Nzx^5d!n94(>bW-iL~Rl z&8r)?q|1DIo=0=judQ{FaGcfLERz8gfn3-Qt<2lksh{mzpT}DXxUuR^z=^key&q4! z+wWI45vL0k$R^(F#{qfqhUsN@WA+w-V?LPH33!Q?WFSB3)WBojE@hK41Nb?KfS+Qo zXgrzfsP$wr4Qzy*{OD>uJBjdgGM@VMml5)2f~_}lD*YyOb}Hjeobhz#4c`w(l^>KK zr?Ud;W~Z}*w;%hZ|2^p^+f06gJDJQD zeIhGADbDmm&6arh(q>EZ<7mjzg7l|z$hRL8=1>)Nv=S7CY$B}iYJ&*T_-T_OG*L1q ztZ3Lana33?y3AKnyq^YCF|4x%Rb5WU&2qcl{TFKey%QJeMxn^SdT!hZ5+0i1zeusiYVp-phBl7b5+Px-X&LhByq z0F&<;K0l2+v>qiHlXb#$jXMv$uK-dEGE9L~qtdU(XeRXmvu*K2Q&6!fD**JxYP4b4BR7FdJ$Qx9G9`J%-_X!a#LGpp3g9)VWytGCa;7`S1_e8F~!R+aSJ zOF17p2`H?2kPs8Q`_;U}+D%3p zs2-0BTqFwpUoBk`?P;iPQ(IbEA|JmMx!P&YYG|R@S=5Mnw;-?A6rEEVyV%d7{iU4a zNk`i!%F(Ykpm`}#oH;BjY->@b8vQedv;pza2FL&*6ufjd+*3Ute&>kes~TU?^KkojsTh(o~(3tk1Y6>4(yn( z#U*ID9@eg-beKo1B;HXe+}{Z%n@7m0+yxivuqk9~;!1LGQlah)xYK4>wgL}l6dsaN zIxlRlq`*`j9PG4*0hD6YV_b_2w5b#)o7J?`q#{GjvvKlD`T*dWcZx<-s(ZvLB44E# z=!|sw!?)@%y$oRNL#25WS3lzdii}TuQ3?CLnvQ1_n};2sT_;Y;#d3=+-(O% zMN$>O!3;ke(UuLR%h_&)N zs^!-@A>QR}4yB1bPp`9S19ikTbZ~O{&FF-yHK{En;mmShDUIEw03`j(DBIsM}Rjki2J#SQa3gFZTKBPDeIiLt9Z z%bL3(B@Qw%(B`wSMS~dPh$=R`(}lBoFXKy(s|*{#ru$wjsBc_O#zxNk9w+UUHmx(U zmJ8+M+ndtnZ<7|VU9Mbt61zpo9T&3%Wx&XII=#QJxjR`CZf22ac3d51Z?GD%LEe_&*t46Qf;4`bZ7p2K(Ab5>GfT^}4! zBT&HZD`^PEgWoI&{~o-ID0F?O`75sm(87x%A{(}Ch1)QlzdJ)1B-eqe5a(weg0`4lQIf1evjvbBY50DVbzO7CLf|vP z2#0(U-|jZ`H{y5N^o7%iK6H>_HEGN->U6^!)1{XpJV!!4(Ig7wzZQ*9WYF4X1rG0x z=1uA@i`rIAciubDC{;~b(|&|A@xkjRP5aRcvRU9tvIm}jDB6J eQ0-6-y)mpwdT=ayS0tBxKDA*~;EWmo literal 0 HcmV?d00001 diff --git a/problems/DTLZ/doc/html/tabs.css b/problems/DTLZ/doc/html/tabs.css new file mode 100644 index 000000000..95f00a91d --- /dev/null +++ b/problems/DTLZ/doc/html/tabs.css @@ -0,0 +1,102 @@ +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; +} + +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; +} + +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; +} + +DIV.tabs FORM +{ + float : right; +} + +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + +DIV.tabs A:hover +{ + background-position: 100% -150px; +} + +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; +} + +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs INPUT +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : x-small; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; +} diff --git a/problems/DTLZ/doc/index.h b/problems/DTLZ/doc/index.h new file mode 100644 index 000000000..30d2abb71 --- /dev/null +++ b/problems/DTLZ/doc/index.h @@ -0,0 +1,57 @@ +/** @mainpage DTLZ for ParadisEO + +@section Introduction + +This package contains implementation of some DTLZ problems (1, 2, 3, 4, 5, 6, 7) + +@section Authors +Arnaud Liefooghe, Jérémie Humeau + +@section Installation + +The installation procedure of the package is detailed in the "README.txt" file located in the top-directory of the source-tree. + + +@section Design + +For an introduction to the design of ParadisEO, +you can look at the ParadisEO website. + + +@section LICENSE + + 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 + +*/ + +/** @page webpages Related webpages + +- ParadisEO homepage +- INRIA GForge project page +- Fore any questions, please contact paradiseo-help@lists.gforge.inria.fr +*/ diff --git a/problems/DTLZ/doc/moeo.doxyfile.cmake b/problems/DTLZ/doc/moeo.doxyfile.cmake new file mode 100644 index 000000000..3f56ae1a2 --- /dev/null +++ b/problems/DTLZ/doc/moeo.doxyfile.cmake @@ -0,0 +1,237 @@ +# Doxyfile 1.5.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = @PACKAGE_NAME@ +PROJECT_NUMBER = @PACKAGE_VERSION@ +OUTPUT_DIRECTORY = @CMAKE_BINARY_DIR@/doc +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 = @CMAKE_SOURCE_DIR@ +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 = NO +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = @CMAKE_SOURCE_DIR@ +FILE_PATTERNS = *.cpp \ + *.h \ + NEWS README +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +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 = moeo +#--------------------------------------------------------------------------- +# 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 = NO +USE_PDFLATEX = NO +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 = @EO_BIN_DIR@/doc/eo.doxytag=http://eodev.sourceforge.net/eo/doc/html +GENERATE_TAGFILE = @CMAKE_BINARY_DIR@/doc/moeo.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/problems/DTLZ/install.cmake b/problems/DTLZ/install.cmake new file mode 100644 index 000000000..dc32aaa0d --- /dev/null +++ b/problems/DTLZ/install.cmake @@ -0,0 +1,28 @@ +######################################################################################################### +# 1) ParadisEO install: SIMPLE Configuration +######################################################################################################### + +# Here, just specify PARADISEO_DIR : the directory where ParadisEO has been installed +SET(PARADISEO_DIR "/home/humeau/Bureau/paradiseo-1.3-beta2/" CACHE PATH "ParadisEO directory" FORCE) + +######################################################################################################### + + + +######################################################################################################### +# 2) ParadisEO install: ADVANCED Configuration +######################################################################################################### + +SET(PARADISEO_EO_SRC_DIR "${PARADISEO_DIR}/paradiseo-eo" CACHE PATH "ParadisEO-EO source directory" FORCE) +SET(PARADISEO_EO_BIN_DIR "${PARADISEO_DIR}/paradiseo-eo/build" CACHE PATH "ParadisEO-EO binary directory" FORCE) + +SET(PARADISEO_MO_SRC_DIR "${PARADISEO_DIR}/paradiseo-mo" CACHE PATH "ParadisEO-MO source directory" FORCE) +SET(PARADISEO_MO_BIN_DIR "${PARADISEO_DIR}/paradiseo-mo/build" CACHE PATH "ParadisEO-MO binary directory" FORCE) + +SET(PARADISEO_MOEO_SRC_DIR "${PARADISEO_DIR}/paradiseo-moeo" CACHE PATH "ParadisEO-MOEO source directory" FORCE) +SET(PARADISEO_MOEO_BIN_DIR "${PARADISEO_DIR}/paradiseo-moeo/build" CACHE PATH "ParadisEO-MOEO binary directory" FORCE) + +SET(PARADISEO_PEO_SRC_DIR "${PARADISEO_DIR}/paradiseo-peo" CACHE PATH "ParadisEO-PEO source directory" FORCE) +SET(PARADISEO_PEO_BIN_DIR "${PARADISEO_DIR}/paradiseo-peo/build" CACHE PATH "ParadisEO-PEO binary directory" FORCE) +######################################################################################################### + diff --git a/problems/DTLZ/run.sh b/problems/DTLZ/run.sh new file mode 100644 index 000000000..95f62e10c --- /dev/null +++ b/problems/DTLZ/run.sh @@ -0,0 +1,50 @@ +#population size +POP_SIZE=100 + +#ZDT number (1, 2, 3, 4 or 6) +EVAL=1 + +#vector Size +VEC_SIZE=30 + +#number of objectives +NB_OBJ=3 + +#PROBABIITY FOR SBXCROSSOVER +P_CROSS=1.0 + +#EXTERNAL PROBABILITY FOR POLYNOMIAL MUTATION +EXT_P_MUT=1.0 + +#INTERNAL PROBABILITY FOR POLYNOMIAL MUTATION +INT_P_MUT=0.083333 + +#ARCHIVE SIZE (ONLY FOR SPEA2) +ARC_SIZE=100 + +#K-TH DISTANCE (ONLY FOR SPEA2) +K=10 + +#number of evaluation +NB_EVAL=500 + +#Time +TIME=0 + +#seed +SEED=1 + +DTLZ4=100 + +SPEA2="SPEA2.out" + +IBEA="IBEA.out" + +NSGA="NSGAII.out" + +./build/application/DTLZ_SPEA2 --eval=$i --dtlz4_param=$DTLZ4 --vecSize=$VEC_SIZE --nbObj=$NB_OBJ --pCross=$P_CROSS --extPMut=$EXT_P_MUT --intPMut=$INT_P_MUT --arcSize=$ARC_SIZE --nbEval=$NB_EVAL --time=$TIME --k=$K -o=$SPEA2 + +./build/application/DTLZ_IBEA --eval=$i --dtlz4_param=$DTLZ4 --vecSize=$VEC_SIZE --nbObj=$NB_OBJ --pCross=$P_CROSS --extPMut=$EXT_P_MUT --intPMut=$INT_P_MUT --nbEval=$NB_EVAL --time=$TIME -o=$IBEA + +./build/application/DTLZ_NSGAII --eval=$i --dtlz4_param=$DTLZ4 --vecSize=$VEC_SIZE --nbObj=$NB_OBJ --pCross=$P_CROSS --extPMut=$EXT_P_MUT --intPMut=$INT_P_MUT --nbEval=$NB_EVAL --time=$TIME -o=$NSGA + diff --git a/problems/DTLZ/src/CMakeLists.txt b/problems/DTLZ/src/CMakeLists.txt new file mode 100644 index 000000000..ba815fe04 --- /dev/null +++ b/problems/DTLZ/src/CMakeLists.txt @@ -0,0 +1,33 @@ +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src) +INCLUDE_DIRECTORIES(${PARADISEO_MOEO_SRC_DIR}/src) +INCLUDE_DIRECTORIES(${PARADISEO_MO_SRC_DIR}/src) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + +###################################################################################### + + +###################################################################################### +### 2) Define your target(s): just the flow-shop lib here +###################################################################################### + +SET(DTLZ_LIB_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) +SET(LIBRARY_OUTPUT_PATH ${DTLZ_LIB_OUTPUT_PATH}) + +SET (DTLZ_SOURCES + DTLZ.cpp + DTLZ1Eval.cpp + DTLZ2Eval.cpp + DTLZ3Eval.cpp + DTLZ4Eval.cpp + DTLZ5Eval.cpp + DTLZ6Eval.cpp + DTLZ7Eval.cpp) + +ADD_LIBRARY(lDTLZ STATIC ${DTLZ_SOURCES}) + +###################################################################################### + diff --git a/problems/DTLZ/src/DTLZ.cpp b/problems/DTLZ/src/DTLZ.cpp new file mode 100644 index 000000000..7a2606e51 --- /dev/null +++ b/problems/DTLZ/src/DTLZ.cpp @@ -0,0 +1,44 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +std::string DTLZ::className() const +{ + return "DTLZ"; +} diff --git a/problems/DTLZ/src/DTLZ.h b/problems/DTLZ/src/DTLZ.h new file mode 100644 index 000000000..0b20bc7d3 --- /dev/null +++ b/problems/DTLZ/src/DTLZ.h @@ -0,0 +1,58 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DTLZ_H_ +#define DTLZ_H_ + +#include + +/** + * Structure of the genotype for DTLZ fonctions problem: a vector of double. + */ +class DTLZ : public moeoRealVector < DTLZObjectiveVector, double, double > +{ +public: + + /** + * class name + */ + std::string className() const; + +}; + +#endif /*DTLZ_H_*/ diff --git a/problems/DTLZ/src/DTLZ1Eval.cpp b/problems/DTLZ/src/DTLZ1Eval.cpp new file mode 100644 index 000000000..2edbf2ab8 --- /dev/null +++ b/problems/DTLZ/src/DTLZ1Eval.cpp @@ -0,0 +1,74 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 +// Ce code est implémenté à partir de DEME:Dtlz1.cpp +void DTLZ1Eval::operator() (DTLZ & _element) +{ + if (_element.invalidObjectiveVector()) + { + int nbFun= DTLZ::ObjectiveVector::nObjectives(); + int nbVar= _element.size(); + int k; + double g; + DTLZObjectiveVector objVec(nbVar); + + k = nbVar - nbFun + 1; + g = 0.0; + for (unsigned i = nbVar - k + 1; i <= nbVar; i++) + g += pow(_element[i-1]-0.5,2) - cos(20 * M_PI * (_element[i-1]-0.5)); + + g = 100 *(k + g); + + for (unsigned i = 1; i <= nbFun; i++) { + double f = 0.5 * (1 + g); + for (unsigned j = nbFun - i; j >= 1; j--) + f *= _element[j-1]; + + if (i > 1) + f *= 1 - _element[(nbFun - i + 1) - 1]; + + objVec[i-1] = f; + } + + _element.objectiveVector(objVec); + } +} + diff --git a/problems/DTLZ/src/DTLZ1Eval.h b/problems/DTLZ/src/DTLZ1Eval.h new file mode 100644 index 000000000..37471612f --- /dev/null +++ b/problems/DTLZ/src/DTLZ1Eval.h @@ -0,0 +1,58 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DSTLZ1EVAL_H_ +#define DSTLZ1EVAL_H_ + +#include + +/** + * DTLZ1 Evaluation Fonction + */ +class DTLZ1Eval : public moeoEvalFunc +{ +public: + + /** + * operator evaluates a genotype + */ + void operator () (DTLZ & _element); + +}; + +#endif /*DSTLZ1EVAL_H_*/ diff --git a/problems/DTLZ/src/DTLZ2Eval.cpp b/problems/DTLZ/src/DTLZ2Eval.cpp new file mode 100644 index 000000000..e9e8ca29b --- /dev/null +++ b/problems/DTLZ/src/DTLZ2Eval.cpp @@ -0,0 +1,73 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +// Ce code est implémenté à partir de DEME:Dtlz1.cpp +void DTLZ2Eval::operator() (DTLZ & _element) +{ + if (_element.invalidObjectiveVector()) + { + int nbFun= DTLZ::ObjectiveVector::nObjectives(); + int nbVar= _element.size(); + int k; + double g; + DTLZObjectiveVector objVec; + + k = nbVar - nbFun + 1; + g = 0.0; + for (unsigned i = nbVar - k + 1; i <= nbVar; i++) + g += pow(_element[i-1]-0.5,2); + + for (unsigned i = 1; i <= nbFun; i++) { + double f = (1 + g); + for (unsigned j = nbFun - i; j >= 1; j--) + f *= cos(_element[j-1] * M_PI / 2); + + if (i > 1) + f *= sin(_element[(nbFun - i + 1) - 1] * M_PI / 2); + + objVec[i-1] = f; + } + + _element.objectiveVector(objVec); + } +} + diff --git a/problems/DTLZ/src/DTLZ2Eval.h b/problems/DTLZ/src/DTLZ2Eval.h new file mode 100644 index 000000000..806275548 --- /dev/null +++ b/problems/DTLZ/src/DTLZ2Eval.h @@ -0,0 +1,57 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DTLZ2EVAL_H_ +#define DTLZ2EVAL_H_ + +#include + +/** + * DTLZ2 Evaluation Fonction + */ +class DTLZ2Eval : public moeoEvalFunc +{ +public: + /** + * operator evaluates a genotype + */ + void operator () (DTLZ & _element); + +}; + +#endif /*DTLZ2EVAL_H_*/ diff --git a/problems/DTLZ/src/DTLZ3Eval.cpp b/problems/DTLZ/src/DTLZ3Eval.cpp new file mode 100644 index 000000000..e856be289 --- /dev/null +++ b/problems/DTLZ/src/DTLZ3Eval.cpp @@ -0,0 +1,74 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +// Ce code est implémenté à partir de DEME:Dtlz1.cpp +void DTLZ3Eval::operator() (DTLZ & _element) +{ + if (_element.invalidObjectiveVector()) + { + int nbFun= DTLZ::ObjectiveVector::nObjectives(); + int nbVar= _element.size(); + int k; + double g; + DTLZObjectiveVector objVec; + + k = nbVar - nbFun + 1; + g = 0.0; + for (unsigned i = nbVar - k + 1; i <= nbVar; i++) + g += pow(_element[i-1]-0.5,2) - cos( 20 * M_PI * (_element[i-1] - 0.5) ); + g = 100 * (k + g); + + for (unsigned i = 1; i <= nbFun; i++) { + double f = (1 + g); + for (unsigned j = nbFun - i; j >= 1; j--) + f *= cos(_element[j-1] * M_PI / 2); + + if (i > 1) + f *= sin(_element[(nbFun - i + 1) - 1] * M_PI / 2); + + objVec[i-1] = f; + } + + _element.objectiveVector(objVec); + } +} + diff --git a/problems/DTLZ/src/DTLZ3Eval.h b/problems/DTLZ/src/DTLZ3Eval.h new file mode 100644 index 000000000..3326e9ea8 --- /dev/null +++ b/problems/DTLZ/src/DTLZ3Eval.h @@ -0,0 +1,58 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DTLZ3EVAL_H_ +#define DTLZ3EVAL_H_ + +#include + +/** + * DTLZ3 Evaluation Fonction + */ +class DTLZ3Eval : public moeoEvalFunc +{ +public: + + /** + * operator evaluates a genotype + */ + void operator () (DTLZ & _element); + +}; + +#endif /*DTLZ3EVAL_H_*/ diff --git a/problems/DTLZ/src/DTLZ4Eval.cpp b/problems/DTLZ/src/DTLZ4Eval.cpp new file mode 100644 index 000000000..36aef11a9 --- /dev/null +++ b/problems/DTLZ/src/DTLZ4Eval.cpp @@ -0,0 +1,75 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +DTLZ4Eval::DTLZ4Eval(double _alpha = 100):alpha(_alpha) {} + +// Ce code est implémenté à partir de DEME:Dtlz1.cpp +void DTLZ4Eval::operator() (DTLZ & _element) +{ + if (_element.invalidObjectiveVector()) + { + int nbFun= DTLZ::ObjectiveVector::nObjectives(); + int nbVar= _element.size(); + int k; + double g; + DTLZObjectiveVector objVec; + + k = nbVar - nbFun + 1; + g = 0.0; + for (unsigned i = nbVar - k + 1; i <= nbVar; i++) + g += pow(_element[i-1]-0.5,2); + + for (unsigned i = 1; i <= nbFun; i++) { + double f = (1 + g); + for (unsigned j = nbFun - i; j >= 1; j--) + f *= cos( pow(_element[j-1], alpha) * M_PI / 2); + + if (i > 1) + f *= sin( pow(_element[(nbFun - i + 1) - 1], alpha) * M_PI / 2); + + objVec[i-1] = f; + } + + _element.objectiveVector(objVec); + } +} + diff --git a/problems/DTLZ/src/DTLZ4Eval.h b/problems/DTLZ/src/DTLZ4Eval.h new file mode 100644 index 000000000..49000f23f --- /dev/null +++ b/problems/DTLZ/src/DTLZ4Eval.h @@ -0,0 +1,68 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DTLZ4EVAL_H_ +#define DTLZ4EVAL_H_ + +#include + +/** + * DTLZ4 Evaluation Fonction + */ +class DTLZ4Eval : public moeoEvalFunc +{ +public: + /** + * @param _alpha parameter used in DTLZ4 + */ + DTLZ4Eval(double _alpha); + + /** + * operator evaluates a genotype + */ + void operator () (DTLZ & _element); + +private: + /** parameter alpha */ + double alpha; + + +}; + +#endif /*DTLZ4EVAL_H_*/ + diff --git a/problems/DTLZ/src/DTLZ5Eval.cpp b/problems/DTLZ/src/DTLZ5Eval.cpp new file mode 100644 index 000000000..e7a788bb6 --- /dev/null +++ b/problems/DTLZ/src/DTLZ5Eval.cpp @@ -0,0 +1,82 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 +#define M_PI_2 1.57079632679489661923 + +// Ce code est implémenté à partir de DEME:Dtlz1.cpp +void DTLZ5Eval::operator() (DTLZ & _element) +{ + if (_element.invalidObjectiveVector()) + { + int nbFun= DTLZ::ObjectiveVector::nObjectives(); + int nbVar= _element.size(); + int k; + double g, t; + DTLZObjectiveVector objVec; + + double theta[nbFun-1]; + + k = nbVar - nbFun + 1; + g = 0.0; + for (unsigned i = nbVar - k + 1; i <= nbVar; i++) + g += pow(_element[i-1]-0.5,2); + + t= M_PI /(4 * (1 + g)); + + theta[0]= M_PI_2 * _element[0]; + for (unsigned i = 1; i <= nbFun - 2 ; i++) + theta[i]= t * (1 + 2 * g * _element[i]); + + for (unsigned i = 1; i <= nbFun; i++) { + double f = (1 + g); + for (unsigned j = nbFun - i; j >= 1; j--) + f *= cos(theta[j-1]); + + if (i > 1) + f *= sin(theta[(nbFun - i + 1) - 1]); + + objVec[i-1] = f; + } + + _element.objectiveVector(objVec); + } +} + diff --git a/problems/DTLZ/src/DTLZ5Eval.h b/problems/DTLZ/src/DTLZ5Eval.h new file mode 100644 index 000000000..660e3e155 --- /dev/null +++ b/problems/DTLZ/src/DTLZ5Eval.h @@ -0,0 +1,59 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DTLZ5EVAL_H_ +#define DTLZ5EVAL_H_ + +#include + +/** + * DTLZ5 Evaluation Fonction + */ +class DTLZ5Eval : public moeoEvalFunc +{ +public: + + /** + * operator evaluates a genotype + */ + void operator () (DTLZ & _element); + +}; + +#endif /*DTLZ5EVAL_H_*/ + diff --git a/problems/DTLZ/src/DTLZ6Eval.cpp b/problems/DTLZ/src/DTLZ6Eval.cpp new file mode 100644 index 000000000..5034d9374 --- /dev/null +++ b/problems/DTLZ/src/DTLZ6Eval.cpp @@ -0,0 +1,81 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +// Ce code est implémenté à partir de DEME:Dtlz1.cpp +void DTLZ6Eval::operator() (DTLZ & _element) +{ + if (_element.invalidObjectiveVector()) + { + int nbFun= DTLZ::ObjectiveVector::nObjectives(); + int nbVar= _element.size(); + int k; + double g, t; + DTLZObjectiveVector objVec; + + double theta[nbFun-1]; + + k = nbVar - nbFun + 1; + g = 0.0; + for (unsigned i = nbVar - k + 1; i <= nbVar; i++) + g += pow(_element[i-1],0.1); + + t= M_PI /(4 * (1 + g)); + + theta[0]= M_PI * _element[0] / 2; + for (unsigned i = 1; i <= nbFun - 2 ; i++) + theta[i]= t * (1 + 2 * g * _element[i]); + + for (unsigned i = 1; i <= nbFun; i++) { + double f = (1 + g); + for (unsigned j = nbFun - i; j >= 1; j--) + f *= cos(theta[j-1]); + + if (i > 1) + f *= sin(theta[(nbFun - i + 1) - 1]); + + objVec[i-1] = f; + } + + _element.objectiveVector(objVec); + } +} + diff --git a/problems/DTLZ/src/DTLZ6Eval.h b/problems/DTLZ/src/DTLZ6Eval.h new file mode 100644 index 000000000..08e893c69 --- /dev/null +++ b/problems/DTLZ/src/DTLZ6Eval.h @@ -0,0 +1,60 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DTLZ6EVAL_H_ +#define DTLZ6EVAL_H_ + +#include + +/** + * DTLZ6 Evaluation Fonction + */ +class DTLZ6Eval : public moeoEvalFunc +{ +public: + + /** + * operator evaluates a genotype + */ + void operator () (DTLZ & _element); + +}; + +#endif /*DTLZ6EVAL_H_*/ + + diff --git a/problems/DTLZ/src/DTLZ7Eval.cpp b/problems/DTLZ/src/DTLZ7Eval.cpp new file mode 100644 index 000000000..6f683d50b --- /dev/null +++ b/problems/DTLZ/src/DTLZ7Eval.cpp @@ -0,0 +1,74 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 +// Ce code est implémenté à partir de DEME:Dtlz1.cpp +void DTLZ7Eval::operator() (DTLZ & _element) +{ + if (_element.invalidObjectiveVector()) + { + int nbFun= DTLZ::ObjectiveVector::nObjectives(); + int nbVar= _element.size(); + int k; + double f, g, h; + DTLZObjectiveVector objVec(nbVar); + + k = nbVar - nbFun + 1; + g = 0.0; + h = 0.0; + for (unsigned i = nbVar - k + 1; i <= nbVar; i++) + g += _element[i-1]; + g= 1 + (9 * g ) / k; + + + for (unsigned i = 1; i <= nbFun -1 ; i++) + objVec[i-1]=_element[i-1]; + + for (unsigned i = 1 ; i< nbFun; i++) + h += _element[i-1] / (1 + g) * (1 + sin(3 * M_PI * _element[i-1])); + h = nbFun - h; + + objVec[nbFun -1] = (1 + g) * h; + + + _element.objectiveVector(objVec); + } +} + diff --git a/problems/DTLZ/src/DTLZ7Eval.h b/problems/DTLZ/src/DTLZ7Eval.h new file mode 100644 index 000000000..6437523e1 --- /dev/null +++ b/problems/DTLZ/src/DTLZ7Eval.h @@ -0,0 +1,59 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DTLZ7EVAL_H_ +#define DTLZ7EVAL_H_ + +#include + +/** + * DTLZ7 Evaluation Fonction + */ +class DTLZ7Eval : public moeoEvalFunc +{ +public: + + /** + * operator evaluates a genotype + */ + void operator () (DTLZ & _element); + +}; + +#endif /*DTLZ7EVAL_H_*/ + diff --git a/problems/DTLZ/src/DTLZObjectiveVector.h b/problems/DTLZ/src/DTLZObjectiveVector.h new file mode 100644 index 000000000..94f9ff1f2 --- /dev/null +++ b/problems/DTLZ/src/DTLZObjectiveVector.h @@ -0,0 +1,47 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 DTLZOBJECTIVEVECTOR_H_ +#define DTLZOBJECTIVEVECTOR_H_ + +#include + +/** define DTLZ Objective vector as a vector of double*/ +typedef moeoRealObjectiveVector DTLZObjectiveVector; + +#endif /*DTLZOBJECTIVEVECTOR_H_*/ diff --git a/problems/DTLZ/src/PolynomialMutation.h b/problems/DTLZ/src/PolynomialMutation.h new file mode 100644 index 000000000..871ed0b0f --- /dev/null +++ b/problems/DTLZ/src/PolynomialMutation.h @@ -0,0 +1,123 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 POLYNOMIALMUTATION_H_ +#define POLYNOMIALMUTATION_H_ + +#include + +template class PolynomialMutation: public eoMonOp +{ +public: + + PolynomialMutation(eoRealVectorBounds & _bounds, const double& _p_mut = 0.5, const double& _eta = 1.0): + p_mut(_p_mut), eta(_eta), bounds(_bounds) {} + + /// The class name. + virtual std::string className() const { + return "PolynomialMutation"; + } + + /** + * Do it! + * @param _eo The indi undergoing the mutation + */ + bool operator()(EOT& _eo) + { + bool hasChanged=false; + double rnd, delta1, delta2, mut_pow, deltaq, delta_max; + double y, yl, yu, val, xy; + + for (unsigned j=0; j<_eo.size(); j++) + { + if (rng.flip(p_mut)) + { + y = _eo[j]; + + yl = bounds.minimum(j); + yu = bounds.maximum(j); + delta1 = (y-yl)/(yu-yl); + delta2 = (yu-y)/(yu-yl); + + + //Ajout + if ( (y-yl) > (yu-y)) + delta_max = delta2; + else + delta_max= delta1; + //fin ajout + + rnd = rng.uniform(); + mut_pow = 1.0/(eta+1.0); + if (rnd <= 0.5) + { + xy = 1.0-delta_max;//delta_max au lieu de delta1 + val = 2.0*rnd+(1.0-2.0*rnd)*(pow(xy,(eta+1.0))); + deltaq = pow(val,mut_pow) - 1.0; + } + else + { + xy = 1.0-delta_max;//delta_max au lieu de delta2 + val = 2.0*(1.0-rnd)+2.0*(rnd-0.5)*(pow(xy,(eta+1.0))); + deltaq = 1.0 - (pow(val,mut_pow)); + } + //ajout + if (deltaq > delta_max) + deltaq = delta_max; + else if (deltaq < -delta_max) + deltaq= -delta_max; + //fin ajout + y = y + deltaq*(yu-yl); + + bounds.truncate(j, y); + _eo[j] = y; + + hasChanged = true; + } + } + + return hasChanged; + } + +private: + double p_mut; + double eta; + eoRealVectorBounds & bounds; +}; + +#endif /*POLYNOMIALMUTATION_H_*/ diff --git a/problems/DTLZ/src/SBXCrossover.h b/problems/DTLZ/src/SBXCrossover.h new file mode 100644 index 000000000..0001818ed --- /dev/null +++ b/problems/DTLZ/src/SBXCrossover.h @@ -0,0 +1,194 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 SBXCROSSOVER_H_ +#define SBXCROSSOVER_H_ + +#include // swap_ranges +#include +#include +#include +#include +#include + +template class SBXCrossover: public eoQuadOp +{ +public: + /**** + * (Default) Constructor. + * The bounds are initialized with the global object that says: no bounds. + * + * + */ + SBXCrossover(const double& _eta = 1.0) : + bounds(eoDummyVectorNoBounds), eta(_eta), range(1) {} + + + ////////////////////////////////////////////// + + /** + * Constructor with bounds + * @param _bounds an eoRealVectorBounds that contains the bounds + * @param _alphaMin the amount of exploration OUTSIDE the parents + * as in BLX-alpha notation (Eshelman and Schaffer) + * 0 == contractive application + * Must be positive + */ + + + + SBXCrossover(eoRealVectorBounds & _bounds, + const double& _eta = 1.0) : + bounds(_bounds), eta(_eta), range(1) {} + + /////////////////////////////////////////////// + + ////////////////////////////////////////////// + + /** + * Constructor from a parser. Will read from the argument parser + * eoRealVectorBounds that contains the bounds + * eta, the SBX parameter + */ + + SBXCrossover(eoParser & _parser) : + // First, decide whether the objective variables are bounded + // Warning, must be the same keywords than other possible objectBounds elsewhere + bounds (_parser.getORcreateParam(eoDummyVectorNoBounds, "objectBounds", "Bounds for variables", 'B', "Variation Operators").value()) , + // then get eta value + eta (_parser.getORcreateParam(1.0, "eta", "SBX eta parameter", '\0', "Variation Operators").value()) , + range(1) {} + +# define EPS 1.0e-14 + + /// The class name. + virtual std::string className() const { + return "SBXCrossover"; + } + + /***************************************** + * SBX crossover - modifies both parents * + * @param _eo1 The first parent * + * @param _eo2 The first parent * + *****************************************/ + bool operator()(EOT& _eo1, EOT& _eo2) + { + unsigned i; + double rand; + double y1, y2, yl, yu; + double c1, c2; + double alpha, beta, betaq; + bool changed = false; + + for (i=0; i<_eo1.size(); i++) + { + if (true) + { + if (fabs(_eo1[i] - _eo2[i]) > EPS) // pour éviter la division par 0 + { + // y2 doit être > à y1 + if (_eo1[i] < _eo2[i]) + { + y1 = _eo1[i]; + y2 = _eo2[i]; + } + else + { + y1 = _eo2[i]; + y2 = _eo1[i]; + } + yl = bounds.minimum(i); + yu = bounds.maximum(i); + + rand = rng.uniform(); + + beta = 1.0 + (2.0 * (y1 - yl) / (y2 - y1)); + alpha = 2.0 - pow( beta, -(eta + 1.0)); + if (rand <= (1.0/alpha)) + { + betaq = pow ( (rand * alpha), (1.0 / (eta + 1.0))); + } + else + { + betaq = pow ( (1.0 / (2.0 - rand * alpha)), (1.0 / (eta+1.0))); + } + c1 = 0.5 * ((y1 + y2) - betaq * (y2 - y1)); + + beta = 1.0 + (2.0 * (yu - y2) / (y2 - y1)); + alpha = 2.0 - pow( beta, -(eta + 1.0)); + if (rand <= (1.0/alpha)) + { + betaq = pow ( (rand * alpha), (1.0 / (eta + 1.0))); + } + else + { + betaq = pow ( (1.0 / (2.0 - rand * alpha)), (1.0 / (eta + 1.0))); + } + c2 = 0.5 * ((y1 + y2) + betaq * (y2 - y1)); + + bounds.truncate(i, c1); + bounds.truncate(i, c2); + + if (rng.flip()) + { + _eo1[i] = c2; + _eo2[i] = c1; + } + else + { + _eo1[i] = c1; + _eo2[i] = c2; + } + + changed = true; + } + } + } + + return changed; + } + + + +protected: + eoRealVectorBounds & bounds; + double eta; + double range; // == 1 +}; + +#endif /*SBXCROSSOVER_H_*/ diff --git a/problems/DTLZ/test/CMakeLists.txt b/problems/DTLZ/test/CMakeLists.txt new file mode 100644 index 000000000..900949952 --- /dev/null +++ b/problems/DTLZ/test/CMakeLists.txt @@ -0,0 +1,62 @@ +############################################################################### +## +## CMakeLists file for DTLZ/test +## +############################################################################### + + +###################################################################################### +### 1) Include the sources +###################################################################################### + +INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src + ${PARADISEO_MO_SRC_DIR}/src + ${PARADISEO_MOEO_SRC_DIR}/src + ${DTLZ_SOURCE_DIR}/src) + +###################################################################################### + + +###################################################################################### +### 2) Specify where CMake can find the libraries +###################################################################################### + +LINK_DIRECTORIES(${PARADISEO_EO_BIN_DIR}/lib) +LINK_DIRECTORIES(${PARADISEO_MOEO_BIN_DIR}/lib) +LINK_DIRECTORIES(${DTLZ_BINARY_DIR}/lib) +###################################################################################### + + + +###################################################################################### +### 3) Define your targets and link the librairies +###################################################################################### + +SET (TEST_LIST + t-DTLZ + t-DTLZ1Eval + t-DTLZ2Eval + t-DTLZ3Eval + t-DTLZ4Eval + t-DTLZ5Eval + t-DTLZ6Eval + t-DTLZ7Eval +) + +FOREACH (test ${TEST_LIST}) + SET ("T_${test}_SOURCES" "${test}.cpp") +ENDFOREACH (test) + + FOREACH (test ${TEST_LIST}) + ADD_EXECUTABLE(${test} ${T_${test}_SOURCES}) + ADD_TEST(${test} ${test}) + ENDFOREACH (test) + + # Link the librairies + FOREACH (test ${TEST_LIST}) + TARGET_LINK_LIBRARIES(${test} moeo eoutils eo lDTLZ) + ENDFOREACH (test) + + +###################################################################################### + diff --git a/problems/DTLZ/test/t-DTLZ.cpp b/problems/DTLZ/test/t-DTLZ.cpp new file mode 100644 index 000000000..b1d0b61d0 --- /dev/null +++ b/problems/DTLZ/test/t-DTLZ.cpp @@ -0,0 +1,62 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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) +{ + std::cout << "Run test: t-DTLZ\n"; + + std::vector bObjectives(5); + for(unsigned int i=0; i<3 ; i++) + bObjectives[i]=true; + moeoObjectiveVectorTraits::setup(5,bObjectives); + DTLZ problem; + + assert(DTLZ::ObjectiveVector::nObjectives()==5); + std::cout << "\t> nObjectives OK\n"; + + assert(problem.className()=="DTLZ"); + std::cout << "\t> className OK\n"; + + return EXIT_SUCCESS; +} + diff --git a/problems/DTLZ/test/t-DTLZ1Eval.cpp b/problems/DTLZ/test/t-DTLZ1Eval.cpp new file mode 100644 index 000000000..e600d6204 --- /dev/null +++ b/problems/DTLZ/test/t-DTLZ1Eval.cpp @@ -0,0 +1,130 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +int main(int argc, char **argv) +{ + std::vector bObjectives(3); + for(unsigned int i=0; i<3 ; i++) + bObjectives[i]=true; + moeoObjectiveVectorTraits::setup(3,bObjectives); + + std::cout << "Run test: t-DTLZ1EVAL\n"; + DTLZ problem; + + double tolerance=1e-9; + + + //test1 :Verify evaluation of objective vectors with all variables are fixed at 1.0 + std::cout << "\t> test1:\n"; + problem.resize(7); + problem[0]=1; + problem[1]=1; + problem[2]=1; + problem[3]=1; + problem[4]=1; + problem[5]=1; + problem[6]=1; + + DTLZ1Eval eval; + eval(problem); + + double res = problem.objectiveVector()[0]; + assert( (res + tolerance > 63) && (res - tolerance < 63)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test2 :Verify evaluation of objective vectors with all variables are fixed at 0.0 + std::cout << "\t> test2:\n"; + problem[0]=0; + problem[1]=0; + problem[2]=0; + problem[3]=0; + problem[4]=0; + problem[5]=0; + problem[6]=0; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 63) && (res - tolerance < 63)); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test3 :Verify evaluation of objective vectors with all variables are fixed at 0.5 + std::cout << "\t> test3:\n"; + problem[0]=0.5; + problem[1]=0.5; + problem[2]=0.5; + problem[3]=0.5; + problem[4]=0.5; + problem[5]=0.5; + problem[6]=0.5; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 0.125); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( res == 0.125); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( res == 0.25); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + return EXIT_SUCCESS; +} + diff --git a/problems/DTLZ/test/t-DTLZ2Eval.cpp b/problems/DTLZ/test/t-DTLZ2Eval.cpp new file mode 100644 index 000000000..03ecaff86 --- /dev/null +++ b/problems/DTLZ/test/t-DTLZ2Eval.cpp @@ -0,0 +1,131 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +int main(int argc, char **argv) +{ + std::vector bObjectives(3); + for(unsigned int i=0; i<3 ; i++) + bObjectives[i]=true; + moeoObjectiveVectorTraits::setup(3,bObjectives); + + std::cout << "Run test: t-DTLZ2EVAL\n"; + DTLZ problem; + + double tolerance=1e-9; + + //test1 :Verify evaluation of objective vectors with all variables are fixed at 1.0 + std::cout << "\t> test1:\n"; + problem.resize(7); + problem[0]=1; + problem[1]=1; + problem[2]=1; + problem[3]=1; + problem[4]=1; + problem[5]=1; + problem[6]=1; + + DTLZ2Eval eval; + eval(problem); + + double res = problem.objectiveVector()[0]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( res == 2.25); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test2 :Verify evaluation of objective vectors with all variables are fixed at 0.0 + std::cout << "\t> test2:\n"; + problem[0]=0; + problem[1]=0; + problem[2]=0; + problem[3]=0; + problem[4]=0; + problem[5]=0; + problem[6]=0; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 2.25); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test3 :Verify evaluation of objective vectors with all variables are fixed at 0.5 + std::cout << "\t> test3:\n"; + problem[0]=0.5; + problem[1]=0.5; + problem[2]=0.5; + problem[3]=0.5; + problem[4]=0.5; + problem[5]=0.5; + problem[6]=0.5; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > sin(M_PI/4)) && (res - tolerance < sin(M_PI/4))); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + return EXIT_SUCCESS; +} + diff --git a/problems/DTLZ/test/t-DTLZ3Eval.cpp b/problems/DTLZ/test/t-DTLZ3Eval.cpp new file mode 100644 index 000000000..36d60eca6 --- /dev/null +++ b/problems/DTLZ/test/t-DTLZ3Eval.cpp @@ -0,0 +1,131 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +int main(int argc, char **argv) +{ + std::vector bObjectives(3); + for(unsigned int i=0; i<3 ; i++) + bObjectives[i]=true; + moeoObjectiveVectorTraits::setup(3,bObjectives); + + std::cout << "Run test: t-DTLZ3EVAL\n"; + DTLZ problem; + + double tolerance=1e-9; + + //test1 :Verify evaluation of objective vectors with all variables are fixed at 1.0 + std::cout << "\t> test1:\n"; + problem.resize(7); + problem[0]=1; + problem[1]=1; + problem[2]=1; + problem[3]=1; + problem[4]=1; + problem[5]=1; + problem[6]=1; + + DTLZ3Eval eval; + eval(problem); + + double res = problem.objectiveVector()[0]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 126) && (res - tolerance < 126)); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test2 :Verify evaluation of objective vectors with all variables are fixed at 0.0 + std::cout << "\t> test2:\n"; + problem[0]=0; + problem[1]=0; + problem[2]=0; + problem[3]=0; + problem[4]=0; + problem[5]=0; + problem[6]=0; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( (res + tolerance > 126) && (res - tolerance < 126)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test3 :Verify evaluation of objective vectors with all variables are fixed at 0.5 + std::cout << "\t> test3:\n"; + problem[0]=0.5; + problem[1]=0.5; + problem[2]=0.5; + problem[3]=0.5; + problem[4]=0.5; + problem[5]=0.5; + problem[6]=0.5; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > sin(M_PI/4)) && (res - tolerance < sin(M_PI/4))); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + return EXIT_SUCCESS; +} + diff --git a/problems/DTLZ/test/t-DTLZ4Eval.cpp b/problems/DTLZ/test/t-DTLZ4Eval.cpp new file mode 100644 index 000000000..7eeb9a7f0 --- /dev/null +++ b/problems/DTLZ/test/t-DTLZ4Eval.cpp @@ -0,0 +1,131 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +int main(int argc, char **argv) +{ + std::vector bObjectives(3); + for(unsigned int i=0; i<3 ; i++) + bObjectives[i]=true; + moeoObjectiveVectorTraits::setup(3,bObjectives); + + std::cout << "Run test: t-DTLZ4EVAL\n"; + DTLZ problem; + + double tolerance=1e-9; + + //test1 :Verify evaluation of objective vectors with all variables are fixed at 1.0 + std::cout << "\t> test1:\n"; + problem.resize(7); + problem[0]=1; + problem[1]=1; + problem[2]=1; + problem[3]=1; + problem[4]=1; + problem[5]=1; + problem[6]=1; + + DTLZ4Eval eval(1); + eval(problem); + + double res = problem.objectiveVector()[0]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( res == 2.25); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test2 :Verify evaluation of objective vectors with all variables are fixed at 0.0 + std::cout << "\t> test2:\n"; + problem[0]=0; + problem[1]=0; + problem[2]=0; + problem[3]=0; + problem[4]=0; + problem[5]=0; + problem[6]=0; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 2.25); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test3 :Verify evaluation of objective vectors with all variables are fixed at 0.5 + std::cout << "\t> test3:\n"; + problem[0]=0.5; + problem[1]=0.5; + problem[2]=0.5; + problem[3]=0.5; + problem[4]=0.5; + problem[5]=0.5; + problem[6]=0.5; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > sin(M_PI/4)) && (res - tolerance < sin(M_PI/4))); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + return EXIT_SUCCESS; +} + diff --git a/problems/DTLZ/test/t-DTLZ5Eval.cpp b/problems/DTLZ/test/t-DTLZ5Eval.cpp new file mode 100644 index 000000000..f258242fe --- /dev/null +++ b/problems/DTLZ/test/t-DTLZ5Eval.cpp @@ -0,0 +1,132 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +int main(int argc, char **argv) +{ + std::vector bObjectives(3); + for(unsigned int i=0; i<3 ; i++) + bObjectives[i]=true; + moeoObjectiveVectorTraits::setup(3,bObjectives); + + std::cout << "Run test: t-DTLZ5EVAL\n"; + DTLZ problem; + + double tolerance=1e-9; + + + //test1 :Verify evaluation of objective vectors with all variables are fixed at 1.0 + std::cout << "\t> test1:\n"; + problem.resize(7); + problem[0]=1; + problem[1]=1; + problem[2]=1; + problem[3]=1; + problem[4]=1; + problem[5]=1; + problem[6]=1; + + DTLZ5Eval eval; + eval(problem); + + double res = problem.objectiveVector()[0]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( res == 2.25); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test2 :Verify evaluation of objective vectors with all variables are fixed at 0.0 + std::cout << "\t> test2:\n"; + problem[0]=0; + problem[1]=0; + problem[2]=0; + problem[3]=0; + problem[4]=0; + problem[5]=0; + problem[6]=0; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( (res + tolerance > 2.25 * cos(M_PI / 9)) && (res - tolerance < 2.25 * cos(M_PI / 9))); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 2.25 * sin(M_PI / 9)) && (res - tolerance < 2.25 * sin(M_PI / 9))); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 0) && (res - tolerance < 0) ); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test3 :Verify evaluation of objective vectors with all variables are fixed at 0.5 + std::cout << "\t> test3:\n"; + problem[0]=0.5; + problem[1]=0.5; + problem[2]=0.5; + problem[3]=0.5; + problem[4]=0.5; + problem[5]=0.5; + problem[6]=0.5; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > sin(M_PI/4)) && (res - tolerance < sin(M_PI/4))); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + return EXIT_SUCCESS; +} + diff --git a/problems/DTLZ/test/t-DTLZ6Eval.cpp b/problems/DTLZ/test/t-DTLZ6Eval.cpp new file mode 100644 index 000000000..86c487909 --- /dev/null +++ b/problems/DTLZ/test/t-DTLZ6Eval.cpp @@ -0,0 +1,133 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +int main(int argc, char **argv) +{ + std::vector bObjectives(3); + for(unsigned int i=0; i<3 ; i++) + bObjectives[i]=true; + moeoObjectiveVectorTraits::setup(3,bObjectives); + + std::cout << "Run test: t-DTLZ6EVAL\n"; + DTLZ problem; + + double tolerance=1e-9; + + //test1 :Verify evaluation of objective vectors with all variables are fixed at 1.0 + std::cout << "\t> test1:\n"; + problem.resize(7); + problem[0]=1; + problem[1]=1; + problem[2]=1; + problem[3]=1; + problem[4]=1; + problem[5]=1; + problem[6]=1; + + DTLZ6Eval eval; + eval(problem); + + double res = problem.objectiveVector()[0]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 6) && (res - tolerance < 6)); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test2 :Verify evaluation of objective vectors with all variables are fixed at 0.0 + std::cout << "\t> test2:\n"; + problem[0]=0; + problem[1]=0; + problem[2]=0; + problem[3]=0; + problem[4]=0; + problem[5]=0; + problem[6]=0; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( (res + tolerance > sqrt(2)/2) && (res - tolerance < sqrt(2)/2)); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > sqrt(2)/2) && (res - tolerance < sqrt(2)/2)); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > 0) && (res - tolerance < 0)); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test3 :Verify evaluation of objective vectors with all variables are fixed at 0.5 + std::cout << "\t> test3:\n"; + problem[0]=0.5; + problem[1]=0.5; + problem[2]=0.5; + problem[3]=0.5; + problem[4]=0.5; + problem[5]=0.5; + problem[6]=0.5; + + problem.invalidate(); + eval(problem); + + double aux= 5 * pow(0.5,0.1); + + res = problem.objectiveVector()[0]; + assert( (res + tolerance > (1 + aux) / 2) && (res + tolerance > (res + tolerance > (1 + aux) / 2))); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( (res + tolerance > (1 + aux) / 2) && (res + tolerance > (res + tolerance > (1 + aux) / 2))); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( (res + tolerance > (1 + aux) * sqrt(2)/ 2) && (res + tolerance > (res + tolerance > (1 + aux) * sqrt(2)/ 2))); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + return EXIT_SUCCESS; +} + diff --git a/problems/DTLZ/test/t-DTLZ7Eval.cpp b/problems/DTLZ/test/t-DTLZ7Eval.cpp new file mode 100644 index 000000000..394a45f26 --- /dev/null +++ b/problems/DTLZ/test/t-DTLZ7Eval.cpp @@ -0,0 +1,131 @@ +/* +* +* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008 +* (C) OPAC Team, LIFL, 2002-2008 +* +* Arnaud Liefooghe +* Jeremie Humeau +* +* 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 + +#define M_PI 3.14159265358979323846 + +int main(int argc, char **argv) +{ + std::vector bObjectives(3); + for(unsigned int i=0; i<3 ; i++) + bObjectives[i]=true; + moeoObjectiveVectorTraits::setup(3,bObjectives); + + std::cout << "Run test: t-DTLZ7EVAL\n"; + DTLZ problem; + + double tolerance=1e-9; + + //test1 :Verify evaluation of objective vectors with all variables are fixed at 1.0 + std::cout << "\t> test1:\n"; + problem.resize(7); + problem[0]=1; + problem[1]=1; + problem[2]=1; + problem[3]=1; + problem[4]=1; + problem[5]=1; + problem[6]=1; + + DTLZ7Eval eval; + eval(problem); + + double res = problem.objectiveVector()[0]; + assert( res == 1); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( res == 1); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( res == 31); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test2 :Verify evaluation of objective vectors with all variables are fixed at 0.0 + std::cout << "\t> test2:\n"; + problem[0]=0; + problem[1]=0; + problem[2]=0; + problem[3]=0; + problem[4]=0; + problem[5]=0; + problem[6]=0; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 0); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( res == 0); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert( res == 6); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + //test3 :Verify evaluation of objective vectors with all variables are fixed at 0.5 + std::cout << "\t> test3:\n"; + problem[0]=0.5; + problem[1]=0.5; + problem[2]=0.5; + problem[3]=0.5; + problem[4]=0.5; + problem[5]=0.5; + problem[6]=0.5; + + problem.invalidate(); + eval(problem); + + res = problem.objectiveVector()[0]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[0] OK\n"; + res = problem.objectiveVector()[1]; + assert( res == 0.5); + std::cout << "\t\t- objectiveVector[1] OK\n"; + res = problem.objectiveVector()[2]; + assert(res == 19.5); + std::cout << "\t\t- objectiveVector[2] OK\n"; + + return EXIT_SUCCESS; +} +