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

Some files were not shown because too many files have changed in this diff Show more