* Add problems/DTLZ from http://paradiseo.gforge.inria.fr/index.php?n=Problems.DTLZ
This commit is contained in:
parent
dffd873774
commit
521c7e5bf5
64 changed files with 4770 additions and 0 deletions
33
problems/DTLZ/src/CMakeLists.txt
Normal file
33
problems/DTLZ/src/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
######################################################################################
|
||||
### 1) Include the sources
|
||||
######################################################################################
|
||||
|
||||
INCLUDE_DIRECTORIES(${PARADISEO_EO_SRC_DIR}/src)
|
||||
INCLUDE_DIRECTORIES(${PARADISEO_MOEO_SRC_DIR}/src)
|
||||
INCLUDE_DIRECTORIES(${PARADISEO_MO_SRC_DIR}/src)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 2) Define your target(s): just the flow-shop lib here
|
||||
######################################################################################
|
||||
|
||||
SET(DTLZ_LIB_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
SET(LIBRARY_OUTPUT_PATH ${DTLZ_LIB_OUTPUT_PATH})
|
||||
|
||||
SET (DTLZ_SOURCES
|
||||
DTLZ.cpp
|
||||
DTLZ1Eval.cpp
|
||||
DTLZ2Eval.cpp
|
||||
DTLZ3Eval.cpp
|
||||
DTLZ4Eval.cpp
|
||||
DTLZ5Eval.cpp
|
||||
DTLZ6Eval.cpp
|
||||
DTLZ7Eval.cpp)
|
||||
|
||||
ADD_LIBRARY(lDTLZ STATIC ${DTLZ_SOURCES})
|
||||
|
||||
######################################################################################
|
||||
|
||||
44
problems/DTLZ/src/DTLZ.cpp
Normal file
44
problems/DTLZ/src/DTLZ.cpp
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* <DTLZ.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <DTLZ.h>
|
||||
|
||||
std::string DTLZ::className() const
|
||||
{
|
||||
return "DTLZ";
|
||||
}
|
||||
58
problems/DTLZ/src/DTLZ.h
Normal file
58
problems/DTLZ/src/DTLZ.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* <DTLZ.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DTLZ_H_
|
||||
#define DTLZ_H_
|
||||
|
||||
#include <DTLZObjectiveVector.h>
|
||||
|
||||
/**
|
||||
* Structure of the genotype for DTLZ fonctions problem: a vector of double.
|
||||
*/
|
||||
class DTLZ : public moeoRealVector < DTLZObjectiveVector, double, double >
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* class name
|
||||
*/
|
||||
std::string className() const;
|
||||
|
||||
};
|
||||
|
||||
#endif /*DTLZ_H_*/
|
||||
74
problems/DTLZ/src/DTLZ1Eval.cpp
Normal file
74
problems/DTLZ/src/DTLZ1Eval.cpp
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* <DTLZ1Eval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <DTLZ1Eval.h>
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
// Ce code est implémenté à partir de DEME:Dtlz1.cpp
|
||||
void DTLZ1Eval::operator() (DTLZ & _element)
|
||||
{
|
||||
if (_element.invalidObjectiveVector())
|
||||
{
|
||||
int nbFun= DTLZ::ObjectiveVector::nObjectives();
|
||||
int nbVar= _element.size();
|
||||
int k;
|
||||
double g;
|
||||
DTLZObjectiveVector objVec(nbVar);
|
||||
|
||||
k = nbVar - nbFun + 1;
|
||||
g = 0.0;
|
||||
for (unsigned i = nbVar - k + 1; i <= nbVar; i++)
|
||||
g += pow(_element[i-1]-0.5,2) - cos(20 * M_PI * (_element[i-1]-0.5));
|
||||
|
||||
g = 100 *(k + g);
|
||||
|
||||
for (unsigned i = 1; i <= nbFun; i++) {
|
||||
double f = 0.5 * (1 + g);
|
||||
for (unsigned j = nbFun - i; j >= 1; j--)
|
||||
f *= _element[j-1];
|
||||
|
||||
if (i > 1)
|
||||
f *= 1 - _element[(nbFun - i + 1) - 1];
|
||||
|
||||
objVec[i-1] = f;
|
||||
}
|
||||
|
||||
_element.objectiveVector(objVec);
|
||||
}
|
||||
}
|
||||
|
||||
58
problems/DTLZ/src/DTLZ1Eval.h
Normal file
58
problems/DTLZ/src/DTLZ1Eval.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* <DTLZ1Eval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DSTLZ1EVAL_H_
|
||||
#define DSTLZ1EVAL_H_
|
||||
|
||||
#include <DTLZ.h>
|
||||
|
||||
/**
|
||||
* DTLZ1 Evaluation Fonction
|
||||
*/
|
||||
class DTLZ1Eval : public moeoEvalFunc <DTLZ>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* operator evaluates a genotype
|
||||
*/
|
||||
void operator () (DTLZ & _element);
|
||||
|
||||
};
|
||||
|
||||
#endif /*DSTLZ1EVAL_H_*/
|
||||
73
problems/DTLZ/src/DTLZ2Eval.cpp
Normal file
73
problems/DTLZ/src/DTLZ2Eval.cpp
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* <DTLZ2Eval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <DTLZ2Eval.h>
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
// Ce code est implémenté à partir de DEME:Dtlz1.cpp
|
||||
void DTLZ2Eval::operator() (DTLZ & _element)
|
||||
{
|
||||
if (_element.invalidObjectiveVector())
|
||||
{
|
||||
int nbFun= DTLZ::ObjectiveVector::nObjectives();
|
||||
int nbVar= _element.size();
|
||||
int k;
|
||||
double g;
|
||||
DTLZObjectiveVector objVec;
|
||||
|
||||
k = nbVar - nbFun + 1;
|
||||
g = 0.0;
|
||||
for (unsigned i = nbVar - k + 1; i <= nbVar; i++)
|
||||
g += pow(_element[i-1]-0.5,2);
|
||||
|
||||
for (unsigned i = 1; i <= nbFun; i++) {
|
||||
double f = (1 + g);
|
||||
for (unsigned j = nbFun - i; j >= 1; j--)
|
||||
f *= cos(_element[j-1] * M_PI / 2);
|
||||
|
||||
if (i > 1)
|
||||
f *= sin(_element[(nbFun - i + 1) - 1] * M_PI / 2);
|
||||
|
||||
objVec[i-1] = f;
|
||||
}
|
||||
|
||||
_element.objectiveVector(objVec);
|
||||
}
|
||||
}
|
||||
|
||||
57
problems/DTLZ/src/DTLZ2Eval.h
Normal file
57
problems/DTLZ/src/DTLZ2Eval.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* <DTLZ2Eval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DTLZ2EVAL_H_
|
||||
#define DTLZ2EVAL_H_
|
||||
|
||||
#include <DTLZ.h>
|
||||
|
||||
/**
|
||||
* DTLZ2 Evaluation Fonction
|
||||
*/
|
||||
class DTLZ2Eval : public moeoEvalFunc <DTLZ>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* operator evaluates a genotype
|
||||
*/
|
||||
void operator () (DTLZ & _element);
|
||||
|
||||
};
|
||||
|
||||
#endif /*DTLZ2EVAL_H_*/
|
||||
74
problems/DTLZ/src/DTLZ3Eval.cpp
Normal file
74
problems/DTLZ/src/DTLZ3Eval.cpp
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* <DTLZ3Eval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <DTLZ3Eval.h>
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
// Ce code est implémenté à partir de DEME:Dtlz1.cpp
|
||||
void DTLZ3Eval::operator() (DTLZ & _element)
|
||||
{
|
||||
if (_element.invalidObjectiveVector())
|
||||
{
|
||||
int nbFun= DTLZ::ObjectiveVector::nObjectives();
|
||||
int nbVar= _element.size();
|
||||
int k;
|
||||
double g;
|
||||
DTLZObjectiveVector objVec;
|
||||
|
||||
k = nbVar - nbFun + 1;
|
||||
g = 0.0;
|
||||
for (unsigned i = nbVar - k + 1; i <= nbVar; i++)
|
||||
g += pow(_element[i-1]-0.5,2) - cos( 20 * M_PI * (_element[i-1] - 0.5) );
|
||||
g = 100 * (k + g);
|
||||
|
||||
for (unsigned i = 1; i <= nbFun; i++) {
|
||||
double f = (1 + g);
|
||||
for (unsigned j = nbFun - i; j >= 1; j--)
|
||||
f *= cos(_element[j-1] * M_PI / 2);
|
||||
|
||||
if (i > 1)
|
||||
f *= sin(_element[(nbFun - i + 1) - 1] * M_PI / 2);
|
||||
|
||||
objVec[i-1] = f;
|
||||
}
|
||||
|
||||
_element.objectiveVector(objVec);
|
||||
}
|
||||
}
|
||||
|
||||
58
problems/DTLZ/src/DTLZ3Eval.h
Normal file
58
problems/DTLZ/src/DTLZ3Eval.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* <DTLZ3Eval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DTLZ3EVAL_H_
|
||||
#define DTLZ3EVAL_H_
|
||||
|
||||
#include <DTLZ.h>
|
||||
|
||||
/**
|
||||
* DTLZ3 Evaluation Fonction
|
||||
*/
|
||||
class DTLZ3Eval : public moeoEvalFunc <DTLZ>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* operator evaluates a genotype
|
||||
*/
|
||||
void operator () (DTLZ & _element);
|
||||
|
||||
};
|
||||
|
||||
#endif /*DTLZ3EVAL_H_*/
|
||||
75
problems/DTLZ/src/DTLZ4Eval.cpp
Normal file
75
problems/DTLZ/src/DTLZ4Eval.cpp
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* <DTLZ4Eval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <DTLZ4Eval.h>
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
DTLZ4Eval::DTLZ4Eval(double _alpha = 100):alpha(_alpha) {}
|
||||
|
||||
// Ce code est implémenté à partir de DEME:Dtlz1.cpp
|
||||
void DTLZ4Eval::operator() (DTLZ & _element)
|
||||
{
|
||||
if (_element.invalidObjectiveVector())
|
||||
{
|
||||
int nbFun= DTLZ::ObjectiveVector::nObjectives();
|
||||
int nbVar= _element.size();
|
||||
int k;
|
||||
double g;
|
||||
DTLZObjectiveVector objVec;
|
||||
|
||||
k = nbVar - nbFun + 1;
|
||||
g = 0.0;
|
||||
for (unsigned i = nbVar - k + 1; i <= nbVar; i++)
|
||||
g += pow(_element[i-1]-0.5,2);
|
||||
|
||||
for (unsigned i = 1; i <= nbFun; i++) {
|
||||
double f = (1 + g);
|
||||
for (unsigned j = nbFun - i; j >= 1; j--)
|
||||
f *= cos( pow(_element[j-1], alpha) * M_PI / 2);
|
||||
|
||||
if (i > 1)
|
||||
f *= sin( pow(_element[(nbFun - i + 1) - 1], alpha) * M_PI / 2);
|
||||
|
||||
objVec[i-1] = f;
|
||||
}
|
||||
|
||||
_element.objectiveVector(objVec);
|
||||
}
|
||||
}
|
||||
|
||||
68
problems/DTLZ/src/DTLZ4Eval.h
Normal file
68
problems/DTLZ/src/DTLZ4Eval.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* <DTLZ4Eval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DTLZ4EVAL_H_
|
||||
#define DTLZ4EVAL_H_
|
||||
|
||||
#include <DTLZ.h>
|
||||
|
||||
/**
|
||||
* DTLZ4 Evaluation Fonction
|
||||
*/
|
||||
class DTLZ4Eval : public moeoEvalFunc <DTLZ>
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @param _alpha parameter used in DTLZ4
|
||||
*/
|
||||
DTLZ4Eval(double _alpha);
|
||||
|
||||
/**
|
||||
* operator evaluates a genotype
|
||||
*/
|
||||
void operator () (DTLZ & _element);
|
||||
|
||||
private:
|
||||
/** parameter alpha */
|
||||
double alpha;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /*DTLZ4EVAL_H_*/
|
||||
|
||||
82
problems/DTLZ/src/DTLZ5Eval.cpp
Normal file
82
problems/DTLZ/src/DTLZ5Eval.cpp
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* <DTLZ5Eval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <DTLZ5Eval.h>
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
#define M_PI_2 1.57079632679489661923
|
||||
|
||||
// Ce code est implémenté à partir de DEME:Dtlz1.cpp
|
||||
void DTLZ5Eval::operator() (DTLZ & _element)
|
||||
{
|
||||
if (_element.invalidObjectiveVector())
|
||||
{
|
||||
int nbFun= DTLZ::ObjectiveVector::nObjectives();
|
||||
int nbVar= _element.size();
|
||||
int k;
|
||||
double g, t;
|
||||
DTLZObjectiveVector objVec;
|
||||
|
||||
double theta[nbFun-1];
|
||||
|
||||
k = nbVar - nbFun + 1;
|
||||
g = 0.0;
|
||||
for (unsigned i = nbVar - k + 1; i <= nbVar; i++)
|
||||
g += pow(_element[i-1]-0.5,2);
|
||||
|
||||
t= M_PI /(4 * (1 + g));
|
||||
|
||||
theta[0]= M_PI_2 * _element[0];
|
||||
for (unsigned i = 1; i <= nbFun - 2 ; i++)
|
||||
theta[i]= t * (1 + 2 * g * _element[i]);
|
||||
|
||||
for (unsigned i = 1; i <= nbFun; i++) {
|
||||
double f = (1 + g);
|
||||
for (unsigned j = nbFun - i; j >= 1; j--)
|
||||
f *= cos(theta[j-1]);
|
||||
|
||||
if (i > 1)
|
||||
f *= sin(theta[(nbFun - i + 1) - 1]);
|
||||
|
||||
objVec[i-1] = f;
|
||||
}
|
||||
|
||||
_element.objectiveVector(objVec);
|
||||
}
|
||||
}
|
||||
|
||||
59
problems/DTLZ/src/DTLZ5Eval.h
Normal file
59
problems/DTLZ/src/DTLZ5Eval.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* <DTLZ5Eval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DTLZ5EVAL_H_
|
||||
#define DTLZ5EVAL_H_
|
||||
|
||||
#include <DTLZ.h>
|
||||
|
||||
/**
|
||||
* DTLZ5 Evaluation Fonction
|
||||
*/
|
||||
class DTLZ5Eval : public moeoEvalFunc <DTLZ>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* operator evaluates a genotype
|
||||
*/
|
||||
void operator () (DTLZ & _element);
|
||||
|
||||
};
|
||||
|
||||
#endif /*DTLZ5EVAL_H_*/
|
||||
|
||||
81
problems/DTLZ/src/DTLZ6Eval.cpp
Normal file
81
problems/DTLZ/src/DTLZ6Eval.cpp
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* <DTLZ6Eval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <DTLZ6Eval.h>
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
// Ce code est implémenté à partir de DEME:Dtlz1.cpp
|
||||
void DTLZ6Eval::operator() (DTLZ & _element)
|
||||
{
|
||||
if (_element.invalidObjectiveVector())
|
||||
{
|
||||
int nbFun= DTLZ::ObjectiveVector::nObjectives();
|
||||
int nbVar= _element.size();
|
||||
int k;
|
||||
double g, t;
|
||||
DTLZObjectiveVector objVec;
|
||||
|
||||
double theta[nbFun-1];
|
||||
|
||||
k = nbVar - nbFun + 1;
|
||||
g = 0.0;
|
||||
for (unsigned i = nbVar - k + 1; i <= nbVar; i++)
|
||||
g += pow(_element[i-1],0.1);
|
||||
|
||||
t= M_PI /(4 * (1 + g));
|
||||
|
||||
theta[0]= M_PI * _element[0] / 2;
|
||||
for (unsigned i = 1; i <= nbFun - 2 ; i++)
|
||||
theta[i]= t * (1 + 2 * g * _element[i]);
|
||||
|
||||
for (unsigned i = 1; i <= nbFun; i++) {
|
||||
double f = (1 + g);
|
||||
for (unsigned j = nbFun - i; j >= 1; j--)
|
||||
f *= cos(theta[j-1]);
|
||||
|
||||
if (i > 1)
|
||||
f *= sin(theta[(nbFun - i + 1) - 1]);
|
||||
|
||||
objVec[i-1] = f;
|
||||
}
|
||||
|
||||
_element.objectiveVector(objVec);
|
||||
}
|
||||
}
|
||||
|
||||
60
problems/DTLZ/src/DTLZ6Eval.h
Normal file
60
problems/DTLZ/src/DTLZ6Eval.h
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* <DTLZ6Eval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DTLZ6EVAL_H_
|
||||
#define DTLZ6EVAL_H_
|
||||
|
||||
#include <DTLZ.h>
|
||||
|
||||
/**
|
||||
* DTLZ6 Evaluation Fonction
|
||||
*/
|
||||
class DTLZ6Eval : public moeoEvalFunc <DTLZ>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* operator evaluates a genotype
|
||||
*/
|
||||
void operator () (DTLZ & _element);
|
||||
|
||||
};
|
||||
|
||||
#endif /*DTLZ6EVAL_H_*/
|
||||
|
||||
|
||||
74
problems/DTLZ/src/DTLZ7Eval.cpp
Normal file
74
problems/DTLZ/src/DTLZ7Eval.cpp
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* <DTLZ7Eval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <DTLZ7Eval.h>
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
// Ce code est implémenté à partir de DEME:Dtlz1.cpp
|
||||
void DTLZ7Eval::operator() (DTLZ & _element)
|
||||
{
|
||||
if (_element.invalidObjectiveVector())
|
||||
{
|
||||
int nbFun= DTLZ::ObjectiveVector::nObjectives();
|
||||
int nbVar= _element.size();
|
||||
int k;
|
||||
double f, g, h;
|
||||
DTLZObjectiveVector objVec(nbVar);
|
||||
|
||||
k = nbVar - nbFun + 1;
|
||||
g = 0.0;
|
||||
h = 0.0;
|
||||
for (unsigned i = nbVar - k + 1; i <= nbVar; i++)
|
||||
g += _element[i-1];
|
||||
g= 1 + (9 * g ) / k;
|
||||
|
||||
|
||||
for (unsigned i = 1; i <= nbFun -1 ; i++)
|
||||
objVec[i-1]=_element[i-1];
|
||||
|
||||
for (unsigned i = 1 ; i< nbFun; i++)
|
||||
h += _element[i-1] / (1 + g) * (1 + sin(3 * M_PI * _element[i-1]));
|
||||
h = nbFun - h;
|
||||
|
||||
objVec[nbFun -1] = (1 + g) * h;
|
||||
|
||||
|
||||
_element.objectiveVector(objVec);
|
||||
}
|
||||
}
|
||||
|
||||
59
problems/DTLZ/src/DTLZ7Eval.h
Normal file
59
problems/DTLZ/src/DTLZ7Eval.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* <DTLZ7Eval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DTLZ7EVAL_H_
|
||||
#define DTLZ7EVAL_H_
|
||||
|
||||
#include <DTLZ.h>
|
||||
|
||||
/**
|
||||
* DTLZ7 Evaluation Fonction
|
||||
*/
|
||||
class DTLZ7Eval : public moeoEvalFunc <DTLZ>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* operator evaluates a genotype
|
||||
*/
|
||||
void operator () (DTLZ & _element);
|
||||
|
||||
};
|
||||
|
||||
#endif /*DTLZ7EVAL_H_*/
|
||||
|
||||
47
problems/DTLZ/src/DTLZObjectiveVector.h
Normal file
47
problems/DTLZ/src/DTLZObjectiveVector.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* <DTLZObjectiveVector.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef DTLZOBJECTIVEVECTOR_H_
|
||||
#define DTLZOBJECTIVEVECTOR_H_
|
||||
|
||||
#include <moeo>
|
||||
|
||||
/** define DTLZ Objective vector as a vector of double*/
|
||||
typedef moeoRealObjectiveVector<moeoObjectiveVectorTraits> DTLZObjectiveVector;
|
||||
|
||||
#endif /*DTLZOBJECTIVEVECTOR_H_*/
|
||||
123
problems/DTLZ/src/PolynomialMutation.h
Normal file
123
problems/DTLZ/src/PolynomialMutation.h
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
* <PolynomialMutation.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef POLYNOMIALMUTATION_H_
|
||||
#define POLYNOMIALMUTATION_H_
|
||||
|
||||
#include <utils/eoRealVectorBounds.h>
|
||||
|
||||
template<class EOT> class PolynomialMutation: public eoMonOp<EOT>
|
||||
{
|
||||
public:
|
||||
|
||||
PolynomialMutation(eoRealVectorBounds & _bounds, const double& _p_mut = 0.5, const double& _eta = 1.0):
|
||||
p_mut(_p_mut), eta(_eta), bounds(_bounds) {}
|
||||
|
||||
/// The class name.
|
||||
virtual std::string className() const {
|
||||
return "PolynomialMutation";
|
||||
}
|
||||
|
||||
/**
|
||||
* Do it!
|
||||
* @param _eo The indi undergoing the mutation
|
||||
*/
|
||||
bool operator()(EOT& _eo)
|
||||
{
|
||||
bool hasChanged=false;
|
||||
double rnd, delta1, delta2, mut_pow, deltaq, delta_max;
|
||||
double y, yl, yu, val, xy;
|
||||
|
||||
for (unsigned j=0; j<_eo.size(); j++)
|
||||
{
|
||||
if (rng.flip(p_mut))
|
||||
{
|
||||
y = _eo[j];
|
||||
|
||||
yl = bounds.minimum(j);
|
||||
yu = bounds.maximum(j);
|
||||
delta1 = (y-yl)/(yu-yl);
|
||||
delta2 = (yu-y)/(yu-yl);
|
||||
|
||||
|
||||
//Ajout
|
||||
if ( (y-yl) > (yu-y))
|
||||
delta_max = delta2;
|
||||
else
|
||||
delta_max= delta1;
|
||||
//fin ajout
|
||||
|
||||
rnd = rng.uniform();
|
||||
mut_pow = 1.0/(eta+1.0);
|
||||
if (rnd <= 0.5)
|
||||
{
|
||||
xy = 1.0-delta_max;//delta_max au lieu de delta1
|
||||
val = 2.0*rnd+(1.0-2.0*rnd)*(pow(xy,(eta+1.0)));
|
||||
deltaq = pow(val,mut_pow) - 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
xy = 1.0-delta_max;//delta_max au lieu de delta2
|
||||
val = 2.0*(1.0-rnd)+2.0*(rnd-0.5)*(pow(xy,(eta+1.0)));
|
||||
deltaq = 1.0 - (pow(val,mut_pow));
|
||||
}
|
||||
//ajout
|
||||
if (deltaq > delta_max)
|
||||
deltaq = delta_max;
|
||||
else if (deltaq < -delta_max)
|
||||
deltaq= -delta_max;
|
||||
//fin ajout
|
||||
y = y + deltaq*(yu-yl);
|
||||
|
||||
bounds.truncate(j, y);
|
||||
_eo[j] = y;
|
||||
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
return hasChanged;
|
||||
}
|
||||
|
||||
private:
|
||||
double p_mut;
|
||||
double eta;
|
||||
eoRealVectorBounds & bounds;
|
||||
};
|
||||
|
||||
#endif /*POLYNOMIALMUTATION_H_*/
|
||||
194
problems/DTLZ/src/SBXCrossover.h
Normal file
194
problems/DTLZ/src/SBXCrossover.h
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
/*
|
||||
* <SBXCrossover.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Arnaud Liefooghe
|
||||
* Jeremie Humeau
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
* license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
* "http://www.cecill.info".
|
||||
*
|
||||
* As a counterpart to the access to the source code and rights to copy,
|
||||
* modify and redistribute granted by the license, users are provided only
|
||||
* with a limited warranty and the software's author, the holder of the
|
||||
* economic rights, and the successive licensors have only limited liability.
|
||||
*
|
||||
* In this respect, the user's attention is drawn to the risks associated
|
||||
* with loading, using, modifying and/or developing or reproducing the
|
||||
* software by the user in light of its specific status of free software,
|
||||
* that may mean that it is complicated to manipulate, and that also
|
||||
* therefore means that it is reserved for developers and experienced
|
||||
* professionals having in-depth computer knowledge. Users are therefore
|
||||
* encouraged to load and test the software's suitability as regards their
|
||||
* requirements in conditions enabling the security of their systems and/or
|
||||
* data to be ensured and, more generally, to use and operate it in the
|
||||
* same conditions as regards security.
|
||||
* The fact that you are presently reading this means that you have had
|
||||
* knowledge of the CeCILL license and that you accept its terms.
|
||||
*
|
||||
* ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||
* Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef SBXCROSSOVER_H_
|
||||
#define SBXCROSSOVER_H_
|
||||
|
||||
#include <algorithm> // swap_ranges
|
||||
#include <utils/eoParser.h>
|
||||
#include <utils/eoRNG.h>
|
||||
#include <es/eoReal.h>
|
||||
#include <utils/eoRealBounds.h>
|
||||
#include <utils/eoRealVectorBounds.h>
|
||||
|
||||
template<class EOT> class SBXCrossover: public eoQuadOp<EOT>
|
||||
{
|
||||
public:
|
||||
/****
|
||||
* (Default) Constructor.
|
||||
* The bounds are initialized with the global object that says: no bounds.
|
||||
*
|
||||
*
|
||||
*/
|
||||
SBXCrossover(const double& _eta = 1.0) :
|
||||
bounds(eoDummyVectorNoBounds), eta(_eta), range(1) {}
|
||||
|
||||
|
||||
//////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Constructor with bounds
|
||||
* @param _bounds an eoRealVectorBounds that contains the bounds
|
||||
* @param _alphaMin the amount of exploration OUTSIDE the parents
|
||||
* as in BLX-alpha notation (Eshelman and Schaffer)
|
||||
* 0 == contractive application
|
||||
* Must be positive
|
||||
*/
|
||||
|
||||
|
||||
|
||||
SBXCrossover(eoRealVectorBounds & _bounds,
|
||||
const double& _eta = 1.0) :
|
||||
bounds(_bounds), eta(_eta), range(1) {}
|
||||
|
||||
///////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Constructor from a parser. Will read from the argument parser
|
||||
* eoRealVectorBounds that contains the bounds
|
||||
* eta, the SBX parameter
|
||||
*/
|
||||
|
||||
SBXCrossover(eoParser & _parser) :
|
||||
// First, decide whether the objective variables are bounded
|
||||
// Warning, must be the same keywords than other possible objectBounds elsewhere
|
||||
bounds (_parser.getORcreateParam(eoDummyVectorNoBounds, "objectBounds", "Bounds for variables", 'B', "Variation Operators").value()) ,
|
||||
// then get eta value
|
||||
eta (_parser.getORcreateParam(1.0, "eta", "SBX eta parameter", '\0', "Variation Operators").value()) ,
|
||||
range(1) {}
|
||||
|
||||
# define EPS 1.0e-14
|
||||
|
||||
/// The class name.
|
||||
virtual std::string className() const {
|
||||
return "SBXCrossover";
|
||||
}
|
||||
|
||||
/*****************************************
|
||||
* SBX crossover - modifies both parents *
|
||||
* @param _eo1 The first parent *
|
||||
* @param _eo2 The first parent *
|
||||
*****************************************/
|
||||
bool operator()(EOT& _eo1, EOT& _eo2)
|
||||
{
|
||||
unsigned i;
|
||||
double rand;
|
||||
double y1, y2, yl, yu;
|
||||
double c1, c2;
|
||||
double alpha, beta, betaq;
|
||||
bool changed = false;
|
||||
|
||||
for (i=0; i<_eo1.size(); i++)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
if (fabs(_eo1[i] - _eo2[i]) > EPS) // pour éviter la division par 0
|
||||
{
|
||||
// y2 doit être > à y1
|
||||
if (_eo1[i] < _eo2[i])
|
||||
{
|
||||
y1 = _eo1[i];
|
||||
y2 = _eo2[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
y1 = _eo2[i];
|
||||
y2 = _eo1[i];
|
||||
}
|
||||
yl = bounds.minimum(i);
|
||||
yu = bounds.maximum(i);
|
||||
|
||||
rand = rng.uniform();
|
||||
|
||||
beta = 1.0 + (2.0 * (y1 - yl) / (y2 - y1));
|
||||
alpha = 2.0 - pow( beta, -(eta + 1.0));
|
||||
if (rand <= (1.0/alpha))
|
||||
{
|
||||
betaq = pow ( (rand * alpha), (1.0 / (eta + 1.0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
betaq = pow ( (1.0 / (2.0 - rand * alpha)), (1.0 / (eta+1.0)));
|
||||
}
|
||||
c1 = 0.5 * ((y1 + y2) - betaq * (y2 - y1));
|
||||
|
||||
beta = 1.0 + (2.0 * (yu - y2) / (y2 - y1));
|
||||
alpha = 2.0 - pow( beta, -(eta + 1.0));
|
||||
if (rand <= (1.0/alpha))
|
||||
{
|
||||
betaq = pow ( (rand * alpha), (1.0 / (eta + 1.0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
betaq = pow ( (1.0 / (2.0 - rand * alpha)), (1.0 / (eta + 1.0)));
|
||||
}
|
||||
c2 = 0.5 * ((y1 + y2) + betaq * (y2 - y1));
|
||||
|
||||
bounds.truncate(i, c1);
|
||||
bounds.truncate(i, c2);
|
||||
|
||||
if (rng.flip())
|
||||
{
|
||||
_eo1[i] = c2;
|
||||
_eo2[i] = c1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_eo1[i] = c1;
|
||||
_eo2[i] = c2;
|
||||
}
|
||||
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
eoRealVectorBounds & bounds;
|
||||
double eta;
|
||||
double range; // == 1
|
||||
};
|
||||
|
||||
#endif /*SBXCROSSOVER_H_*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue