This commit is contained in:
manu 2014-09-25 15:28:21 +02:00
commit 521c7e5bf5
64 changed files with 4770 additions and 0 deletions

View file

@ -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)
######################################################################################

45
problems/DTLZ/README.txt Normal file
View file

@ -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

View file

@ -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)
######################################################################################

View file

@ -0,0 +1,172 @@
// moeo general include
#include <iostream>
#include <fstream>
#include <moeo>
#include <es/eoRealInitBounded.h>
// how to initialize the population
#include <do/make_pop.h>
// the stopping criterion
#include <do/make_continue_moeo.h>
// outputs (stats, population dumps, ...)
#include <do/make_checkpoint_moeo.h>
// evolution engine (selection and replacement)
#include <do/make_ea_moeo.h>
// simple call to the algo
#include <do/make_run.h>
// checks for help demand, and writes the status file and make_help; in libutils
void make_help(eoParser & _parser);
// definition of the representation
#include <DTLZ.h>
#include <DTLZ1Eval.h>
#include <DTLZ2Eval.h>
#include <DTLZ3Eval.h>
#include <DTLZ4Eval.h>
#include <DTLZ5Eval.h>
#include <DTLZ6Eval.h>
#include <DTLZ7Eval.h>
#include <SBXCrossover.h>
#include <PolynomialMutation.h>
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 <bool> bObjectives(NB_OBJ);
for (unsigned int i=0; i<NB_OBJ ; i++)
bObjectives[i]=true;
moeoObjectiveVectorTraits::setup(NB_OBJ,bObjectives);
// The fitness evaluation
eoEvalFunc <DTLZ> * 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 <DTLZ> 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<DTLZ> term(MAX_GEN);
eoEvalFuncCounter<DTLZ> evalFunc(*eval);
/*eoTimeContinue<DTLZ> timeContinuator(TIME);
eoCheckPoint<DTLZ> checkpoint(timeContinuator);*/
eoCheckPoint<DTLZ>* checkpoint;
if (TIME > 0)
checkpoint = new eoCheckPoint<DTLZ>(*(new eoTimeContinue<DTLZ>(TIME)));
else if (NB_EVAL > 0)
checkpoint = new eoCheckPoint<DTLZ>(*(new eoEvalContinue<DTLZ>(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<DTLZ> algo(*checkpoint, *eval ,op);
moeoAdditiveEpsilonBinaryMetric < DTLZObjectiveVector > metric;
moeoIBEA<DTLZ> algo(*checkpoint, evalFunc ,op, metric);
/*** Go ! ***/
// help ?
eoPop<DTLZ>& pop = do_make_pop(parser, state, init);
make_help(parser);
// run the algo
do_run(algo, pop);
moeoUnboundedArchive<DTLZ> 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<NB_OBJ; j++) {
outfile << finalArchive[i].objectiveVector()[j];
if (j != NB_OBJ -1)
outfile << " ";
}
outfile << endl;
}
outfile.close();
}
catch (exception& e)
{
cout << e.what() << endl;
}
return EXIT_SUCCESS;
}

View file

@ -0,0 +1,169 @@
// moeo general include
#include <iostream>
#include <fstream>
#include <moeo>
#include <es/eoRealInitBounded.h>
// how to initialize the population
#include <do/make_pop.h>
// the stopping criterion
#include <do/make_continue_moeo.h>
// outputs (stats, population dumps, ...)
#include <do/make_checkpoint_moeo.h>
// evolution engine (selection and replacement)
#include <do/make_ea_moeo.h>
// simple call to the algo
#include <do/make_run.h>
// checks for help demand, and writes the status file and make_help; in libutils
void make_help(eoParser & _parser);
// definition of the representation
#include <DTLZ.h>
#include <DTLZ1Eval.h>
#include <DTLZ2Eval.h>
#include <DTLZ3Eval.h>
#include <DTLZ4Eval.h>
#include <DTLZ5Eval.h>
#include <DTLZ6Eval.h>
#include <DTLZ7Eval.h>
#include <SBXCrossover.h>
#include <PolynomialMutation.h>
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 <bool> bObjectives(NB_OBJ);
for (unsigned int i=0; i<NB_OBJ ; i++)
bObjectives[i]=true;
moeoObjectiveVectorTraits::setup(NB_OBJ,bObjectives);
// The fitness evaluation
eoEvalFunc <DTLZ> * 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 <DTLZ> 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<DTLZ> term(MAX_GEN);
eoEvalFuncCounter<DTLZ> evalFunc(*eval);
/*eoTimeContinue<DTLZ> timeContinuator(TIME);
eoCheckPoint<DTLZ> checkpoint(timeContinuator);*/
eoCheckPoint<DTLZ>* checkpoint;
if (TIME > 0)
checkpoint = new eoCheckPoint<DTLZ>(*(new eoTimeContinue<DTLZ>(TIME)));
else if (NB_EVAL > 0)
checkpoint = new eoCheckPoint<DTLZ>(*(new eoEvalContinue<DTLZ>(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<DTLZ> algo(*checkpoint, evalFunc ,op);
/*moeoAdditiveEpsilonBinaryMetric < DTLZObjectiveVector > metric;
moeoIBEA<DTLZ> algo(checkpoint, eval ,op, metric);*/
/*** Go ! ***/
// help ?
eoPop<DTLZ>& pop = do_make_pop(parser, state, init);
make_help(parser);
// run the algo
do_run(algo, pop);
moeoUnboundedArchive<DTLZ> 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<NB_OBJ; j++) {
outfile << finalArchive[i].objectiveVector()[j];
if (j != NB_OBJ -1)
outfile << " ";
}
outfile << endl;
}
outfile.close();
}
catch (exception& e)
{
cout << e.what() << endl;
}
return EXIT_SUCCESS;
}

View file

@ -0,0 +1,190 @@
// moeo general include
#include <iostream>
#include <fstream>
#include <moeo>
#include <es/eoRealInitBounded.h>
// how to initialize the population
#include <do/make_pop.h>
// the stopping criterion
#include <do/make_continue_moeo.h>
// outputs (stats, population dumps, ...)
#include <do/make_checkpoint_moeo.h>
// evolution engine (selection and replacement)
#include <do/make_ea_moeo.h>
// simple call to the algo
#include <do/make_run.h>
#include <algo/moeoSPEA2.h>
#include <archive/moeoSPEA2Archive.h>
// checks for help demand, and writes the status file and make_help; in libutils
void make_help(eoParser & _parser);
// definition of the representation
#include <DTLZ.h>
#include <DTLZ1Eval.h>
#include <DTLZ2Eval.h>
#include <DTLZ3Eval.h>
#include <DTLZ4Eval.h>
#include <DTLZ5Eval.h>
#include <DTLZ6Eval.h>
#include <DTLZ7Eval.h>
#include <SBXCrossover.h>
#include <PolynomialMutation.h>
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 <bool> bObjectives(NB_OBJ);
for (unsigned int i=0; i<NB_OBJ ; i++)
bObjectives[i]=true;
moeoObjectiveVectorTraits::setup(NB_OBJ,bObjectives);
// The fitness evaluation
eoEvalFunc <DTLZ> * 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 <DTLZ> 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<DTLZ> arch(ARC_SIZE);
//moeoUnboundedArchive<DTLZ> arch;
// stopping criteria
eoGenContinue<DTLZ> term(MAX_GEN);
eoEvalFuncCounter<DTLZ> evalFunc(*eval);
/*eoTimeContinue<DTLZ> timeContinuator(TIME);
eoCheckPoint<DTLZ> checkpoint(timeContinuator);*/
eoCheckPoint<DTLZ>* checkpoint;
if (TIME > 0)
checkpoint = new eoCheckPoint<DTLZ>(*(new eoTimeContinue<DTLZ>(TIME)));
else if (NB_EVAL > 0)
checkpoint = new eoCheckPoint<DTLZ>(*(new eoEvalContinue<DTLZ>(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<DTLZ> 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<DTLZ> algo(checkpoint, eval ,op);
/*moeoAdditiveEpsilonBinaryMetric < DTLZObjectiveVector > metric;
moeoIBEA<DTLZ> algo(checkpoint, eval ,op, metric);*/
/*** Go ! ***/
// help ?
eoPop<DTLZ>& pop = do_make_pop(parser, state, init);
// run the algo
make_help(parser);
do_run(algo, pop);
moeoUnboundedArchive<DTLZ> 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<NB_OBJ; j++) {
outfile << finalArchive[i].objectiveVector()[j];
if (j != NB_OBJ -1)
outfile << " ";
}
outfile << endl;
}
outfile.close();
}
catch (exception& e)
{
cout << e.what() << endl;
}
return EXIT_SUCCESS;
}

View file

@ -0,0 +1,28 @@
###### General ######
# --help=0 # -h : Prints this message
# --stopOnUnknownParam=1 # Stop if unkown param entered
# --seed=1238424544 # -S : Random number seed
###### Evolution Engine ######
# --popSize=20 # -P : Population Size
###### Output ######
--outputFile=IBEA.out # -o : Path of the output file
###### Param ######
# --maxGen=10000 # -G : Maximum number of generations
--pCross=1 # -C : Crossover probability
--extPMut=1 # -E : External Mutation probability
--intPMut=0.083333 # -I : Internal Mutation probability
--vecSize=30 # -V : Genotype Size
--nbObj=3 # -N : Number of Objective
--eval=1 # -F : Number of the DTLZ evaluation fonction
--dtlz4_param=100 # -P : Parameter of the DTLZ4 evaluation fonction
--nbEval=500 # -P : Number of evaluation before Stop
--time=0 # -T : Time(seconds) before Stop
###### Persistence ######
# --Load= # -L : A save file to restart from
# --recomputeFitness=0 # -r : Recompute the fitness after re-loading the pop.?
# --status=./build/application/DTLZ_IBEA.status # Status file

View file

@ -0,0 +1,28 @@
###### General ######
# --help=0 # -h : Prints this message
# --stopOnUnknownParam=1 # Stop if unkown param entered
# --seed=1238424545 # -S : Random number seed
###### Evolution Engine ######
# --popSize=20 # -P : Population Size
###### Output ######
--outputFile=NSGAII.out # -o : Path of the output file
###### Param ######
# --maxGen=10000 # -G : Maximum number of generations
--pCross=1 # -C : Crossover probability
--extPMut=1 # -E : External Mutation probability
--intPMut=0.083333 # -I : Internal Mutation probability
--vecSize=30 # -V : Genotype Size
--nbObj=3 # -N : Number of Objective
--eval=1 # -F : Number of the DTLZ evaluation fonction
--dtlz4_param=100 # -P : Parameter of the DTLZ4 evaluation fonction
--nbEval=500 # -P : Number of evaluation before Stop
--time=0 # -T : Time(seconds) before Stop
###### Persistence ######
# --Load= # -L : A save file to restart from
# --recomputeFitness=0 # -r : Recompute the fitness after re-loading the pop.?
# --status=./build/application/DTLZ_NSGAII.status # Status file

View file

@ -0,0 +1,30 @@
###### General ######
# --help=0 # -h : Prints this message
# --stopOnUnknownParam=1 # Stop if unkown param entered
# --seed=1238424543 # -S : Random number seed
###### Evolution Engine ######
# --popSize=20 # -P : Population Size
###### Output ######
--outputFile=SPEA2.out # -o : Path of the output file
###### Param ######
--arcSize=100 # -A : Archive size
# --maxGen=10000 # -G : Maximum number of generations
--pCross=1 # -C : Crossover probability
--extPMut=1 # -E : External Mutation probability
--intPMut=0.083333 # -I : Internal Mutation probability
--vecSize=30 # -V : Genotype Size
--nbObj=3 # -N : Number of Objective
--k=10 # -K : k-th nearest neighbor
--eval=1 # -F : Number of the DTLZ evaluation fonction
--dtlz4_param=100 # -P : Parameter of the DTLZ4 evaluation fonction
--nbEval=500 # -P : Number of evaluation before Stop
--time=0 # -T : Time(seconds) before Stop
###### Persistence ######
# --Load= # -L : A save file to restart from
# --recomputeFitness=0 # -r : Recompute the fitness after re-loading the pop.?
# --status=./build/application/DTLZ_SPEA2.status # Status file

View file

@ -0,0 +1,26 @@
##########################################################################################
### MOEO Doc generation using Doxygen
##########################################################################################
IF (DOXYGEN_FOUND)
SET(DOC_DIR ${CMAKE_BINARY_DIR}/doc CACHE PATH "MOEO documentation directory")
SET(MOEO_DOC_CONFIG_FILE "moeo.doxyfile" CACHE PATH "MOEO documentation configuration file")
# define the doc target
IF (DOXYGEN_EXECUTABLE)
ADD_CUSTOM_TARGET(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${MOEO_DOC_CONFIG_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
ENDIF (DOXYGEN_EXECUTABLE)
# configure doxyfile file
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/doc/${MOEO_DOC_CONFIG_FILE}.cmake"
"${CMAKE_BINARY_DIR}/doc/${MOEO_DOC_CONFIG_FILE}")
ELSE (DOXYGEN_FOUND)
MESSAGE(STATUS "Unable to generate the documentation, Doxygen package not found")
ENDIF (DOXYGEN_FOUND)
##########################################################################################

View file

@ -0,0 +1,433 @@
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
BODY,TD {
font-size: 90%;
}
H1 {
text-align: center;
font-size: 160%;
}
H2 {
font-size: 120%;
}
H3 {
font-size: 100%;
}
CAPTION {
font-weight: bold
}
DIV.qindex {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navpath {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navtab {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
TD.navtab {
font-size: 70%;
}
A.qindex {
text-decoration: none;
font-weight: bold;
color: #1A419D;
}
A.qindex:visited {
text-decoration: none;
font-weight: bold;
color: #1A419D
}
A.qindex:hover {
text-decoration: none;
background-color: #ddddff;
}
A.qindexHL {
text-decoration: none;
font-weight: bold;
background-color: #6666cc;
color: #ffffff;
border: 1px double #9295C2;
}
A.qindexHL:hover {
text-decoration: none;
background-color: #6666cc;
color: #ffffff;
}
A.qindexHL:visited {
text-decoration: none;
background-color: #6666cc;
color: #ffffff
}
A.el {
text-decoration: none;
font-weight: bold
}
A.elRef {
font-weight: bold
}
A.code:link {
text-decoration: none;
font-weight: normal;
color: #0000FF
}
A.code:visited {
text-decoration: none;
font-weight: normal;
color: #0000FF
}
A.codeRef:link {
font-weight: normal;
color: #0000FF
}
A.codeRef:visited {
font-weight: normal;
color: #0000FF
}
A:hover {
text-decoration: none;
background-color: #f2f2ff
}
DL.el {
margin-left: -1cm
}
.fragment {
font-family: monospace, fixed;
font-size: 95%;
}
PRE.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
margin-top: 4px;
margin-bottom: 4px;
margin-left: 2px;
margin-right: 8px;
padding-left: 6px;
padding-right: 6px;
padding-top: 4px;
padding-bottom: 4px;
}
DIV.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px
}
DIV.groupHeader {
margin-left: 16px;
margin-top: 12px;
margin-bottom: 6px;
font-weight: bold;
}
DIV.groupText {
margin-left: 16px;
font-style: italic;
font-size: 90%
}
BODY {
background: white;
color: black;
margin-right: 20px;
margin-left: 20px;
}
TD.indexkey {
background-color: #e8eef2;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TD.indexvalue {
background-color: #e8eef2;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TR.memlist {
background-color: #f0f0f0;
}
P.formulaDsp {
text-align: center;
}
IMG.formulaDsp {
}
IMG.formulaInl {
vertical-align: middle;
}
SPAN.keyword { color: #008000 }
SPAN.keywordtype { color: #604020 }
SPAN.keywordflow { color: #e08000 }
SPAN.comment { color: #800000 }
SPAN.preprocessor { color: #806020 }
SPAN.stringliteral { color: #002080 }
SPAN.charliteral { color: #008080 }
SPAN.vhdldigit { color: #ff00ff }
SPAN.vhdlchar { color: #000000 }
SPAN.vhdlkeyword { color: #700070 }
SPAN.vhdllogic { color: #ff0000 }
.mdescLeft {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.mdescRight {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.memItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplParams {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
color: #606060;
background-color: #FAFAFA;
font-size: 80%;
}
.search {
color: #003399;
font-weight: bold;
}
FORM.search {
margin-bottom: 0px;
margin-top: 0px;
}
INPUT.search {
font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #e8eef2;
}
TD.tiny {
font-size: 75%;
}
a {
color: #1A41A8;
}
a:visited {
color: #2A3798;
}
.dirtab {
padding: 4px;
border-collapse: collapse;
border: 1px solid #84b0c7;
}
TH.dirtab {
background: #e8eef2;
font-weight: bold;
}
HR {
height: 1px;
border: none;
border-top: 1px solid black;
}
/* Style for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #606060;
font-weight: normal;
margin-left: 3px;
}
.memnav {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.memitem {
padding: 4px;
background-color: #eef3f5;
border-width: 1px;
border-style: solid;
border-color: #dedeee;
-moz-border-radius: 8px 8px 8px 8px;
}
.memname {
white-space: nowrap;
font-weight: bold;
}
.memdoc{
padding-left: 10px;
}
.memproto {
background-color: #d5e1e8;
width: 100%;
border-width: 1px;
border-style: solid;
border-color: #84b0c7;
font-weight: bold;
-moz-border-radius: 8px 8px 8px 8px;
}
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #602020;
font-style: italic;
white-space: nowrap;
}
/* End Styling for detailed member documentation */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin:0.5em;
}
.directory {
font-size: 9pt;
font-weight: bold;
}
.directory h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
.directory > h3 {
margin-top: 0;
}
.directory p {
margin: 0px;
white-space: nowrap;
}
.directory div {
display: none;
margin: 0px;
}
.directory img {
vertical-align: -30%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

117
problems/DTLZ/doc/html/installdox Executable file
View file

@ -0,0 +1,117 @@
#!/usr/bin/perl
%subst = ( "eo.doxytag", "");
$quiet = 0;
if (open(F,"search.cfg"))
{
$_=<F> ; s/[ \t\n]*$//g ; $subst{"_doc"} = $_;
$_=<F> ; 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 (<F>) {
s/doxygen\=\"([^ \"\:\t\>\<]*)\:([^ \"\t\>\<]*)\" (href|src)=\"\2/doxygen\=\"$1:$subst{$1}\" \3=\"$subst{$1}/g;
print G "$_";
}
}
else {
while (<F>) {
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;
}

Binary file not shown.

View file

@ -0,0 +1,382 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Search</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="classes.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
<?php
function search_results()
{
return "Search Results";
}
function matches_text($num)
{
if ($num==0)
{
return "Sorry, no documents matching your query.";
}
else if ($num==1)
{
return "Found <b>1</b> document matching your query.";
}
else // $num>1
{
return "Found <b>$num</b> documents matching your query. Showing best matches first.";
}
}
function report_matches()
{
return "Matches: ";
}
function end_form($value)
{
echo " <td><input type=\"text\" name=\"query\" value=\"$value\" size=\"20\" accesskey=\"s\"/></td>\n </tr>\n </table>\n </form>\n </li>\n </ul>\n</div>\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<sizeof($statsList);$count++)
{
$statInfo = &$statsList[$count];
$multiplier = 1;
// whole word matches have a double weight
if ($statInfo["full"]) $multiplier=2;
fseek($file,$statInfo["index"]);
$numDocs = readInt($file);
$docInfo = array();
// read docs info + occurrence frequency of the word
for ($i=0;$i<$numDocs;$i++)
{
$idx=readInt($file);
$freq=readInt($file);
$docInfo[$i]=array("idx" => $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<sizeof($statsList);$count++)
{
$statInfo = &$statsList[$count];
$multiplier = 1;
// whole word matches have a double weight
if ($statInfo["full"]) $multiplier=2;
for ($i=0;$i<sizeof($statInfo["docs"]);$i++)
{
$docInfo = &$statInfo["docs"];
// compute frequency rank of the word in each doc
$freq=$docInfo[$i]["freq"];
if ($docInfo[$i]["hi"])
{
$statInfo["docs"][$i]["rank"]=
(float)($freq*$multiplier+$totalFreqLo)/$totalFreq;
}
else
{
$statInfo["docs"][$i]["rank"]=
(float)($freq*$multiplier)/$totalFreq;
}
}
}
}
}
return $statsList;
}
function combine_results($results,&$docs)
{
foreach ($results as $wordInfo)
{
$docsList = &$wordInfo["docs"];
foreach ($docsList as $di)
{
$key=$di["url"];
$rank=$di["rank"];
if (in_array($key, array_keys($docs)))
{
$docs[$key]["rank"]+=$rank;
}
else
{
$docs[$key] = array("url"=>$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 "<table cellspacing=\"2\">\n";
echo " <tr>\n";
echo " <td colspan=\"2\"><h2>".search_results()."</h2></td>\n";
echo " </tr>\n";
$numDocs = sizeof($docs);
if ($numDocs==0)
{
echo " <tr>\n";
echo " <td colspan=\"2\">".matches_text(0)."</td>\n";
echo " </tr>\n";
}
else
{
echo " <tr>\n";
echo " <td colspan=\"2\">".matches_text($numDocs);
echo "\n";
echo " </td>\n";
echo " </tr>\n";
$num=1;
foreach ($docs as $doc)
{
echo " <tr>\n";
echo " <td align=\"right\">$num.</td>";
echo "<td><a class=\"el\" href=\"".$doc["url"]."\">".$doc["name"]."</a></td>\n";
echo " <tr>\n";
echo " <td></td><td class=\"tiny\">".report_matches()." ";
foreach ($doc["words"] as $wordInfo)
{
$word = $wordInfo["word"];
$matchRight = substr($wordInfo["match"],strlen($word));
echo "<b>$word</b>$matchRight(".$wordInfo["freq"].") ";
}
echo " </td>\n";
echo " </tr>\n";
$num++;
}
}
echo "</table>\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 "&nbsp;\n<div class=\"searchresults\">\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 "</div>\n";
fclose($file);
}
main();
?>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Mar 30 14:40:04 2009 for DTLZ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -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;
}

57
problems/DTLZ/doc/index.h Normal file
View file

@ -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 <a href="http://paradiseo.gforge.inria.fr">ParadisEO website</a>.
@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 <a href="http://paradiseo.gforge.inria.fr">homepage</a>
- INRIA GForge <a href="http://gforge.inria.fr/projects/paradiseo/">project page</a>
- Fore any questions, please contact paradiseo-help@lists.gforge.inria.fr
*/

View file

@ -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

View file

@ -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)
#########################################################################################################

50
problems/DTLZ/run.sh Normal file
View file

@ -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

View file

@ -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})
######################################################################################

View file

@ -0,0 +1,44 @@
/*
* <DTLZ.cpp>
* 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 <DTLZ.h>
std::string DTLZ::className() const
{
return "DTLZ";
}

58
problems/DTLZ/src/DTLZ.h Normal file
View file

@ -0,0 +1,58 @@
/*
* <DTLZ.h>
* 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 <DTLZObjectiveVector.h>
/**
* 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_*/

View file

@ -0,0 +1,74 @@
/*
* <DTLZ1Eval.cpp>
* 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 <DTLZ1Eval.h>
#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);
}
}

View file

@ -0,0 +1,58 @@
/*
* <DTLZ1Eval.h>
* 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 <DTLZ.h>
/**
* DTLZ1 Evaluation Fonction
*/
class DTLZ1Eval : public moeoEvalFunc <DTLZ>
{
public:
/**
* operator evaluates a genotype
*/
void operator () (DTLZ & _element);
};
#endif /*DSTLZ1EVAL_H_*/

View file

@ -0,0 +1,73 @@
/*
* <DTLZ2Eval.cpp>
* 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 <DTLZ2Eval.h>
#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);
}
}

View file

@ -0,0 +1,57 @@
/*
* <DTLZ2Eval.h>
* 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 <DTLZ.h>
/**
* DTLZ2 Evaluation Fonction
*/
class DTLZ2Eval : public moeoEvalFunc <DTLZ>
{
public:
/**
* operator evaluates a genotype
*/
void operator () (DTLZ & _element);
};
#endif /*DTLZ2EVAL_H_*/

View file

@ -0,0 +1,74 @@
/*
* <DTLZ3Eval.cpp>
* 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 <DTLZ3Eval.h>
#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);
}
}

View file

@ -0,0 +1,58 @@
/*
* <DTLZ3Eval.h>
* 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 <DTLZ.h>
/**
* DTLZ3 Evaluation Fonction
*/
class DTLZ3Eval : public moeoEvalFunc <DTLZ>
{
public:
/**
* operator evaluates a genotype
*/
void operator () (DTLZ & _element);
};
#endif /*DTLZ3EVAL_H_*/

View file

@ -0,0 +1,75 @@
/*
* <DTLZ4Eval.cpp>
* 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 <DTLZ4Eval.h>
#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);
}
}

View file

@ -0,0 +1,68 @@
/*
* <DTLZ4Eval.h>
* 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 <DTLZ.h>
/**
* DTLZ4 Evaluation Fonction
*/
class DTLZ4Eval : public moeoEvalFunc <DTLZ>
{
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_*/

View file

@ -0,0 +1,82 @@
/*
* <DTLZ5Eval.cpp>
* 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 <DTLZ5Eval.h>
#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);
}
}

View file

@ -0,0 +1,59 @@
/*
* <DTLZ5Eval.h>
* 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 <DTLZ.h>
/**
* DTLZ5 Evaluation Fonction
*/
class DTLZ5Eval : public moeoEvalFunc <DTLZ>
{
public:
/**
* operator evaluates a genotype
*/
void operator () (DTLZ & _element);
};
#endif /*DTLZ5EVAL_H_*/

View file

@ -0,0 +1,81 @@
/*
* <DTLZ6Eval.cpp>
* 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 <DTLZ6Eval.h>
#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);
}
}

View file

@ -0,0 +1,60 @@
/*
* <DTLZ6Eval.h>
* 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 <DTLZ.h>
/**
* DTLZ6 Evaluation Fonction
*/
class DTLZ6Eval : public moeoEvalFunc <DTLZ>
{
public:
/**
* operator evaluates a genotype
*/
void operator () (DTLZ & _element);
};
#endif /*DTLZ6EVAL_H_*/

View file

@ -0,0 +1,74 @@
/*
* <DTLZ7Eval.cpp>
* 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 <DTLZ7Eval.h>
#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);
}
}

View file

@ -0,0 +1,59 @@
/*
* <DTLZ7Eval.h>
* 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 <DTLZ.h>
/**
* DTLZ7 Evaluation Fonction
*/
class DTLZ7Eval : public moeoEvalFunc <DTLZ>
{
public:
/**
* operator evaluates a genotype
*/
void operator () (DTLZ & _element);
};
#endif /*DTLZ7EVAL_H_*/

View file

@ -0,0 +1,47 @@
/*
* <DTLZObjectiveVector.h>
* 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 <moeo>
/** define DTLZ Objective vector as a vector of double*/
typedef moeoRealObjectiveVector<moeoObjectiveVectorTraits> DTLZObjectiveVector;
#endif /*DTLZOBJECTIVEVECTOR_H_*/

View file

@ -0,0 +1,123 @@
/*
* <PolynomialMutation.h>
* 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 <utils/eoRealVectorBounds.h>
template<class EOT> class PolynomialMutation: public eoMonOp<EOT>
{
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_*/

View file

@ -0,0 +1,194 @@
/*
* <SBXCrossover.h>
* 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 <algorithm> // swap_ranges
#include <utils/eoParser.h>
#include <utils/eoRNG.h>
#include <es/eoReal.h>
#include <utils/eoRealBounds.h>
#include <utils/eoRealVectorBounds.h>
template<class EOT> class SBXCrossover: public eoQuadOp<EOT>
{
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_*/

View file

@ -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)
######################################################################################

View file

@ -0,0 +1,62 @@
/*
* <t-DTLZ.cpp>
* 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 <iostream>
#include <moeo>
#include <DTLZ.h>
#include <assert.h>
int main(int argc, char **argv)
{
std::cout << "Run test: t-DTLZ\n";
std::vector <bool> 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;
}

View file

@ -0,0 +1,130 @@
/*
* <t-DTLZ1Eval.cpp>
* 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 <iostream>
#include <moeo>
#include <DTLZ.h>
#include <assert.h>
#include <DTLZ1Eval.h>
int main(int argc, char **argv)
{
std::vector <bool> 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;
}

View file

@ -0,0 +1,131 @@
/*
* <t-DTLZ2Eval.cpp>
* 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 <iostream>
#include <moeo>
#include <DTLZ.h>
#include <assert.h>
#include <DTLZ2Eval.h>
#define M_PI 3.14159265358979323846
int main(int argc, char **argv)
{
std::vector <bool> 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;
}

View file

@ -0,0 +1,131 @@
/*
* <t-DTLZ3Eval.cpp>
* 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 <iostream>
#include <moeo>
#include <DTLZ.h>
#include <assert.h>
#include <DTLZ3Eval.h>
#define M_PI 3.14159265358979323846
int main(int argc, char **argv)
{
std::vector <bool> 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;
}

View file

@ -0,0 +1,131 @@
/*
* <t-DTLZ4Eval.cpp>
* 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 <iostream>
#include <moeo>
#include <DTLZ.h>
#include <assert.h>
#include <DTLZ4Eval.h>
#define M_PI 3.14159265358979323846
int main(int argc, char **argv)
{
std::vector <bool> 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;
}

View file

@ -0,0 +1,132 @@
/*
* <t-DTLZ5Eval.cpp>
* 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 <iostream>
#include <moeo>
#include <DTLZ.h>
#include <assert.h>
#include <DTLZ5Eval.h>
#define M_PI 3.14159265358979323846
int main(int argc, char **argv)
{
std::vector <bool> 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;
}

View file

@ -0,0 +1,133 @@
/*
* <t-DTLZ6Eval.cpp>
* 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 <iostream>
#include <moeo>
#include <DTLZ.h>
#include <assert.h>
#include <DTLZ6Eval.h>
#define M_PI 3.14159265358979323846
int main(int argc, char **argv)
{
std::vector <bool> 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;
}

View file

@ -0,0 +1,131 @@
/*
* <t-DTLZ7Eval.cpp>
* 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 <iostream>
#include <moeo>
#include <DTLZ.h>
#include <assert.h>
#include <DTLZ7Eval.h>
#define M_PI 3.14159265358979323846
int main(int argc, char **argv)
{
std::vector <bool> 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;
}