New config of Paradiseo with Cmake 2.6

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1347 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jhumeau 2009-01-16 14:28:26 +00:00
commit 712e8d6cfa
84 changed files with 1468 additions and 739 deletions

View file

@ -3,7 +3,7 @@
######################################################################################
# check cmake version compatibility
CMAKE_MINIMUM_REQUIRED(VERSION 2.4 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
# regular expression checking
INCLUDE_REGULAR_EXPRESSION("^.*$" "^$")
@ -26,7 +26,9 @@ INCLUDE(FindGnuplot)
INCLUDE(CheckLibraryExists)
INCLUDE(Dart OPTIONAL)
INCLUDE(Dart OPTIONAL)
INCLUDE(CPack)
# Set a special flag if the environment is windows (should do the same in a config.g file)
IF (WIN32)
@ -70,7 +72,7 @@ IF(WIN32 AND NOT CYGWIN)
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 -Wno-ignored-qualifiers")
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)
@ -82,6 +84,11 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
#####################################################################################
######################################################################################
### compilation of examples?
######################################################################################
SET(ENABLE_CMAKE_EXAMPLE TRUE CACHE BOOL "Enable copy of benchs and parameters file?")
######################################################################################
### Test config

View file

@ -1,3 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
##########################################################################################################################################
### 0) If you want to set your own variables in mo-conf.cmake and avoid the cmd line
@ -17,10 +18,10 @@ PROJECT(ParadisEO-MO)
SET(PACKAGE_BUGREPORT "paradiseo-help@lists.gforge.inria.fr" CACHE STRING "Package bug report" FORCE)
SET(PACKAGE_NAME "ParadisEO-MO - Moving Objects" CACHE STRING "Package name" FORCE)
SET(PACKAGE_STRING "ParadisEO-MO 1.1" CACHE STRING "MO Package string full name" FORCE)
SET(PACKAGE_VERSION "1.1" CACHE STRING "Package version" FORCE)
SET(GLOBAL_VERSION "1.1" CACHE STRING "Global version" FORCE)
SET(VERSION "1.1" CACHE STRING "Version" FORCE)
SET(PACKAGE_STRING "ParadisEO-MO 1.2" CACHE STRING "MO Package string full name" FORCE)
SET(PACKAGE_VERSION "1.2" CACHE STRING "Package version" FORCE)
SET(GLOBAL_VERSION "1.2" CACHE STRING "Global version" FORCE)
SET(VERSION "1.2" CACHE STRING "Version" FORCE)
##########################################################################################################################################

View file

@ -156,6 +156,13 @@ JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
# will output the detailed description near the top, like JavaDoc.
# If set to NO, the detailed description appears after the member
# documentation.
DETAILS_AT_TOP = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# re-implements.

View file

@ -41,11 +41,11 @@
#include <moBestImprSelect.h>
#include <moComparator.h>
#include <moCoolingSchedule.h>
#include <moExponentialCoolingSchedule.h>
#include <moFirstImprSelect.h>
#include <moFitComparator.h>
#include <moFitSolContinue.h>
#include <moGenSolContinue.h>
#include <moGeometricCoolingSchedule.h>
#include <moHC.h>
#include <moHCMoveLoopExpl.h>
#include <moILS.h>
@ -72,9 +72,8 @@
#include <moTabuList.h>
#include <moTS.h>
#include <moTSMoveLoopExpl.h>
#include <moTA.h>
#include <moExpl.h>
#include <moVNS.h>
#include <moTA.h>
#endif

View file

@ -57,6 +57,14 @@ class moBestImprSelect:public moMoveSelect < M >
*/
void init (const Fitness & _fitness)
{
//Code only used to avoid warning because _fitness is not used in this procedure.
Fitness fitness;
fitness=(Fitness)_fitness;
//std::cout.precision(10);
//std::cout << "old fitness = " << _fitness << std::endl;
first_time = true;
}
@ -80,6 +88,8 @@ class moBestImprSelect:public moMoveSelect < M >
first_time = false;
}
//std::cout << "best fitness = " << best_fitness << std::endl;
return true;
}
@ -97,7 +107,9 @@ class moBestImprSelect:public moMoveSelect < M >
_move = best_move;
_fitness = best_fitness;
//std::cout << "Final fitness = " << best_fitness << std::endl;
}
private:

View file

@ -49,27 +49,28 @@ public:
//Neighborhoods vector
std::vector< eoMonOp<EOT>* > explore;
//! Generic constructor
/*!
Generic constructor using a eoMonOp
\param _expl Algorithme or mutation.
*/
moExpl(eoMonOp<EOT> & expl){
i=0;
explore.resize(0);
add(expl);
}
//! Generic constructor
/*!
Generic constructor using a eoMonOp
\param _expl Algorithme or mutation.
*/
//! Procedure which launches the moExpl.
/*!
The exploration starts from an old solution and provides a new solution.
@ -98,7 +99,7 @@ public:
//return the size of the class
unsigned int size(){
return explore.size();
}
}
};

View file

@ -0,0 +1,79 @@
/*
<moExponentialCoolingSchedule.h>
Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
(C) OPAC Team, LIFL, 2002-2008
Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
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 _moExponentialCoolingSchedule_h
#define _moExponentialCoolingSchedule_h
#include <moCoolingSchedule.h>
//! One of the possible moCoolingSchedule
/*!
An other very simple cooling schedule, the temperature decrease according to a ratio while
the temperature is greater than a given threshold.
*/
class moExponentialCoolingSchedule: public moCoolingSchedule
{
public:
//! Simple constructor
/*!
\param _threshold the threshold.
\param _ratio the ratio used to descrease the temperature.
*/
moExponentialCoolingSchedule (double _threshold, double _ratio):threshold (_threshold), ratio (_ratio)
{}
//! Function which proceeds to the cooling.
/*!
It decreases the temperature and indicates if it is greater than the threshold.
\param _temperature the current temperature.
\return if the new temperature (current temperature * ratio) is greater than the threshold.
*/
bool operator() (double & _temperature)
{
return (_temperature *= ratio) > threshold;
}
private:
//! The temperature threhold.
double threshold;
//! The decreasing factor of the temperature.
double ratio;
};
#endif

View file

@ -65,6 +65,9 @@ class moGenSolContinue:public moSolContinue < EOT >
*/
bool operator () (const EOT & _solution)
{
//code only used for avoiding warning because _sol is not used in this function.
const EOT solution(_solution);
return (++generationNumber < generationMaximumNumber);
}

View file

@ -116,7 +116,7 @@ class moHCMoveLoopExpl:public moMoveLoopExpl < M >
//The best move is applied on the new solution.
best_move(_new_solution);
//The fitness is set (avoid an additional fitness computation).
//The fitness is set (avoid an additional fitness compuation).
_new_solution.fitness (best_fitness);
}

View file

@ -68,10 +68,13 @@ class moImprBestFitAspirCrit:public moAspirCrit < M >
\param _move A move.
\param _fitness A fitness linked to the move.
\return true The first time and if _fitness > best_fitness, else false.
\return true The first time and if _fitntess > best_fitness, else false.
*/
bool operator () (const M & _move, const Fitness & _fitness)
{
//code only used for avoiding warning because _move is not used in this function.
const M move(_move);
if (first_time)
{
best_fitness = _fitness;
@ -80,12 +83,14 @@ class moImprBestFitAspirCrit:public moAspirCrit < M >
return true;
}
if (_fitness > best_fitness)
if (_fitness < best_fitness)
{
best_fitness = _fitness;
return true;
return false;
}
return false;
best_fitness = _fitness;
return true;
}
private:

View file

@ -72,6 +72,9 @@ class moItRandNextMove:public moNextMove < M >
*/
bool operator () (M & _move, const EOT & _solution)
{
//code only used to avoid warning because _solution is not used in this function.
const EOT solution(_solution);
if (iteration_number > iteration_maximum_number)
{
iteration_number = 0;

View file

@ -58,6 +58,11 @@ class moNoAspirCrit:public moAspirCrit < M >
*/
bool operator () (const M & _move, const typename M::EOType::Fitness & _fitness)
{
//Code only used to avoid warning because _move and _fitness are not used in this procedure.
const M move(_move);
typename M::EOType::Fitness fitness;
fitness=(typename M::EOType::Fitness)_fitness;
return false;
}

View file

@ -69,6 +69,8 @@ class moSimpleMoveTabuList: public moTabuList < M >
bool operator () (const M & _move, const EOT & _solution)
{
moveIterator it;
//code only used to avoid warning because _solution is not used in this function.
EOT solution=(EOT)_solution;
it=tabuList.begin();
// The code is !(*it)==_move instead of (*it)!=_move because people designing their specific move representation
@ -83,6 +85,8 @@ class moSimpleMoveTabuList: public moTabuList < M >
void add(const M & _move, const EOT & _solution)
{
//code only used to avoid warning because _solution is not used in this function.
const EOT solution(_solution);
if (memory_size!=0)
{

View file

@ -2,20 +2,20 @@
<moTS.h>
Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
(C) OPAC Team, LIFL, 2002-2008
Sébastien Cahon, Jean-Charles Boisson (Jean-Charles.Boisson@lifl.fr)
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,
@ -28,7 +28,7 @@
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
*/
@ -54,9 +54,9 @@ class moTS:public moAlgo < typename M::EOType >
//!Alias for the fitness
typedef typename EOT::Fitness Fitness;
public:
//!Constructor of a moTS specifying all the boxes
/*!
In this constructor, a moTSMoveLoopExpl is instanciated.
@ -69,15 +69,15 @@ class moTS:public moAlgo < typename M::EOType >
\param _continue The stopping criterion.
\param _full_evaluation A full evaluation function.
*/
moTS (moMoveInit < M > & _move_initializer, moNextMove < M > & _next_move_generator,
moMoveIncrEval < M > & _incremental_evaluation, moTabuList < M > & _tabu_list,
moAspirCrit < M > & _aspiration_criterion, moSolContinue < EOT > & _continue,
eoEvalFunc < EOT > & _full_evaluation):
moTS (moMoveInit < M > & _move_initializer, moNextMove < M > & _next_move_generator,
moMoveIncrEval < M > & _incremental_evaluation, moTabuList < M > & _tabu_list,
moAspirCrit < M > & _aspiration_criterion, moSolContinue < EOT > & _continue,
eoEvalFunc < EOT > & _full_evaluation):
move_explorer (new moTSMoveLoopExpl < M >(_move_initializer, _next_move_generator, _incremental_evaluation,
_tabu_list,_aspiration_criterion) ),
continu (_continue), full_evaluation (_full_evaluation), move_explorer_memory_allocation(true)
{}
//! Constructor with less parameters
/*!
The explorer is given in the parameters.
@ -98,44 +98,44 @@ class moTS:public moAlgo < typename M::EOType >
delete(move_explorer);
}
}
//! Function which launchs the Tabu Search
/*!
Algorithm of the tabu search.
As a moSA or a moHC, it can be used for HYBRIDATION in an evolutionary algorithm.
For security a lock (pthread_mutex_t) is closed during the algorithm.
For security a lock (pthread_mutex_t) is closed during the algorithm.
\param _solution a solution to improve.
\return TRUE.
*/
bool operator ()(EOT & _solution)
{
M move;
EOT best_solution, new_solution;
if ( _solution.invalid () )
{
full_evaluation (_solution);
}
best_solution=_solution;
// code used for avoiding warning because new_solution is indirectly initialized by move_expl.
new_solution=_solution;
continu.init ();
do
{
(*move_explorer) (_solution, new_solution);
// Updating the best solution found until now ?
if (new_solution.fitness() > best_solution.fitness())
if (new_solution.fitness() > _solution.fitness())
{
best_solution = new_solution;
}
_solution = new_solution;
}
while ( continu (_solution) );

View file

@ -52,7 +52,7 @@ class moVNS : public moAlgo < EOT>
typedef typename EOT::Fitness Fitness;
public:
//! Generic constructor
/*!
Generic constructor using a moExpl
@ -62,7 +62,7 @@ public:
*/
moVNS(moExpl< EOT> & _explorer, eoEvalFunc < EOT> & _full_evaluation): explorer(_explorer), full_evaluation(_full_evaluation) {}
//! Function which launches the VNS
/*!
@ -79,17 +79,16 @@ public:
EOT solution_initial=_solution;
EOT solution_prime, solution_second;
explorer.setIndice(i);
while(i<explorer.size()) {
solution_prime=solution_initial;
if(solution_prime.invalid())
full_evaluation(solution_prime);
explorer(solution_prime, solution_second);
if(solution_second.invalid())
full_evaluation(solution_second);
if(solution_second > solution_initial) {
solution_initial=solution_second;
change=true;
@ -103,7 +102,6 @@ public:
if(i<explorer.size())
explorer.setIndice(i);
}
}
_solution=solution_initial;
return change;

View file

@ -57,9 +57,9 @@ SET (TEST_LIST t-moBestImprSelect
t-moTS
t-moTS_2
t-moTSMoveLoopExpl
t-moVNS
t-moTA
)
t-moVNS
)
FOREACH (test ${TEST_LIST})
SET ("T_${test}_SOURCES" "${test}.cpp")

View file

@ -68,7 +68,7 @@ public :
class testMoveIncrEval : public moMoveIncrEval <testMove>
{
public :
testMoveIncrEval() : counter(0)
{}
@ -94,17 +94,17 @@ public :
solutionContinue() : counter(0)
{}
bool operator () (const solution & _solution)
{
const solution sol(_solution);
if(counter==0)
{
counter++;
return true;
}
return false;
}
@ -145,17 +145,17 @@ main()
int return_value;
solution solution;
testRandMove rand;
testMoveIncrEval incrEval;
solutionContinue continu;
testCooling cooling;
solutionEval eval;
moTA<testMove> ta(rand, incrEval, continu, 10.0, cooling, eval);
cout << "[ moTA ] ==> ";
cout << "[ moTA ] ==> ";
ta(solution);
test_result=((solution.fitness()!=2)?"KO":"OK");

View file

@ -1,4 +1,6 @@
IF(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND cmake_policy)
######################################################################################
### 1) Definitions (required for tsp target)
######################################################################################
@ -12,82 +14,209 @@ SET(FUNCTION_BIN_DIR ${MO_BIN_DIR}/tutorial/examples/function CACHE PATH "FUNCTI
######################################################################################
######################################################################################
### 2) Where must cmake go now ?
### 2) How to manage copy of benchs ?
######################################################################################
#SUBDIRS(examples Lesson1 Lesson2 Lesson3 Lesson4 Lesson5 Lesson6)
IF(ENABLE_CMAKE_EXAMPLE OR CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SET(BENCH_LIST
berlin52.tsp
eil101.tsp
pr2392.tsp
rl5915.tsp
usa13509.tsp
)
FOREACH (bench ${BENCH_LIST})
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/examples/tsp/benchs/${bench}
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/${bench}
)
ENDFOREACH (bench)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson1/param
${MO_BIN_DIR}/tutorial/Lesson1/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson2/param
${MO_BIN_DIR}/tutorial/Lesson2/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson3/param
${MO_BIN_DIR}/tutorial/Lesson3/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson4/param
${MO_BIN_DIR}/tutorial/Lesson4/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson5/param
${MO_BIN_DIR}/tutorial/Lesson5/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/HybridLesson/param
${MO_BIN_DIR}/tutorial/HybridLesson/param
)
ENDIF(ENABLE_CMAKE_EXAMPLE OR CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
######################################################################################
### 3) Where must cmake go now ?
######################################################################################
MACRO(ADD_COMMANDS_MO)
ADD_CUSTOM_COMMAND(
OUTPUT
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ADD_CUSTOM_COMMAND(
OUTPUT ${MO_BIN_DIR}/tutorial/Lesson1/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson1/param
${MO_BIN_DIR}/tutorial/Lesson1
)
ADD_CUSTOM_COMMAND(
OUTPUT ${MO_BIN_DIR}/tutorial/Lesson2/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson2/param
${MO_BIN_DIR}/tutorial/Lesson2
)
ADD_CUSTOM_COMMAND(
OUTPUT ${MO_BIN_DIR}/tutorial/Lesson3/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson3/param
${MO_BIN_DIR}/tutorial/Lesson3
)
ADD_CUSTOM_COMMAND(
OUTPUT ${MO_BIN_DIR}/tutorial/Lesson4/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson4/param
${MO_BIN_DIR}/tutorial/Lesson4
)
ADD_CUSTOM_COMMAND(
OUTPUT ${MO_BIN_DIR}/tutorial/Lesson5/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson5/param
${MO_BIN_DIR}/tutorial/Lesson5
)
ADD_CUSTOM_COMMAND(
OUTPUT ${MO_BIN_DIR}/tutorial/Lesson6/param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${MO_SRC_DIR}/tutorial/HybridLesson/param
${MO_BIN_DIR}/tutorial/HybridLesson
)
ENDMACRO(ADD_COMMANDS_MO)
MACRO(ADD_TARGET_MO n)
IF(${n} STREQUAL "lesson1")
ADD_CUSTOM_TARGET(lesson1 DEPENDS
${MO_BIN_DIR}/tutorial/Lesson1/param
${MO_BIN_DIR}/tutorial/Lesson1/hill_climbing
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ELSEIF(${n} STREQUAL "lesson2")
ADD_CUSTOM_TARGET(lesson2 DEPENDS
${MO_BIN_DIR}/tutorial/Lesson2/param
${MO_BIN_DIR}/tutorial/Lesson2/tabu_search
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ELSEIF(${n} STREQUAL "lesson3")
ADD_CUSTOM_TARGET(lesson3 DEPENDS
${MO_BIN_DIR}/tutorial/Lesson3/param
${MO_BIN_DIR}/tutorial/Lesson3/simulated_annealing
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ELSEIF(${n} STREQUAL "lesson4")
ADD_CUSTOM_TARGET(lesson4 DEPENDS
${MO_BIN_DIR}/tutorial/Lesson4/param
${MO_BIN_DIR}/tutorial/Lesson4/iterated_local_search
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ELSEIF(${n} STREQUAL "lesson5")
ADD_CUSTOM_TARGET(lesson5 DEPENDS
${MO_BIN_DIR}/tutorial/Lesson5/param
${MO_BIN_DIR}/tutorial/Lesson5/variable_neighborhood_search
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ELSEIF(${n} STREQUAL "hybridlesson")
ADD_CUSTOM_TARGET(hybridlesson DEPENDS
${MO_BIN_DIR}/tutorial/HybridLesson/param
${MO_BIN_DIR}/tutorial/HybridLesson/hybrid_ga
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ELSEIF(${n} STREQUAL "install")
ADD_CUSTOM_TARGET(install DEPENDS
${MO_BIN_DIR}/tutorial/Lesson1/param
${MO_BIN_DIR}/tutorial/Lesson2/param
${MO_BIN_DIR}/tutorial/Lesson3/param
${MO_BIN_DIR}/tutorial/Lesson4/param
${MO_BIN_DIR}/tutorial/Lesson5/param
${MO_BIN_DIR}/tutorial/HybridLesson/param
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ELSEIF(${n} STREQUAL "benchs")
ADD_CUSTOM_TARGET(benchs DEPENDS
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/berlin52.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/eil101.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/pr2392.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/rl5915.tsp
${MO_BIN_DIR}/tutorial/examples/tsp/benchs/usa13509.tsp
)
ENDIF(${n} STREQUAL "lesson1")
ENDMACRO(ADD_TARGET_MO)
IF(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" AND NOT CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MO()
ADD_TARGET_MO(install)
ADD_TARGET_MO(benchs)
ENDIF(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" AND NOT CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(Lesson1)
ADD_SUBDIRECTORY(Lesson2)
ADD_SUBDIRECTORY(Lesson3)
ADD_SUBDIRECTORY(Lesson4)
ADD_SUBDIRECTORY(Lesson5)
ADD_SUBDIRECTORY(Lesson6)
######################################################################################
ADD_CUSTOM_TARGET(install DEPENDS ${MO_SRC_DIR}/tutorial/examples/tsp/benchs
${MO_SRC_DIR}/tutorial/Lesson1/param
${MO_SRC_DIR}/tutorial/Lesson2/param
${MO_SRC_DIR}/tutorial/Lesson3/param
${MO_SRC_DIR}/tutorial/Lesson4/param
${MO_SRC_DIR}/tutorial/Lesson5/param
${MO_SRC_DIR}/tutorial/Lesson6/param )
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_directory
${MO_SRC_DIR}/tutorial/examples/tsp/benchs
${MO_BIN_DIR}/tutorial/examples/tsp/benchs)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson1/param
${MO_BIN_DIR}/tutorial/Lesson1)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson2/param
${MO_BIN_DIR}/tutorial/Lesson2)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson3/param
${MO_BIN_DIR}/tutorial/Lesson3)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson4/param
${MO_BIN_DIR}/tutorial/Lesson4)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson5/param
${MO_BIN_DIR}/tutorial/Lesson5)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${MO_SRC_DIR}/tutorial/Lesson6/param
${MO_BIN_DIR}/tutorial/Lesson6)
ADD_SUBDIRECTORY(HybridLesson)

View file

@ -0,0 +1,65 @@
######################################################################################
### 1) Include the sources
######################################################################################
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils)
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
######################################################################################
### 2) Specify where CMake can find the libraries
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib)
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES hybrid_ga.cpp)
SOURCE_GROUP(benchs FILES
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ADD_EXECUTABLE(hybrid_ga
hybrid_ga.cpp
${MO_BIN_DIR}/tutorial/Lesson6/param
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MO()
ADD_TARGET_MO(lesson6)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(hybrid_ga hybrid_ga.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(hybrid_ga EXCLUDE_FROM_ALL hybrid_ga.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_DEPENDENCIES(hybrid_ga tsp)
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
######################################################################################
SET(HYBRIDGA_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(hybrid_ga PROPERTIES VERSION "${HYBRIDGA_VERSION}")
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(hybrid_ga tsp eo eoutils)
######################################################################################

View file

@ -5,46 +5,63 @@
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils)
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${FUNCTION_SRC_DIR})
######################################################################################
INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
######################################################################################
### 2) Specify where CMake can find the libraries
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${FUNCTION_BIN_DIR}/lib)
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib)
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(minimize_function minimize_function.cpp)
ADD_DEPENDENCIES(minimize_function function)
######################################################################################
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES hill_climbing.cpp)
SOURCE_GROUP(benchs FILES
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ADD_EXECUTABLE(hill_climbing
hill_climbing.cpp
${MO_BIN_DIR}/tutorial/Lesson1/param
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MO()
ADD_TARGET_MO(lesson1)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(hill_climbing hill_climbing.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(hill_climbing EXCLUDE_FROM_ALL hill_climbing.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_DEPENDENCIES(hill_climbing tsp)
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
######################################################################################
SET(MINIMIZEFUNCTION_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(minimize_function PROPERTIES VERSION "${MINIMIZEFUNCTION_VERSION}")
######################################################################################
SET(HILLCLIMBING_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(hill_climbing PROPERTIES VERSION "${HILLCLIMBING_VERSION}")
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(minimize_function function eo eoutils)
TARGET_LINK_LIBRARIES(hill_climbing tsp eo eoutils)
######################################################################################

View file

@ -4,7 +4,6 @@
# --stopOnUnknownParam=1 # Stop if unkown param entered
###### Configuration ######
# --initialBound=1 # Bound for the initial affectation.
# --searchBound=1 # Bound for neighbourhood exploration.
# --searchStep=1 # Step between two values during the neighbourhood exploration.
# --selectionType=First # Type of the selection: 'Best', 'First' or 'Random'.
# --instancePath=../examples/tsp/benchs/berlin52.tsp # Path to the instance.
# --seed=1203517190 # Seed for rand.
# --selectionType=Best # Type of the selection: 'Best', 'First' or 'Random'.

View file

@ -1,5 +1,3 @@
######################################################################################
### 1) Include the sources
######################################################################################
@ -8,7 +6,6 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils)
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
######################################################################################
######################################################################################
### 2) Specify where CMake can find the libraries
@ -16,36 +13,54 @@ INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib)
######################################################################################
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(hill_climbing hill_climbing.cpp)
ADD_DEPENDENCIES(hill_climbing tsp)
######################################################################################
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES tabu_search.cpp)
SOURCE_GROUP(benchs FILES
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ADD_EXECUTABLE(tabu_search
tabu_search.cpp
${MO_BIN_DIR}/tutorial/Lesson2/param
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MO()
ADD_TARGET_MO(lesson2)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(tabu_search tabu_search.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(tabu_search EXCLUDE_FROM_ALL tabu_search.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_DEPENDENCIES(tabu_search tsp)
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
######################################################################################
SET(HILLCLIMBING_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(hill_climbing PROPERTIES VERSION "${HILLCLIMBING_VERSION}")
######################################################################################
SET(TABUSEARCH_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(tabu_search PROPERTIES VERSION "${TABUSEARCH_VERSION}")
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(hill_climbing tsp eo eoutils)
TARGET_LINK_LIBRARIES(tabu_search tsp eo eoutils)
######################################################################################

View file

@ -4,6 +4,8 @@
# --stopOnUnknownParam=1 # Stop if unkown param entered
###### Configuration ######
# --instancePath=../examples/tsp/benchs/berlin52.tsp # Path to the instance.
# --seed=1203517190 # Seed for rand.
# --selectionType=Best # Type of the selection: 'Best', 'First' or 'Random'.
# --instancePath=../examples/tsp/benchs/berlin52.tsp # Path to the instance
# --seed=1202917905 # Seed for rand
# --tabuListSize=10 # Size of the tabu list
# --maxIter=1000 # Maximum number of iterations
# --tabuListType=TwoOpt # Type of the tabu list: 'TwoOpt', 'SimpleMove' or 'SimpleSolution'

View file

@ -1,5 +1,3 @@
######################################################################################
### 1) Include the sources
######################################################################################
@ -8,44 +6,61 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils)
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
######################################################################################
######################################################################################
### 2) Specify where CMake can find the libraries
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib)
######################################################################################
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(tabu_search tabu_search.cpp)
ADD_DEPENDENCIES(tabu_search tsp)
######################################################################################
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES simulated_annealing.cpp)
SOURCE_GROUP(benchs FILES
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ADD_EXECUTABLE(simulated_annealing
simulated_annealing.cpp
${MO_BIN_DIR}/tutorial/Lesson3/param
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MO()
ADD_TARGET_MO(lesson3)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(simulated_annealing simulated_annealing.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(simulated_annealing EXCLUDE_FROM_ALL simulated_annealing.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_DEPENDENCIES(simulated_annealing tsp)
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
######################################################################################
SET(TABUSEARCH_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(tabu_search PROPERTIES VERSION "${TABUSEARCH_VERSION}")
######################################################################################
SET(SIMULATEDANNEALING_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(simulated_annealing PROPERTIES VERSION "${SIMULATEDANNEALING_VERSION}")
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(tabu_search tsp eo eoutils)
TARGET_LINK_LIBRARIES(simulated_annealing tsp eo eoutils)
######################################################################################

View file

@ -4,8 +4,11 @@
# --stopOnUnknownParam=1 # Stop if unkown param entered
###### Configuration ######
# --instancePath=../examples/tsp/benchs/berlin52.tsp # Path to the instance
# --seed=1202917905 # Seed for rand
# --tabuListSize=10 # Size of the tabu list
# --maxIter=1000 # Maximum number of iterations
# --tabuListType=TwoOpt # Type of the tabu list: 'TwoOpt', 'SimpleMove' or 'SimpleSolution'
# --instancePath=../examples/tsp/benchs/berlin52.tsp # Path to the instance.
# --seed=1202919978 # Seed for rand.
# --maxIter=1000 # Maximum number of iterations.
# --initialTemp=1000 # Initial temperature.
# --threshold=0.1 # Minimum temperature allowed.
# --expoRatio=0.98 # Ratio used if exponential cooling schedule is chosen.
# --lineaRatio=0.5 # Ratio used if linear cooling schedule is chosen.
# --coolSchedType=Expo # Type the cooling schedule: 'Expo' or 'Linear'.

View file

@ -83,9 +83,9 @@ main (int _argc, char* _argv [])
moCoolingSchedule* coolingSchedule;
if(value.compare("Geometric")==0)
if(value.compare("Expo")==0)
{
coolingSchedule=new moGeometricCoolingSchedule(threshold, exponentialRatio);
coolingSchedule=new moExponentialCoolingSchedule(threshold, exponentialRatio);
}
else if (value.compare("Linear")==0)
{
@ -129,7 +129,7 @@ manage_configuration_file(eoParser & _parser)
_parser.getORcreateParam((double)0.5, "lineaRatio", "Ratio used if linear cooling schedule is chosen.", 0, "Configuration", false);
_parser.getORcreateParam(std::string("Geometric"), "coolSchedType", "Type the cooling schedule: 'Geometric' or 'Linear'.",
_parser.getORcreateParam(std::string("Expo"), "coolSchedType", "Type the cooling schedule: 'Expo' or 'Linear'.",
0, "Configuration", false);
if (_parser.userNeedsHelp())

View file

@ -1,5 +1,3 @@
######################################################################################
### 1) Include the sources
######################################################################################
@ -8,44 +6,60 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils)
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
######################################################################################
######################################################################################
### 2) Specify where CMake can find the libraries
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib)
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib)
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(simulated_annealing simulated_annealing.cpp)
ADD_DEPENDENCIES(simulated_annealing tsp)
######################################################################################
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES iterated_local_search.cpp)
SOURCE_GROUP(benchs FILES
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ADD_EXECUTABLE(iterated_local_search
iterated_local_search.cpp
${MO_BIN_DIR}/tutorial/Lesson4/param
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MO()
ADD_TARGET_MO(lesson4)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(iterated_local_search iterated_local_search.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(iterated_local_search EXCLUDE_FROM_ALL iterated_local_search.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_DEPENDENCIES(iterated_local_search tsp)
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
######################################################################################
SET(SIMULATEDANNEALING_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(simulated_annealing PROPERTIES VERSION "${SIMULATEDANNEALING_VERSION}")
######################################################################################
SET(ITERATEDLOCALSEARCH_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(iterated_local_search PROPERTIES VERSION "${ITERATEDLOCALSEARCH_VERSION}")
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(simulated_annealing tsp eo eoutils)
TARGET_LINK_LIBRARIES(iterated_local_search tsp eo eoutils)
######################################################################################

View file

@ -5,10 +5,5 @@
###### Configuration ######
# --instancePath=../examples/tsp/benchs/berlin52.tsp # Path to the instance.
# --seed=1202919978 # Seed for rand.
# --seed=1203080388 # Seed for rand.
# --maxIter=1000 # Maximum number of iterations.
# --initialTemp=1000 # Initial temperature.
# --threshold=0.1 # Minimum temperature allowed.
# --expoRatio=0.98 # Ratio used if exponential cooling schedule is chosen.
# --lineaRatio=0.5 # Ratio used if linear cooling schedule is chosen.
# --coolSchedType=Expo # Type the cooling schedule: 'Expo' or 'Linear'.

View file

@ -1,5 +1,3 @@
######################################################################################
### 1) Include the sources
######################################################################################
@ -8,7 +6,6 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils)
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
######################################################################################
######################################################################################
### 2) Specify where CMake can find the libraries
@ -16,36 +13,53 @@ INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib)
######################################################################################
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(iterated_local_search iterated_local_search.cpp)
ADD_DEPENDENCIES(iterated_local_search tsp)
######################################################################################
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES iterated_local_search.cpp)
SOURCE_GROUP(benchs FILES
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ADD_EXECUTABLE(iterated_local_search
variable_neighborhood_search.cpp
${MO_BIN_DIR}/tutorial/Lesson5/param
${TSP_BIN_DIR}/benchs/berlin52.tsp
${TSP_BIN_DIR}/benchs/eil101.tsp
${TSP_BIN_DIR}/benchs/pr2392.tsp
${TSP_BIN_DIR}/benchs/rl5915.tsp
${TSP_BIN_DIR}/benchs/usa13509.tsp
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MO()
ADD_TARGET_MO(lesson5)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(variable_neighborhood_search variable_neighborhood_search.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(variable_neighborhood_search EXCLUDE_FROM_ALL variable_neighborhood_search.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_DEPENDENCIES(variable_neighborhood_search tsp)
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
######################################################################################
SET(ITERATEDLOCALSEARCH_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(iterated_local_search PROPERTIES VERSION "${ITERATEDLOCALSEARCH_VERSION}")
######################################################################################
SET_TARGET_PROPERTIES(variable_neighborhood_search PROPERTIES VERSION "${ITERATEDLOCALSEARCH_VERSION}")
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(iterated_local_search tsp eo eoutils)
TARGET_LINK_LIBRARIES(variable_neighborhood_search tsp eo eoutils)
######################################################################################

View file

@ -1,9 +1,8 @@
###### General ######
# --help=0 # -h : Prints this message
# --stopOnUnknownParam=1 # Stop if unkown param entered
###### Configuration ######
# --instancePath=../examples/tsp/benchs/berlin52.tsp # Path to the instance.
# --seed=1203080388 # Seed for rand.
# --maxIter=1000 # Maximum number of iterations.
# --seed=1231949999 # Seed for rand.
# --selectionType=Best # Type of the selection: 'Best', 'First' or 'Random'.

View file

@ -0,0 +1,160 @@
/*
<variable_neighborhood_search.cpp>
Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
(C) OPAC Team, LIFL, 2002-2008
Salma Mesmoudi (salma.mesmoudi@inria.fr), Jean-Charles Boisson
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 <eo>
#include <mo>
#include <tsp>
#include <vector>
//template <class T, class P>void add(T& var, P& vect);
void manage_configuration_file(eoParser & _parser);
//void ajouter (std::vector<moMoveInit<moMove<Route> > >& V, moMove<Route>& K)const ;
int
main (int _argc, char* _argv [])
{
std::string instancePath, selectionType;
unsigned int seed;
eoParser parser(_argc, _argv);
manage_configuration_file(parser);
seed=atoi( (parser.getParamWithLongName("seed")->getValue()).c_str() );
instancePath=parser.getParamWithLongName("instancePath")->getValue();
selectionType=parser.getParamWithLongName("selectionType")->getValue();
srand (seed);
Graph::load(instancePath.c_str());
Route solution;
RouteInit initializer;
initializer (solution);
RouteEval full_evaluation;
full_evaluation (solution);
std :: cout << "[From] " << solution << std :: endl;
//A neighbor is a local search or mutation
/*Tools for an efficient (? :-))
local search ! */
//---------------------first neighbor----------------------------------
TwoOptInit two_opt_initializer;
TwoOptNext two_opt_next_move_generator;
TwoOptIncrEval two_opt_incremental_evaluation;
moMoveSelect<TwoOpt>* two_opt_selection;
if(selectionType.compare("Best")==0)
{
two_opt_selection= new moBestImprSelect<TwoOpt>();
}
else if (selectionType.compare("First")==0)
{
two_opt_selection= new moFirstImprSelect<TwoOpt>();
}
else if (selectionType.compare("Random")==0)
{
two_opt_selection= new moRandImprSelect<TwoOpt>();
}
else
{
throw std::runtime_error("[hill_climbing.cpp]: the type of selection '"+selectionType+"' is not correct.");
}
moHC <TwoOpt> hill_climbing (two_opt_initializer, two_opt_next_move_generator, two_opt_incremental_evaluation,
*two_opt_selection, full_evaluation);
//--------------------second neighbor-----------------
CitySwap perturbation;
//-----------neighbor vector--------------------------
moExpl<Route> explorer(perturbation);
explorer.add(hill_climbing);
explorer.add(perturbation);
//------------VNS application--------------------------
moVNS<Route> vns(explorer, full_evaluation);
vns(solution);
//hill_climbing(solution);
std :: cout << "[To] " << solution << std :: endl;
delete(two_opt_selection);
return EXIT_SUCCESS;
}
void
manage_configuration_file(eoParser & _parser)
{
std::ofstream os;
_parser.createParam(std::string("../examples/tsp/benchs/berlin52.tsp"), "instancePath", "Path to the instance.",
0, "Configuration", false);
_parser.getORcreateParam((unsigned int)time(0), "seed", "Seed for rand.", 0, "Configuration", false);
_parser.getORcreateParam(std::string("Best"), "selectionType", "Type of the selection: 'Best', 'First' or 'Random'.",
0, "Configuration", false);
if (_parser.userNeedsHelp())
{
_parser.printHelp(std::cout);
exit(EXIT_FAILURE);
}
os.open("current_param");
if(!os.is_open())
{
throw std::runtime_error("[hill_climbing.cpp]: the file current_param cannot be created.");
}
os <<_parser;
os.close();
}

View file

@ -1,5 +1,3 @@
######################################################################################
### 1) Include the sources
######################################################################################
@ -7,45 +5,32 @@
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src/utils)
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${TSP_SRC_DIR})
######################################################################################
INCLUDE_DIRECTORIES(${FUNCTION_SRC_DIR})
######################################################################################
### 2) Specify where CMake can find the libraries
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${TSP_BIN_DIR}/lib)
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${FUNCTION_BIN_DIR}/lib)
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(hybrid_ga hybrid_ga.cpp)
ADD_DEPENDENCIES(hybrid_ga tsp)
######################################################################################
ADD_EXECUTABLE(minimize_function
ADD_DEPENDENCIES(minimize_function function)
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
######################################################################################
SET(ITERATEDLOCALSEARCH_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(hybrid_ga PROPERTIES VERSION "${HYBRIDGA_VERSION}")
######################################################################################
SET(MINIMIZEFUNCTION_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(minimize_function PROPERTIES VERSION "${MINIMIZEFUNCTION_VERSION}")
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(hybrid_ga tsp eo eoutils)
TARGET_LINK_LIBRARIES(minimize_function function eo eoutils)
######################################################################################

View file

@ -0,0 +1,10 @@
###### General ######
# --help=0 # -h : Prints this message
# --stopOnUnknownParam=1 # Stop if unkown param entered
###### Configuration ######
# --initialBound=1 # Bound for the initial affectation.
# --searchBound=1 # Bound for neighbourhood exploration.
# --searchStep=1 # Step between two values during the neighbourhood exploration.
# --selectionType=First # Type of the selection: 'Best', 'First' or 'Random'.

View file

@ -1,3 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
##########################################################################################################################################
### 0) If you want to set your own variables in moeo-conf.cmake and avoid the cmd line
@ -17,10 +18,10 @@ PROJECT(ParadisEO-MOEO)
SET(PACKAGE_BUGREPORT "paradiseo-help@lists.gforge.inria.fr" CACHE STRING "Package bug report" FORCE)
SET(PACKAGE_NAME "ParadisEO-MOEO - Multi Objective Evolving Objects" CACHE STRING "Package name" FORCE)
SET(PACKAGE_STRING "ParadisEO-MOEO 1.1" CACHE STRING "MOEO Package string full name" FORCE)
SET(PACKAGE_VERSION "1.1" CACHE STRING "Package version" FORCE)
SET(GLOBAL_VERSION "1.1" CACHE STRING "Global version" FORCE)
SET(VERSION "1.1" CACHE STRING "Version" FORCE)
SET(PACKAGE_STRING "ParadisEO-MOEO 1.2" CACHE STRING "MOEO Package string full name" FORCE)
SET(PACKAGE_VERSION "1.2" CACHE STRING "Package version" FORCE)
SET(GLOBAL_VERSION "1.2" CACHE STRING "Global version" FORCE)
SET(VERSION "1.2" CACHE STRING "Version" FORCE)
##########################################################################################################################################

View file

@ -8,6 +8,7 @@ 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" \
@ -29,6 +30,7 @@ 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
@ -222,6 +224,8 @@ 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

View file

@ -129,7 +129,7 @@ public:
/**
* Ctor with a crossover, a mutation and their corresponding rates.
* @param _continuator stopping criteria
* @param _eval evaluation function
popEval * @param _eval evaluation function
* @param _op general operator
* @param _archive archive
* @param _k the k-ieme distance used to fixe diversity
@ -241,14 +241,16 @@ class eoDummyTransform : public eoTransform<MOEOT>
eoPopLoopEval < MOEOT > loopEval;
/** evaluation function used to evaluate the whole population */
eoPopEvalFunc < MOEOT > & popEval;
/**archive*/
moeoArchive < MOEOT >& archive;
/** selectMany */
eoSelectMany <MOEOT> selectMany;
/** select Transform*/
eoSelectTransform <MOEOT> selectTransform;
/** binary tournament selection */
moeoSelectFromPopAndArch < MOEOT > select;
/**SelectOne*/
moeoDetTournamentSelect < MOEOT > defaultSelect;
/** binary tournament selection */
moeoSelectFromPopAndArch < MOEOT > select;
/** fitness assignment used in NSGA-II */
moeoDominanceCountRankingFitnessAssignment < MOEOT > fitnessAssignment;
/** diversity assignment used in NSGA-II */
@ -267,8 +269,7 @@ class eoDummyTransform : public eoTransform<MOEOT>
eoBreed < MOEOT > & breed;
/**distance*/
moeoEuclideanDistance < MOEOT > dist;
/**archive*/
moeoArchive < MOEOT >& archive;
};

View file

@ -141,12 +141,12 @@ public:
*/
void operator()(const eoPop < MOEOT > & _pop)
{
unsigned int i=0;
unsigned int i;
unsigned int foo=0;
//Creation of the vector that contains minimal pop's informations
std::vector<struct refpop> copy_pop(_pop.size());
for (i;i<_pop.size(); i++)
for (i=0;i<_pop.size(); i++)
{
copy_pop[i].index=i;
copy_pop[i].fitness=_pop[i].fitness();
@ -250,7 +250,7 @@ public:
for (l=0; l<matrice.size(); l++)
{
it=matrice[l].begin();
while ((*it).first != tmp2)
while ((unsigned int)(*it).first != tmp2)
it++;
matrice[l].erase(it);
}

View file

@ -87,7 +87,6 @@ class moeoParetoObjectiveVectorComparator : public moeoObjectiveVectorComparator
}
}
}
return dom;
}

View file

@ -49,13 +49,11 @@
#include <utils/eoState.h>
#include <metric/moeoContributionMetric.h>
#include <metric/moeoEntropyMetric.h>
#include <metric/moeoHyperVolumeDifferenceMetric.h>
#include <metric/moeoVecVsVecMultiplicativeEpsilonBinaryMetric.h>
#include <metric/moeoVecVsVecAdditiveEpsilonBinaryMetric.h>
#include <utils/moeoArchiveUpdater.h>
#include <utils/moeoArchiveObjectiveVectorSavingUpdater.h>
#include <utils/moeoBinaryMetricSavingUpdater.h>
bool testDirRes(std::string _dirName, bool _erase);
/**
@ -197,57 +195,6 @@ eoCheckPoint < MOEOT > & do_make_checkpoint_moeo (eoParser & _parser, eoState &
_state.storeFunctor(entropy_updater);
checkpoint.add(*entropy_updater);
}
// store the hyperVolume of the non-dominated solutions
bool hyp = _parser.getORcreateParam(false, "hyperVolume", "Store the hyperVolume of the archive at each gen.", '\0', "Output").value();
if (hyp)
{
if (! dirOK )
dirOK = testDirRes(dirName, eraseParam.value()); // TRUE
#ifdef _MSVC
std::string stmp = dirName + "\hyperVolume";
#else
std::string stmp = dirName + "/hyperVolume";
#endif
moeoHyperVolumeDifferenceMetric < ObjectiveVector > * hyperVolume = new moeoHyperVolumeDifferenceMetric < ObjectiveVector >(true, 1.1);
moeoBinaryMetricSavingUpdater < MOEOT > * hyperVolume_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*hyperVolume, _archive, stmp);
_state.storeFunctor(hyperVolume_updater);
checkpoint.add(*hyperVolume_updater);
}
// store the Multiplicative Epsilon of the non-dominated solutions
bool multeps = _parser.getORcreateParam(false, "multEpsilon", "Store the Multiplicative Epsilon of the archive at each gen.", '\0', "Output").value();
if (multeps)
{
if (! dirOK )
dirOK = testDirRes(dirName, eraseParam.value()); // TRUE
#ifdef _MSVC
std::string stmp = dirName + "\multepsilon";
#else
std::string stmp = dirName + "/multepsilon";
#endif
moeoVecVsVecMultiplicativeEpsilonBinaryMetric < ObjectiveVector > * multepsilon = new moeoVecVsVecMultiplicativeEpsilonBinaryMetric < ObjectiveVector >;
moeoBinaryMetricSavingUpdater < MOEOT > * multepsilon_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*multepsilon, _archive, stmp);
_state.storeFunctor(multepsilon_updater);
checkpoint.add(*multepsilon_updater);
}
// store the Additive Epsilon of the non-dominated solutions
bool addeps = _parser.getORcreateParam(false, "addEpsilon", "Store the Additive Epsilon of the archive at each gen.", '\0', "Output").value();
if (addeps)
{
if (! dirOK )
dirOK = testDirRes(dirName, eraseParam.value()); // TRUE
#ifdef _MSVC
std::string stmp = dirName + "\addepsilon";
#else
std::string stmp = dirName + "/addepsilon";
#endif
moeoVecVsVecAdditiveEpsilonBinaryMetric < ObjectiveVector > * addepsilon = new moeoVecVsVecAdditiveEpsilonBinaryMetric < ObjectiveVector >;
moeoBinaryMetricSavingUpdater < MOEOT > * addepsilon_updater = new moeoBinaryMetricSavingUpdater < MOEOT > (*addepsilon, _archive, stmp);
_state.storeFunctor(addepsilon_updater);
checkpoint.add(*addepsilon_updater);
}
// and that's it for the (control and) output
return checkpoint;

View file

@ -57,7 +57,6 @@
#include <diversity/moeoDummyDiversityAssignment.h>
#include <diversity/moeoFrontByFrontCrowdingDiversityAssignment.h>
#include <diversity/moeoFrontByFrontSharingDiversityAssignment.h>
#include <diversity/moeoNearestNeighborDiversityAssignment.h>
#include <fitness/moeoDummyFitnessAssignment.h>
#include <fitness/moeoExpBinaryIndicatorBasedFitnessAssignment.h>
#include <fitness/moeoDominanceDepthFitnessAssignment.h>
@ -95,7 +94,7 @@ moeoEA < MOEOT > & do_make_ea_moeo(eoParser & _parser, eoState & _state, eoEvalF
/* the fitness assignment strategy */
std::string & fitnessParam = _parser.createParam(std::string("DomDepth"), "fitness",
"Fitness assignment scheme: Dummy, DomDepth, DomCount, DomRank, DomCountRanking or IndicatorBased", 'F',
"Fitness assignment scheme: Dummy, DomDepth or IndicatorBased", 'F',
"Evolution Engine").value();
std::string & indicatorParam = _parser.createParam(std::string("Epsilon"), "indicator",
"Binary indicator for IndicatorBased: Epsilon, Hypervolume", 'i',
@ -113,18 +112,6 @@ moeoEA < MOEOT > & do_make_ea_moeo(eoParser & _parser, eoState & _state, eoEvalF
{
fitnessAssignment = new moeoDominanceDepthFitnessAssignment < MOEOT> ();
}
else if (fitnessParam == std::string("DomCount"))
{
fitnessAssignment = new moeoDominanceCountFitnessAssignment < MOEOT> ();
}
else if (fitnessParam == std::string("DomRank"))
{
fitnessAssignment = new moeoDominanceRankFitnessAssignment < MOEOT> ();
}
else if (fitnessParam == std::string("DomCountRanking"))
{
fitnessAssignment = new moeoDominanceCountRankingFitnessAssignment < MOEOT> ();
}
else if (fitnessParam == std::string("IndicatorBased"))
{
// metric
@ -154,7 +141,7 @@ moeoEA < MOEOT > & do_make_ea_moeo(eoParser & _parser, eoState & _state, eoEvalF
/* the diversity assignment strategy */
eoValueParam<eoParamParamType> & diversityParam = _parser.createParam(eoParamParamType("Dummy"), "diversity",
"Diversity assignment scheme: Dummy, Sharing(nicheSize), NearestNeighbor(k) or Crowding", 'D', "Evolution Engine");
"Diversity assignment scheme: Dummy, Sharing(nicheSize) or Crowding", 'D', "Evolution Engine");
eoParamParamType & diversityParamValue = diversityParam.value();
moeoDiversityAssignment < MOEOT > * diversityAssignment;
if (diversityParamValue.first == std::string("Dummy"))
@ -176,21 +163,6 @@ moeoEA < MOEOT > & do_make_ea_moeo(eoParser & _parser, eoState & _state, eoEvalF
}
diversityAssignment = new moeoFrontByFrontSharingDiversityAssignment < MOEOT> (nicheSize);
}
else if (diversityParamValue.first == std::string("NearestNeighbor"))
{
unsigned int k;
if (!diversityParamValue.second.size()) // no parameter added
{
std::cerr << "WARNING, no k-th distance for Sharing, using 1" << std::endl;
k = 1;
diversityParamValue.second.push_back(std::string("1"));
}
else
{
k = atoi(diversityParamValue.second[0].c_str());
}
diversityAssignment = new moeoNearestNeighborDiversityAssignment < MOEOT> (k);
}
else if (diversityParamValue.first == std::string("Crowding"))
{
diversityAssignment = new moeoFrontByFrontCrowdingDiversityAssignment < MOEOT> ();

View file

@ -70,7 +70,7 @@ public:
* Default ctor
* @param _nocopy boolean to move away copies
*/
moeoDominanceCountRankingFitnessAssignment(bool _nocopy=false) : comparator(paretoComparator), archive(defaultArchive), matrix(_nocopy)
moeoDominanceCountRankingFitnessAssignment(bool _nocopy=true) : comparator(paretoComparator), archive(defaultArchive), matrix(_nocopy)
{}
@ -79,7 +79,7 @@ public:
* @param _archive the archive used
* @param _nocopy boolean to move away copies
*/
moeoDominanceCountRankingFitnessAssignment(moeoArchive < MOEOT > & _archive, bool _nocopy=false) : comparator(paretoComparator), archive(_archive), matrix(_nocopy)
moeoDominanceCountRankingFitnessAssignment(moeoArchive < MOEOT > & _archive, bool _nocopy=true) : comparator(paretoComparator), archive(_archive), matrix(_nocopy)
{}
@ -88,7 +88,7 @@ public:
* @param _comparator the functor used to compare objective vectors
* @param _nocopy boolean to move away copies
*/
moeoDominanceCountRankingFitnessAssignment(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, bool _nocopy=false) : comparator(_comparator), archive(defaultArchive), matrix(_comparator, _nocopy)
moeoDominanceCountRankingFitnessAssignment(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, bool _nocopy=true) : comparator(_comparator), archive(defaultArchive), matrix(_comparator, _nocopy)
{}
@ -98,7 +98,7 @@ public:
* @param _archive the archive used
* @param _nocopy boolean to move away copies
*/
moeoDominanceCountRankingFitnessAssignment(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, moeoArchive < MOEOT > & _archive, bool _nocopy=false) : comparator(_comparator), archive(_archive), matrix(_comparator, _nocopy)
moeoDominanceCountRankingFitnessAssignment(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, moeoArchive < MOEOT > & _archive, bool _nocopy=true) : comparator(_comparator), archive(_archive), matrix(_comparator, _nocopy)
{}

View file

@ -173,7 +173,7 @@ class moeoDominanceDepthFitnessAssignment : public moeoDominanceBasedFitnessAssi
// assign fitness values
unsigned int rank = 1;
_pop[_pop.size()-1].fitness(rank);
for (int i=((int)_pop.size())-2; i>=0; i--)
for (int i=_pop.size()-2; i>=0; i--)
{
if (_pop[i].objectiveVector() != _pop[i+1].objectiveVector())
{

View file

@ -66,7 +66,7 @@ public:
* @param _start a start value used to determine the fitness (default _start = 1.0)
* @param _nocopy boolean to penalize clone individuals (default = false)
*/
moeoDominanceRankFitnessAssignment(double _start=1.0, bool _nocopy=false) : comparator(paretoComparator), archive(defaultArchive), start(_start), matrix(_nocopy)
moeoDominanceRankFitnessAssignment(double _start=1.0, bool _nocopy=true) : comparator(paretoComparator), archive(defaultArchive), start(_start), matrix(_nocopy)
{}
@ -76,7 +76,7 @@ public:
* @param _start a start value used to determine the fitness (default _start = 1.0)
* @param _nocopy boolean to penalize clone individuals (default = false)
*/
moeoDominanceRankFitnessAssignment(moeoArchive < MOEOT > & _archive, double _start=1.0, bool _nocopy=false) : comparator(paretoComparator), archive(_archive), start(_start), matrix(_nocopy)
moeoDominanceRankFitnessAssignment(moeoArchive < MOEOT > & _archive, double _start=1.0, bool _nocopy=true) : comparator(paretoComparator), archive(_archive), start(_start), matrix(_nocopy)
{}
@ -86,7 +86,7 @@ public:
* @param _start a start value used to determine the fitness (default _start = 1.0)
* @param _nocopy boolean to penalize clone individuals (default = false)
*/
moeoDominanceRankFitnessAssignment(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, double _start=1.0, bool _nocopy=false) : comparator(_comparator), archive(defaultArchive), start(_start), matrix(_comparator, _nocopy)
moeoDominanceRankFitnessAssignment(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, double _start=1.0, bool _nocopy=true) : comparator(_comparator), archive(defaultArchive), start(_start), matrix(_comparator, _nocopy)
{}
@ -97,7 +97,7 @@ public:
* @param _start a start value used to determine the fitness (default _start = 1.0)
* @param _nocopy boolean to penalize clone individuals (default = false)
*/
moeoDominanceRankFitnessAssignment(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, moeoArchive < MOEOT > & _archive, double _start=1.0, bool _nocopy=false) : comparator(_comparator), archive(_archive), start(_start), matrix(_comparator, _nocopy)
moeoDominanceRankFitnessAssignment(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, moeoArchive < MOEOT > & _archive, double _start=1.0, bool _nocopy=true) : comparator(_comparator), archive(_archive), start(_start), matrix(_comparator, _nocopy)
{}

View file

@ -135,8 +135,7 @@ class moeoHyperVolumeDifferenceMetric : public moeoVectorVsVectorBinaryMetric <
*/
void setup(const std::vector < ObjectiveVector > & _set1, const std::vector < ObjectiveVector > & _set2){
if(_set1.size() < 1 || _set2.size() < 1)
std::cout << "Warning!!! In moeoHyperVolumeUnaryMetric::setup -> argument1: vector<ObjectiveVector> size must be greater than 0" << std::endl;
//throw("Error in moeoHyperVolumeUnaryMetric::setup -> argument1: vector<ObjectiveVector> size must be greater than 0");
throw("Error in moeoHyperVolumeUnaryMetric::setup -> argument1: vector<ObjectiveVector> size must be greater than 0");
else{
double min, max;
unsigned int nbObj=ObjectiveVector::Traits::nObjectives();

View file

@ -49,7 +49,7 @@ template < class ObjectiveVector >
class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , double >
{
public:
/**
* Constructor with a coefficient (rho)
* @param _normalize allow to normalize data (default true)
@ -63,7 +63,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
bounds[i] = eoRealInterval(0,1);
}
}
/**
* Constructor with a reference point
* @param _normalize allow to normalize data (default true)
@ -77,22 +77,22 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
bounds[i] = eoRealInterval(0,1);
}
}
/**
* Constructor with a reference point
* @param _normalize allow to normalize data (default true)
* @param _ref_point the reference point
*/
moeoHyperVolumeMetric(ObjectiveVector& _ref_point=NULL, std::vector < eoRealInterval >& _bounds=NULL): normalize(false), rho(0.0), ref_point(_ref_point), bounds(_bounds){}
moeoHyperVolumeMetric(ObjectiveVector& _ref_point=NULL, std::vector < eoRealInterval >& _bounds=NULL): normalize(false), rho(0.0), ref_point(_ref_point), bounds(_bounds){}
/**
* calculates and returns the HyperVolume value of a pareto front
* @param _set the vector contains all objective Vector of pareto front
* @param _set the vector contains all objective Vector of pareto front
*/
double operator()(const std::vector < ObjectiveVector > & _set)
{
std::vector < std::vector<double> > front;
//determine the reference point if a coefficient is passed in paremeter
if(rho >= 1.0){
//determine bounds
@ -112,7 +112,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
ref_point[i]= bounds[i].maximum() * (1-rho);
}
}
//if no normalization, reinit bounds to O..1 for
//if no normalization, reinit bounds to O..1 for
if(!normalize)
for (unsigned int i=0; i<ObjectiveVector::Traits::nObjectives(); i++)
bounds[i] = eoRealInterval(0,1);
@ -132,10 +132,10 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
}
}
}
return calc_hypervolume(front, front.size(),ObjectiveVector::Traits::nObjectives());
}
/**
* getter on bounds
* @return bounds
@ -143,7 +143,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
std::vector < eoRealInterval > getBounds(){
return bounds;
}
/**
* method caclulate bounds for the normalization
* @param _set the vector of objective vectors
@ -166,7 +166,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
}
}
}
/**
* method calculate if a point dominates another one regarding the x first objective
* @param _point1 a vector of distances
@ -178,18 +178,18 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
unsigned int i;
bool better_in_any_objective = false;
bool worse_in_any_objective = false;
for(i=0; i < _no_objectives && !worse_in_any_objective; i++){
if(_point1[i] > _point2[i])
better_in_any_objective = true;
else if(_point1[i] < _point2[i])
worse_in_any_objective = true;
}
}
//_point1 dominates _point2 if it is better than _point2 on a objective and if it is never worse in any other objectives
return(!worse_in_any_objective && better_in_any_objective);
}
/**
* swap two elements of a vector
* @param _front the vector
@ -197,18 +197,13 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
* @param _j index of the second element to swap
*/
void swap(std::vector< std::vector<double> >& _front, unsigned int _i, unsigned int _j){
std::vector<double> _tmp;
_tmp= _front[_i];
_front.push_back(_front[_i]);
_front[_i]= _front[_j];
_front[_j]=_tmp;
//other way which don't work on windows
//_front.push_back(_front[_i]);
//front.back();
//_front.pop_back();
_front[_j]=_front.back();
_front.pop_back();
}
/**
* collect all nondominated points regarding the first '_no_objectives' objectives (dominated points are stored at the end of _front)
* @param _front the front
@ -218,7 +213,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
*/
unsigned int filter_nondominated_set( std::vector < std::vector< double > >& _front, unsigned int _no_points, unsigned int _no_objectives){
unsigned int i,j,n;
n=_no_points;
i=0;
while(i < n){
@ -243,7 +238,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
}
return n;
}
/**
* @param _front the front
* @param _no_points the number of points of the front to consider (index 0 to _no_points are considered)
@ -253,20 +248,20 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
double surface_unchanged_to(std::vector < std::vector< double > >& _front, unsigned int _no_points, unsigned int _objective){
unsigned int i;
double min, value;
if(_no_points < 1)
throw("Error in moeoHyperVolumeUnaryMetric::surface_unchanged_to -> argument2: _no_points must be greater than 0");
min = _front[0][_objective];
for(i=1; i < _no_points; i++){
value = _front[i][_objective];
if(value < min)
min = value;
min = value;
}
return min;
}
/**
* remove all points having a value <= 'threshold' regarding the dimension 'objective', only points of index 0 to _no_points are considered.
* points removed are swap at the end of the front.
@ -278,7 +273,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
*/
unsigned int reduce_nondominated_set(std::vector < std::vector< double > >& _front, unsigned int _no_points, unsigned int _objective, double _threshold){
unsigned int i,n ;
n=_no_points;
for(i=0; i < n ; i++)
if(_front[i][_objective] <= _threshold){
@ -286,35 +281,35 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
swap(_front, i, n);
i--; //ATTENTION I had this to reconsider the point copied to index i (it can be useless verify algorythimic in calc_hypervolume)
}
return n;
}
/**
* calculate hypervolume of the front (data are redrafted before)
* @param _front the front
* @param _no_points the number of points of the front to consider (index 0 to _no_points are considered)
* @param _no_objectives the number of objective to consider
* @return the hypervolume of the front
* @return the hypervolume of the front
*/
double calc_hypervolume(std::vector < std::vector< double > >& _front, unsigned int _no_points, unsigned int _no_objectives){
unsigned int n;
double volume, distance;
volume=0;
distance=0;
n=_no_points;
while(n > 0){
unsigned int no_nondominated_points;
double temp_vol, temp_dist;
//get back the index of non dominated points of the front regarding the first "_nb_objectives - 1" objectives
//So one dimension is not determinante for the dominance
//So one dimension is not determinante for the dominance
no_nondominated_points = filter_nondominated_set(_front, n, _no_objectives - 1);
temp_vol=0;
//if there are less than 3 objectifs take the fisrt objectif of the first point of front to begin computation of hypervolume
if(_no_objectives < 3){
if(_no_objectives < 1)
@ -324,7 +319,7 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
//else if there at least 3 objectives, a recursive computation of hypervolume starts with _no_objectives -1 on the filter_nondominated_set calculating previously.
else
temp_vol= calc_hypervolume(_front, no_nondominated_points, _no_objectives - 1);
//search the next minimum distance on the dimension _no_objectives -1
temp_dist = surface_unchanged_to(_front, n, _no_objectives - 1);
//calculate the area
@ -332,27 +327,24 @@ class moeoHyperVolumeMetric : public moeoVectorUnaryMetric < ObjectiveVector , d
//change distance to have the good lenght on next step
distance= temp_dist;
//remove all points <= distance on dimension _no_objectives
n=reduce_nondominated_set(_front, n , _no_objectives - 1, distance);
n=reduce_nondominated_set(_front, n , _no_objectives - 1, distance);
}
return volume;
}
private:
/*boolean indicates if data must be normalized or not*/
bool normalize;
double rho;
ObjectiveVector ref_point;
/*vectors contains bounds for normalization*/
std::vector < eoRealInterval > bounds;
ObjectiveVector ref_point;
};

View file

@ -52,7 +52,6 @@
#include <algo/moeoNSGAII.h>
#include <algo/moeoSEEA.h>
#include <algo/moeoSPEA2.h>
#include <algo/moeoMOGA.h>
#include <archive/moeoArchive.h>
#include <archive/moeoUnboundedArchive.h>
@ -111,7 +110,6 @@
#include <fitness/moeoIndicatorBasedFitnessAssignment.h>
#include <fitness/moeoScalarFitnessAssignment.h>
#include <fitness/moeoUnaryIndicatorBasedFitnessAssignment.h>
#include <fitness/moeoAggregativeFitnessAssignment.h>
#include <metric/moeoAdditiveEpsilonBinaryMetric.h>
#include <metric/moeoContributionMetric.h>

View file

@ -63,14 +63,14 @@ public:
* Default constructor with paretoComparator
* @param _nocopy boolean allow to consider copy and doublons as bad element whose were dominated by all other MOEOT
*/
moeoDominanceMatrix(bool _nocopy=false):std::vector < std::vector<bool> >(), nocopy(_nocopy), comparator(paretoComparator) {}
moeoDominanceMatrix(bool _nocopy=false):std::vector < std::vector<bool> >(),comparator(paretoComparator), nocopy(_nocopy) {}
/**
* Constructor which allow to choose the comparator
* @param _nocopy boolean allow to consider copy and doublons as bad element whose were dominated by all other MOEOT
* @param _comparator the comparator you want to use for the comparaison of two MOEOT
*/
moeoDominanceMatrix(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, bool _nocopy=true):std::vector < std::vector<bool> >(), nocopy(_nocopy) , comparator(_comparator) {}
moeoDominanceMatrix(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, bool _nocopy=true):std::vector < std::vector<bool> >(),comparator(_comparator), nocopy(_nocopy) {}
/**
* Filling up the Dominance Matrix on one population

View file

@ -66,8 +66,6 @@ SET (TEST_LIST
t-moeoHyperVolumeDifferenceMetric
t-moeoIntVector
t-moeoBoundedArchive
t-moeoMOGA
t-moeoAggregativeFitnessAssignment
)
FOREACH (test ${TEST_LIST})

View file

@ -154,9 +154,9 @@ int main()
// fitness assignment
moeoDominanceCountRankingFitnessAssignment <Solution> fitnessAssignment(true);
moeoDominanceCountRankingFitnessAssignment <Solution> fitnessAssignment;
moeoDominanceCountRankingFitnessAssignment <Solution> fitnessAssignment2(archive, true);
moeoDominanceCountRankingFitnessAssignment <Solution> fitnessAssignment2(archive);
moeoDominanceCountRankingFitnessAssignment <Solution> fitnessAssignment3(paretoComparator,false);

View file

@ -8,11 +8,221 @@ SET(FLOWSHOP_BINARY_DIR ${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop)
######################################################################################
######################################################################################
### 2) Where must cmake go now ?
### 2) How to manage copy of benchs ?
######################################################################################
SUBDIRS(examples Lesson1 Lesson2 Lesson3)
IF(ENABLE_CMAKE_EXAMPLE OR CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SET(BENCH_LIST
020_05_01.txt
020_05_02.txt
020_10_01.txt
020_10_02.txt
020_20_01.txt
050_05_01.txt
050_10_01.txt
050_20_01.txt
100_05_01.txt
100_10_01.txt
100_20_01.txt
200_10_01.txt
README
)
FOREACH (bench ${BENCH_LIST})
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/${bench}
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/${bench}
)
ENDFOREACH (bench)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson1/Sch1.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson1/Sch1.param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson2/FlowShopEA.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson2/FlowShopEA.param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson3/FlowShopEA2.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson3/FlowShopEA2.param
)
ENDIF(ENABLE_CMAKE_EXAMPLE OR CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
MACRO(ADD_COMMANDS_MOEO)
ADD_CUSTOM_COMMAND(
OUTPUT
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/README
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/examples/flowshop/benchs/README
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/README
)
ADD_CUSTOM_COMMAND(
OUTPUT ${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson1/Sch1.param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson1/Sch1.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson1
)
ADD_CUSTOM_COMMAND(
OUTPUT ${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson2/FlowShopEA.param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson2/FlowShopEA.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson2
)
ADD_CUSTOM_COMMAND(
OUTPUT ${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson3/FlowShopEA2.param
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson3/FlowShopEA2.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson3
)
ENDMACRO(ADD_COMMANDS_MOEO)
MACRO(ADD_TARGET_MOEO n)
IF(${n} STREQUAL "lesson1")
ADD_CUSTOM_TARGET(lesson1 DEPENDS
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson1/Sch1
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson1/Sch1.param
)
ELSEIF(${n} STREQUAL "lesson2")
ADD_CUSTOM_TARGET(lesson2 DEPENDS
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson2/FlowShopEA
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson2/FlowShopEA.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
)
ELSEIF(${n} STREQUAL "lesson3")
ADD_CUSTOM_TARGET(lesson3 DEPENDS
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson3/FlowShopEA2
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson3/FlowShopEA2.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
)
ELSEIF(${n} STREQUAL "install")
ADD_CUSTOM_TARGET(install DEPENDS
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson1/Sch1.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson2/FlowShopEA.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson3/FlowShopEA2.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/README
)
ELSEIF(${n} STREQUAL "benchs")
ADD_CUSTOM_TARGET(benchs DEPENDS
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/README
)
ENDIF(${n} STREQUAL "lesson1")
ENDMACRO(ADD_TARGET_MOEO)
######################################################################################
### 3) Where must cmake go now ?
######################################################################################
ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(Lesson1)
ADD_SUBDIRECTORY(Lesson2)
ADD_SUBDIRECTORY(Lesson3)
######################################################################################
######################################################################################
### 4) Target to copy benchs and parameters file
######################################################################################
IF(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" AND NOT CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MOEO()
ADD_TARGET_MOEO(install)
ADD_TARGET_MOEO(benchs)
ENDIF(NOT CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" AND NOT CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")

View file

@ -1,20 +1,3 @@
######################################################################################
### 0) Copy the Sch1.param file in the build path for an easy use.
######################################################################################
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson1/Sch1.param)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson1/Sch1.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson1)
######################################################################################
######################################################################################
### 1) Include the sources
######################################################################################
@ -22,9 +5,6 @@ ADD_CUSTOM_COMMAND(
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/utils)
INCLUDE_DIRECTORIES(${ParadisEO-MOEO_SOURCE_DIR}/src)
######################################################################################
######################################################################################
### 2) Specify where CMake can find the libraries
@ -32,19 +12,26 @@ INCLUDE_DIRECTORIES(${ParadisEO-MOEO_SOURCE_DIR}/src)
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-MOEO_BINARY_DIR}/lib)
######################################################################################
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES Sch1.cpp)
ADD_EXECUTABLE(Sch1
Sch1.cpp
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson1/Sch1.param
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MOEO()
ADD_TARGET_MOEO(lesson1)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(Sch1 Sch1.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(Sch1 EXCLUDE_FROM_ALL Sch1.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_EXECUTABLE(Sch1 Sch1.cpp)
ADD_DEPENDENCIES(Sch1 moeo)
######################################################################################
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
@ -52,15 +39,11 @@ ADD_DEPENDENCIES(Sch1 moeo)
SET(SCH1_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(Sch1 PROPERTIES VERSION "${SCH1_VERSION}")
######################################################################################
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(Sch1 moeo eo eoutils)
######################################################################################

View file

@ -1,20 +1,3 @@
######################################################################################
### 0) Copy the FlowShop.param file in the build path for an easy use.
######################################################################################
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson2/FlowShopEA.param)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson2/FlowShopEA.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson2)
######################################################################################
######################################################################################
### 1) Include the sources
######################################################################################
@ -23,29 +6,59 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${ParadisEO-MOEO_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${FLOWSHOP_SRC_DIR})
######################################################################################
######################################################################################
### 2) Specify where CMake can find the libraries
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-MOEO_BINARY_DIR}/lib ${FLOWSHOP_BINARY_DIR}/lib)
######################################################################################
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(FlowShopEA FlowShopEA.cpp)
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES FlowShopEA.cpp)
SOURCE_GROUP(benchs FILES
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
)
ADD_EXECUTABLE(FlowShopEA
FlowShopEA.cpp
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson2/FlowShopEA.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MOEO()
ADD_TARGET_MOEO(lesson2)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(FlowShopEA FlowShopEA.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(FlowShopEA EXCLUDE_FROM_ALL FlowShopEA.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_DEPENDENCIES(FlowShopEA flowshop moeo)
######################################################################################
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
@ -53,15 +66,11 @@ ADD_DEPENDENCIES(FlowShopEA flowshop moeo)
SET(FLOWSHOPEA_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(FlowShopEA PROPERTIES VERSION "${FLOWSHOPEA_VERSION}")
######################################################################################
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(FlowShopEA moeo flowshop eo eoutils)
######################################################################################

View file

@ -1,20 +1,3 @@
######################################################################################
### 0) Copy the FlowShop.param file in the build path for an easy use.
######################################################################################
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson3/FlowShopEA2.param)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-MOEO_SOURCE_DIR}/tutorial/Lesson3/FlowShopEA2.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson3)
######################################################################################
######################################################################################
### 1) Include the sources
######################################################################################
@ -23,29 +6,59 @@ INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
INCLUDE_DIRECTORIES(${ParadisEO-MOEO_SOURCE_DIR}/src)
INCLUDE_DIRECTORIES(${FLOWSHOP_SRC_DIR})
######################################################################################
######################################################################################
### 2) Specify where CMake can find the libraries
######################################################################################
LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-MOEO_BINARY_DIR}/lib ${FLOWSHOP_BINARY_DIR}/lib)
######################################################################################
######################################################################################
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(FlowShopEA2 FlowShopEA2.cpp)
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
SOURCE_GROUP(src FILES FlowShopEA2.cpp)
SOURCE_GROUP(benchs FILES
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
)
ADD_EXECUTABLE(FlowShopEA2
FlowShopEA2.cpp
${ParadisEO-MOEO_BINARY_DIR}/tutorial/Lesson3/FlowShopEA2.param
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_05_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_10_02.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/020_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/050_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_05_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_10_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/100_20_01.txt
${ParadisEO-MOEO_BINARY_DIR}/tutorial/examples/flowshop/benchs/200_10_01.txt
)
ELSE(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_COMMANDS_MOEO()
ADD_TARGET_MOEO(lesson3)
IF(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(FlowShopEA2 FlowShopEA2.cpp)
ELSE(ENABLE_CMAKE_EXAMPLE)
ADD_EXECUTABLE(FlowShopEA2 EXCLUDE_FROM_ALL FlowShopEA2.cpp)
ENDIF(ENABLE_CMAKE_EXAMPLE)
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008")
ADD_DEPENDENCIES(FlowShopEA2 flowshop moeo)
######################################################################################
######################################################################################
### 4) Optionnal: define your target(s)'s version: no effect for windows
@ -53,15 +66,11 @@ ADD_DEPENDENCIES(FlowShopEA2 flowshop moeo)
SET(FlowShopEA2_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(FlowShopEA2 PROPERTIES VERSION "${FlowShopEA2_VERSION}")
######################################################################################
######################################################################################
### 5) Link the librairies for your target(s)
######################################################################################
TARGET_LINK_LIBRARIES(FlowShopEA2 moeo flowshop eo eoutils)
######################################################################################

View file

@ -7,7 +7,7 @@
###### Evolution Engine ######
--popSize=100 # -P : Population Size
--updateArch=1 # Update the archive at each gen.
--fitness=FastNonDominatedSorting # -F : Fitness assignment scheme: Dummy, FastNonDominatedSorting or IndicatorBased
--fitness=IndicatorBased # -F : Fitness assignment scheme: Dummy, DomDepth or IndicatorBased
--indicator=Epsilon # -i : Binary indicator for IndicatorBased: Epsilon, Hypervolume
--rho=1.1 # -r : reference point for the hypervolume indicator
--kappa=0.05 # -k : Scaling factor kappa for IndicatorBased

View file

@ -4,6 +4,6 @@
### 1) Where must cmake go now ?
######################################################################################
SUBDIRS(flowshop)
ADD_SUBDIRECTORY(flowshop)
######################################################################################

View file

@ -1,20 +1,3 @@
######################################################################################
### 0) Copy the "benchs" directory in the build directory to easily run the lessons
######################################################################################
ADD_CUSTOM_TARGET(install DEPENDS ${FLOWSHOP_SRC_DIR}/benchs)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_directory
${FLOWSHOP_SRC_DIR}/benchs
${FLOWSHOP_BINARY_DIR}/benchs)
######################################################################################
######################################################################################
### 1) Include the sources
######################################################################################

View file

@ -54,14 +54,7 @@
eoEvalFuncCounter<FlowShop> & do_make_eval(eoParser& _parser, eoState& _state)
{
// benchmark file name
std::string benchmarkFileName = _parser.getORcreateParam(std::string(), "BenchmarkFile", "Benchmark file name (benchmarks are available at www.lifl.fr/~liefooga/benchmarks)", 'B',"Representation", true).value();
if (benchmarkFileName == "")
{
std::string stmp = "*** Missing name of the benchmark file\n";
stmp += " Type '-B=the_benchmark_file_name' or '--BenchmarkFile=the_benchmark_file_name'\n";
stmp += " Benchmarks files are available at www.lifl.fr/~liefooga/benchmarks";
throw std::runtime_error(stmp.c_str());
}
std::string benchmarkFileName = _parser.getORcreateParam(std::string("../examples/flowshop/benchs/020_20_01.txt"), "BenchmarkFile", "Benchmark file name", 'B',"Representation", false).value();
// reading of the parameters contained in the benchmark file
FlowShopBenchmarkParser fParser(benchmarkFileName);
unsigned int M = fParser.getM();

View file

@ -52,14 +52,7 @@
eoInit<FlowShop> & do_make_genotype(eoParser& _parser, eoState& _state)
{
// benchmark file name
std::string benchmarkFileName = _parser.getORcreateParam(std::string(), "BenchmarkFile", "Benchmark file name (benchmarks are available at www.lifl.fr/~liefooga/benchmarks/)", 'B',"Representation", true).value();
if (benchmarkFileName == "")
{
std::string stmp = "*** Missing name of the benchmark file\n";
stmp += " Type '-B=the_benchmark_file_name' or '--BenchmarkFile=the_benchmark_file_name'\n";
stmp += " Benchmarks files are available at www.lifl.fr/~liefooga/benchmarks";
throw std::runtime_error(stmp.c_str());
}
std::string benchmarkFileName = _parser.getORcreateParam(std::string("../examples/flowshop/benchs/020_20_01.txt"), "BenchmarkFile", "Benchmark file name", 'B',"Representation", false).value();
// reading of number of jobs to schedule contained in the benchmark file
FlowShopBenchmarkParser fParser(benchmarkFileName);
unsigned int N = fParser.getN();

View file

@ -1,3 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
##########################################################################################################################################
### 0) If you want to set your own variables in peo-conf.cmake and avoid the cmd line
@ -15,15 +16,18 @@ INCLUDE(peo-conf.cmake OPTIONAL)
# check libxml2
FIND_PROGRAM(XML2_CONFIG_PROGRAM NAMES xml2-config PATHS /usr/local/bin /usr/bin DOC "The libxml2 (www.xmlsoft.org) configuration tool")
IF(NOT XML2_CONFIG_PROGRAM)
#IF(NOT XML2_CONFIG_PROGRAM)
#MESSAGE(FATAL_ERROR "Libxml2 cannot be found on your system. Libxml2 is required for ParadisEO-PEO install")
ENDIF(NOT XML2_CONFIG_PROGRAM)
#ENDIF(NOT XML2_CONFIG_PROGRAM)
# set libxml2 cflags in XML2_CFLAGS
EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --cflags OUTPUT_VARIABLE XML2_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
# set libxml2 libs in XML2_LIBS
EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --libs OUTPUT_VARIABLE XML2_LIBS)
# set libxml2 libs in XML2_LIBSINCLUDE(FindLibXml2)
EXECUTE_PROCESS(COMMAND ${XML2_CONFIG_PROGRAM} --libs OUTPUT_VARIABLE XML2_LIBS)
STRING(STRIP ${XML2_LIBS} XML2_LIBS)
######################################################################################
@ -36,10 +40,10 @@ PROJECT(ParadisEO-PEO)
SET(PACKAGE_BUGREPORT "paradiseo-help@lists.gforge.inria.fr" CACHE STRING "Package bug report" FORCE)
SET(PACKAGE_NAME "ParadisEO-PEO - Parallel and distributed Evolving Objects" CACHE STRING "Package name" FORCE)
SET(PACKAGE_STRING "ParadisEO-PEO 1.1" CACHE STRING "PEO Package string full name" FORCE)
SET(PACKAGE_VERSION "1.1" CACHE STRING "Package version" FORCE)
SET(GLOBAL_VERSION "1.1" CACHE STRING "Global version" FORCE)
SET(VERSION "1.1" CACHE STRING "Version" FORCE)
SET(PACKAGE_STRING "ParadisEO-PEO 1.2" CACHE STRING "PEO Package string full name" FORCE)
SET(PACKAGE_VERSION "1.2" CACHE STRING "Package version" FORCE)
SET(GLOBAL_VERSION "1.2" CACHE STRING "Global version" FORCE)
SET(VERSION "1.2" CACHE STRING "Version" FORCE)
##########################################################################################################################################

View file

@ -8,6 +8,7 @@ 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" \
@ -29,6 +30,7 @@ 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
@ -224,6 +226,8 @@ 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

View file

@ -3,6 +3,7 @@
### 1) Where must cmake go now ?
######################################################################################
SUBDIRS(core rmc)
ADD_SUBDIRECTORY(core)
ADD_SUBDIRECTORY(rmc)
######################################################################################

View file

@ -101,11 +101,10 @@ template< class TYPESELECT, class TYPEREPLACE > class peoAsyncIslandMig : public
//! @param std :: queue< TYPEREPLACE > imm
//! @param std :: queue< TYPESELECT > em
//! @param std :: queue< Cooperative* > coop_em
continuator & cont;
selector <TYPESELECT> & select;
replacement <TYPEREPLACE> & replace;
Topology& topology;
continuator & cont;
std :: queue< TYPEREPLACE > imm;
std :: queue< TYPESELECT > em;
std :: queue< Cooperative* > coop_em;

View file

@ -68,7 +68,8 @@ template <class POT> class peoPSOSelect: public eoSelectOne<POT>
//! @return POT&
virtual const POT& operator()(const eoPop<POT>& _pop)
{
return topology.globalBest(_pop);
//return topology.globalBest(_pop);
return topology.globalBest();
}
private:

View file

@ -4,6 +4,6 @@
### 1) Where must cmake go now ?
######################################################################################
SUBDIRS(mpi)
ADD_SUBDIRECTORY(mpi)
######################################################################################

View file

@ -35,7 +35,6 @@
*/
#include <iostream>
#include <cstdlib>
int main (int __argc, char *__argv[])
{

View file

@ -35,7 +35,6 @@
*/
#include <iostream>
#include <cstdlib>
int main (int __argc, char *__argv[])
{

View file

@ -14,6 +14,12 @@ SET(FLOWSHOP_BIN_DIR "${MOEO_BIN_DIR}/tutorial/examples/flowshop" CACHE PATH "Fl
### 2) Where must cmake go now ?
######################################################################################
SUBDIRS(examples Lesson1 Lesson2 Lesson3 Lesson4 Lesson5 Lesson6 Meta-models)
ADD_SUBDIRECTORY(examples)
ADD_SUBDIRECTORY(Lesson1)
ADD_SUBDIRECTORY(Lesson2)
ADD_SUBDIRECTORY(Lesson3)
ADD_SUBDIRECTORY(Lesson4)
ADD_SUBDIRECTORY(Lesson5)
ADD_SUBDIRECTORY(Lesson6)
ADD_SUBDIRECTORY(Meta-models)
######################################################################################

View file

@ -5,22 +5,31 @@
SET (CMAKE_CXX_COMPILER mpicxx)
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/schema.xml)
#ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/schema.xml)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson1)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/param
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson1)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/schema.xml
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson1)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson1
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson1/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson1)
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson1
)
######################################################################################
@ -48,7 +57,7 @@ LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib)
######################################################################################
ADD_EXECUTABLE(pso mainPSO.cpp)
ADD_DEPENDENCIES(pso peo rmc_mpi)
ADD_DEPENDENCIES(pso peo rmc_mpi)
ADD_EXECUTABLE(ea mainEA.cpp)
ADD_DEPENDENCIES(ea peo rmc_mpi)
######################################################################################

View file

@ -5,22 +5,31 @@
SET (CMAKE_CXX_COMPILER mpicxx)
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/schema.xml)
#ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/schema.xml)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson2)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson2)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/param
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson2)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/schema.xml
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson2)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson2
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson2/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson2
)
######################################################################################
@ -47,8 +56,8 @@ LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib)
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(ea mainEA.cpp)
ADD_DEPENDENCIES(ea peo rmc_mpi)
ADD_EXECUTABLE(ea2 mainEA.cpp)
ADD_DEPENDENCIES(ea2 peo rmc_mpi)
######################################################################################
@ -57,7 +66,7 @@ ADD_DEPENDENCIES(ea peo rmc_mpi)
######################################################################################
SET(LESSON2_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${LESSON2_VERSION}")
SET_TARGET_PROPERTIES(ea2 PROPERTIES VERSION "${LESSON2_VERSION}")
######################################################################################
@ -65,6 +74,6 @@ SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${LESSON2_VERSION}")
### 5) Link the librairies
######################################################################################
TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils peo)
TARGET_LINK_LIBRARIES(ea2 ${XML2_LIBS} peo rmc_mpi eo eoutils peo)
######################################################################################

View file

@ -5,22 +5,31 @@
SET (CMAKE_CXX_COMPILER mpicxx)
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/schema.xml)
#ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/schema.xml)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson3)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson3)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/param
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson3)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/schema.xml
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson3)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson3
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson3/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson3
)
######################################################################################
@ -47,10 +56,10 @@ LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib)
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(pso mainPSO.cpp)
ADD_DEPENDENCIES(pso peo rmc_mpi)
ADD_EXECUTABLE(ea mainEA.cpp)
ADD_DEPENDENCIES(ea peo rmc_mpi)
ADD_EXECUTABLE(pso3 mainPSO.cpp)
ADD_DEPENDENCIES(pso3 peo rmc_mpi)
ADD_EXECUTABLE(ea3 mainEA.cpp)
ADD_DEPENDENCIES(ea3 peo rmc_mpi)
######################################################################################
@ -59,8 +68,8 @@ ADD_DEPENDENCIES(ea peo rmc_mpi)
######################################################################################
SET(LESSON3_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(pso PROPERTIES VERSION "${LESSON3_VERSION}")
SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${LESSON3_VERSION}")
SET_TARGET_PROPERTIES(pso3 PROPERTIES VERSION "${LESSON3_VERSION}")
SET_TARGET_PROPERTIES(ea3 PROPERTIES VERSION "${LESSON3_VERSION}")
######################################################################################
@ -68,8 +77,8 @@ SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${LESSON3_VERSION}")
### 5) Link the librairies
######################################################################################
TARGET_LINK_LIBRARIES(pso ${XML2_LIBS} peo rmc_mpi eo eoutils peo)
TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils peo)
TARGET_LINK_LIBRARIES(pso3 ${XML2_LIBS} peo rmc_mpi eo eoutils peo)
TARGET_LINK_LIBRARIES(ea3 ${XML2_LIBS} peo rmc_mpi eo eoutils peo)
######################################################################################

View file

@ -5,22 +5,31 @@
SET (CMAKE_CXX_COMPILER mpicxx)
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/schema.xml)
#ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/schema.xml)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson4)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson4)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/param
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson4)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/schema.xml
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson4)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson4
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson4/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson4
)
######################################################################################

View file

@ -5,22 +5,31 @@
SET (CMAKE_CXX_COMPILER mpicxx)
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/schema.xml)
#ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/schema.xml)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson5)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson5)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/param
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson5)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/schema.xml
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson5)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson5
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson5/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson5
)
######################################################################################
@ -47,8 +56,8 @@ LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib)
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(ea main.cpp)
ADD_DEPENDENCIES(ea peo rmc_mpi)
ADD_EXECUTABLE(ea5 main.cpp)
ADD_DEPENDENCIES(ea5 peo rmc_mpi)
######################################################################################
@ -58,7 +67,7 @@ ADD_DEPENDENCIES(ea peo rmc_mpi)
######################################################################################
SET(Lesson5_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${Lesson5_VERSION}")
SET_TARGET_PROPERTIES(ea5 PROPERTIES VERSION "${Lesson5_VERSION}")
######################################################################################
@ -66,7 +75,7 @@ SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${Lesson5_VERSION}")
### 5) Link the librairies
######################################################################################
TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} peo rmc_mpi eo eoutils peo)
TARGET_LINK_LIBRARIES(ea5 ${XML2_LIBS} peo rmc_mpi eo eoutils peo)
######################################################################################

View file

@ -5,22 +5,31 @@
SET (CMAKE_CXX_COMPILER mpicxx)
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/schema.xml)
#ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/schema.xml)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/param
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/schema.xml
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Lesson6/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Lesson6
)
######################################################################################
@ -47,8 +56,8 @@ LINK_DIRECTORIES(${EO_BIN_DIR}/lib ${ParadisEO-PEO_BINARY_DIR}/lib ${TSP_BINARY_
### 3) Define your target(s): just an executable here
######################################################################################
ADD_EXECUTABLE(ea main.cpp)
ADD_DEPENDENCIES(ea peo rmc_mpi)
ADD_EXECUTABLE(ea6 main.cpp)
ADD_DEPENDENCIES(ea6 peo rmc_mpi)
######################################################################################
@ -58,7 +67,7 @@ ADD_DEPENDENCIES(ea peo rmc_mpi)
######################################################################################
SET(Lesson6_VERSION ${GLOBAL_VERSION})
SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${Lesson6_VERSION}")
SET_TARGET_PROPERTIES(ea6 PROPERTIES VERSION "${Lesson6_VERSION}")
######################################################################################
@ -66,7 +75,7 @@ SET_TARGET_PROPERTIES(ea PROPERTIES VERSION "${Lesson6_VERSION}")
### 5) Link the librairies
######################################################################################
TARGET_LINK_LIBRARIES(ea ${XML2_LIBS} tsp peo rmc_mpi eo eoutils peo)
TARGET_LINK_LIBRARIES(ea6 ${XML2_LIBS} tsp peo rmc_mpi eo eoutils peo)
######################################################################################

View file

@ -5,22 +5,31 @@
SET (CMAKE_CXX_COMPILER mpicxx)
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/schema.xml)
#ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/param ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/schema.xml)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Meta-models)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Meta-models)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/param
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Meta-models)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_if_different
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/schema.xml
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/Meta-models)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/param
${ParadisEO-PEO_BINARY_DIR}/tutorial/Meta-models
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/Meta-models/schema.xml
${ParadisEO-PEO_BINARY_DIR}/tutorial/Meta-models
)
######################################################################################

View file

@ -1,5 +1,5 @@
#include <iostream>
#include <stdlib.h>
#include <cstdlib>
int
main(int __argc, char *__argv[])

View file

@ -1,5 +1,5 @@
#include <iostream>
#include <stdlib.h>
#include <cstdlib>
int
main(int __argc, char *__argv[])

View file

@ -4,7 +4,7 @@
### 1) Where must cmake go now ?
######################################################################################
SUBDIRS(tsp)
ADD_SUBDIRECTORY(tsp)
######################################################################################

View file

@ -3,14 +3,30 @@
### 0) Copy the "benchs" directory in the build directory to easily run the lessons
######################################################################################
ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/examples/tsp/benchs)
ADD_CUSTOM_COMMAND(
TARGET install
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_directory
${ParadisEO-PEO_SOURCE_DIR}/tutorial/examples/tsp/benchs
${ParadisEO-PEO_BINARY_DIR}/tutorial/examples/tsp/benchs)
#ADD_CUSTOM_TARGET(install DEPENDS ${ParadisEO-PEO_SOURCE_DIR}/tutorial/examples/tsp/benchs)
#ADD_CUSTOM_COMMAND(
# TARGET install
# POST_BUILD
# COMMAND ${CMAKE_COMMAND}
# ARGS -E copy_directory
# ${ParadisEO-PEO_SOURCE_DIR}/tutorial/examples/tsp/benchs
# ${ParadisEO-PEO_BINARY_DIR}/tutorial/examples/tsp/benchs)
SET(BENCH_LIST
eil101.opt.tour
eil101.tsp
eil101.tsp.hc
)
FOREACH (bench ${BENCH_LIST})
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${ParadisEO-PEO_SOURCE_DIR}/tutorial/examples/tsp/benchs/${bench}
${ParadisEO-PEO_BINARY_DIR}/tutorial/examples/tsp/benchs/${bench}
)
ENDFOREACH (bench)
######################################################################################