modif cmake configuration
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1277 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
1432128e88
commit
350bdfc7de
62 changed files with 144616 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
######################################################################################
|
||||
### 1) Where must cmake go now ?
|
||||
######################################################################################
|
||||
|
||||
#SUBDIRS(tsp function)
|
||||
ADD_SUBDIRECTORY(tsp)
|
||||
ADD_SUBDIRECTORY(function)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
######################################################################################
|
||||
### 0) Include the sources
|
||||
######################################################################################
|
||||
|
||||
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
|
||||
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 1) Define your target(s): just the tsp here
|
||||
######################################################################################
|
||||
|
||||
SET(FUNCTION_LIB_OUTPUT_PATH ${FUNCTION_BIN_DIR}/lib)
|
||||
SET(LIBRARY_OUTPUT_PATH ${FUNCTION_LIB_OUTPUT_PATH})
|
||||
|
||||
SET (FUNCTION_SOURCES affectation_eval.cpp
|
||||
affectation_init.cpp
|
||||
deviation.cpp
|
||||
deviation_init.cpp
|
||||
deviation_next.cpp
|
||||
deviation_incr_eval.cpp )
|
||||
|
||||
ADD_LIBRARY(function STATIC ${FUNCTION_SOURCES})
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 2) Optionnal: define your target(s)'s version: no effect for windows
|
||||
######################################################################################
|
||||
|
||||
SET(FUNCTION_VERSION "${GLOBAL_VERSION}")
|
||||
SET_TARGET_PROPERTIES(function PROPERTIES VERSION "${FUNCTION_VERSION}")
|
||||
######################################################################################
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* <affectation.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
* Sébastien Cahon, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef affectation_h
|
||||
#define affectation_h
|
||||
|
||||
#include <eoScalarFitness.h>
|
||||
#include <EO.h>
|
||||
|
||||
// A double that has to be minimized.
|
||||
typedef eoScalarFitness< double, std::greater<double> > functionFitness ;
|
||||
|
||||
class Affectation : public EO<functionFitness>, public std::pair<double, double>
|
||||
{};
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* <affectationEval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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 "affectation_eval.h"
|
||||
|
||||
void AffectationEval :: operator () (Affectation & _affectation)
|
||||
{
|
||||
double x1, x2, result;
|
||||
|
||||
//std::cout << "AffectationEval" << std::endl;
|
||||
|
||||
x1=_affectation.first;
|
||||
x2=_affectation.second;
|
||||
|
||||
result=(2*x1*x1) + (x2*x2) + (x1*x2) - (2*x1) - x2;
|
||||
|
||||
//std::cout << result << std::endl;
|
||||
|
||||
_affectation.fitness(result);
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* <affectationEval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef affectation_eval_h
|
||||
#define affectation_eval_h
|
||||
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
#include "affectation.h"
|
||||
|
||||
//! Affectation Evaluator
|
||||
class AffectationEval : public eoEvalFunc <Affectation>
|
||||
{
|
||||
|
||||
public :
|
||||
|
||||
void operator () (Affectation & _affectation) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* <affectation_init.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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 <utils/eoRNG.h>
|
||||
|
||||
#include "affectation_init.h"
|
||||
|
||||
AffectationInit::AffectationInit(double _bound): bound(_bound)
|
||||
{
|
||||
if(bound < 0.0)
|
||||
{
|
||||
std::cout << "[affectation_init.cpp][AffectationInit]: bound is negative, " << bound << " is tranformed to ";
|
||||
bound = -bound;
|
||||
std::cout << bound << "." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void AffectationInit::operator()(Affectation & _affectation)
|
||||
{
|
||||
eoBooleanGenerator booleanGenerator;
|
||||
|
||||
eoUniformGenerator<double> doubleGenerator(bound);
|
||||
|
||||
//A value between 0.0 and bound.
|
||||
_affectation.first = doubleGenerator();
|
||||
|
||||
//value or -value ?
|
||||
if(booleanGenerator())
|
||||
{
|
||||
_affectation.first= - _affectation.first;
|
||||
}
|
||||
|
||||
//A value between 0.0 and bound.
|
||||
_affectation.second = doubleGenerator();
|
||||
|
||||
//value or -value ?
|
||||
if(booleanGenerator())
|
||||
{
|
||||
_affectation.second= - _affectation.second;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* <affectation_init.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef affectation_init_h
|
||||
#define affectation_init_h
|
||||
|
||||
#include <eoInit.h>
|
||||
|
||||
#include "affectation.h"
|
||||
|
||||
class AffectationInit : public eoInit <Affectation>
|
||||
{
|
||||
|
||||
public :
|
||||
|
||||
AffectationInit(double _bound);
|
||||
|
||||
void operator () (Affectation & _affectation) ;
|
||||
|
||||
//! A bound for the initial value for the affectation
|
||||
double bound;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* <deviation.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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 "deviation.h"
|
||||
|
||||
void Deviation::operator () (Affectation & _affectation)
|
||||
{
|
||||
_affectation.first += first;
|
||||
_affectation.second += second;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* <deviation.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef deviation_h
|
||||
#define deviation_h
|
||||
|
||||
#include <moMove.h>
|
||||
#include "affectation.h"
|
||||
|
||||
class Deviation : public moMove <Affectation>, public std :: pair <double, double>
|
||||
{
|
||||
public :
|
||||
|
||||
void operator () (Affectation & _affectation) ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* <deviation_incr_eval.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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 "deviation_incr_eval.h"
|
||||
|
||||
functionFitness DeviationIncrEval :: operator () (const Deviation & _move, const Affectation & _affectation)
|
||||
{
|
||||
double x1, x2, deltaX1, deltaX2;
|
||||
|
||||
x1=_affectation.first;
|
||||
x2=_affectation.second;
|
||||
|
||||
deltaX1=_move.first;
|
||||
deltaX2=_move.second;
|
||||
|
||||
return _affectation.fitness()
|
||||
+ ( 2*deltaX1*deltaX1 ) + ( deltaX2*deltaX2 ) + ( deltaX1*deltaX2 ) - ( 2*deltaX1 ) - deltaX2
|
||||
+ ( deltaX1 * ( (4*x1) + x2 ) ) + ( x2*deltaX1 );
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* <deviation_incr_eval.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef deviation_incr_eval_h
|
||||
#define deviation_incr_eval_h
|
||||
|
||||
#include <moMoveIncrEval.h>
|
||||
#include "deviation.h"
|
||||
|
||||
class DeviationIncrEval : public moMoveIncrEval <Deviation>
|
||||
{
|
||||
public :
|
||||
|
||||
functionFitness operator () (const Deviation & _move, const Affectation & _affectation);
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* <deviation_init.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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 "deviation_init.h"
|
||||
|
||||
DeviationInit::DeviationInit(double _bound): bound(_bound)
|
||||
{
|
||||
if(bound < 0.0)
|
||||
{
|
||||
std::cout << "[deviation_init.cpp][DeviationInit]: bound is negative, " << bound << " is tranformed to ";
|
||||
bound = -bound;
|
||||
std::cout << bound << "." << std::endl;;
|
||||
}
|
||||
}
|
||||
|
||||
void DeviationInit::operator () (Deviation & _move, const Affectation & _affectation)
|
||||
{
|
||||
//Code only used to avoid compilation warning because _affectation is not used in this procedure.
|
||||
Affectation affectation(_affectation);
|
||||
|
||||
_move.first=-bound;
|
||||
_move.second=-bound;
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* <deviation_init.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef deviation_init_h
|
||||
#define deviation_init_h
|
||||
|
||||
#include <moMoveInit.h>
|
||||
#include <utils/eoRndGenerators.h>
|
||||
|
||||
#include "deviation.h"
|
||||
|
||||
/** It sets the first couple of edges */
|
||||
class DeviationInit : public moMoveInit <Deviation>
|
||||
{
|
||||
|
||||
public :
|
||||
|
||||
DeviationInit(double _bound);
|
||||
|
||||
void operator () (Deviation & _move, const Affectation & _affectation) ;
|
||||
|
||||
private :
|
||||
|
||||
//! A bound for the initial value for the deviations
|
||||
double bound;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* <deviation_next.cpp>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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 "deviation_next.h"
|
||||
|
||||
DeviationNext::DeviationNext(double _bound, double _step): bound(_bound), step(_step)
|
||||
{
|
||||
if(bound<0.0)
|
||||
{
|
||||
std::cout << "[deviation_next.cpp][DeviationNext]: bound is negative, " << bound << " is tranformed to ";
|
||||
bound=-bound;
|
||||
std::cout << bound << "." << std::endl;
|
||||
}
|
||||
|
||||
if(step<0.0)
|
||||
{
|
||||
std::cout << "[deviation_next.cpp][DeviationNext]: step is negative, " << step << " is tranformed to ";
|
||||
step=-step;
|
||||
std::cout << step << "." << std::endl;
|
||||
}
|
||||
|
||||
if(step>bound)
|
||||
{
|
||||
std::cout << "[deviation_next.cpp][DeviationNext]: step is higher than bound, " << step << " is tranformed to ";
|
||||
step = bound / 2;
|
||||
std::cout << step << "." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
bool DeviationNext::operator () (Deviation & _move, const Affectation & _affectation)
|
||||
{
|
||||
Affectation affectation(_affectation);
|
||||
|
||||
double deltaX1, deltaX2;
|
||||
|
||||
deltaX1=_move.first;
|
||||
deltaX2=_move.second;
|
||||
|
||||
//std::cout << "deltaX1 = " << deltaX1 << ", deltaX2 = " << deltaX2 << std::endl;
|
||||
|
||||
if( (deltaX1 >= bound) && (deltaX2 > bound) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(deltaX2 > bound)
|
||||
{
|
||||
deltaX1+=step;
|
||||
deltaX2=-bound;
|
||||
|
||||
_move.first=deltaX1;
|
||||
_move.second=deltaX2;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
deltaX2+=step;
|
||||
|
||||
_move.second=deltaX2;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* <deviation_next.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2008
|
||||
* (C) OPAC Team, LIFL, 2002-2008
|
||||
*
|
||||
* Sébastien Cahon, 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
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef deviation_next_h
|
||||
#define deviation_next_h
|
||||
|
||||
#include <moNextMove.h>
|
||||
#include "deviation.h"
|
||||
|
||||
class DeviationNext : public moNextMove <Deviation>
|
||||
{
|
||||
|
||||
public :
|
||||
|
||||
DeviationNext (double _bound, double _step);
|
||||
|
||||
bool operator () (Deviation & _move, const Affectation & _affectation) ;
|
||||
|
||||
|
||||
private :
|
||||
|
||||
//! A bound for the search in the neighbourhood.
|
||||
double bound;
|
||||
|
||||
//! A step between two values.
|
||||
double step;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* <function>
|
||||
* 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 __function
|
||||
#define __function
|
||||
|
||||
#include "function.h"
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* <tsp.h>
|
||||
* Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007
|
||||
* (C) OPAC Team, LIFL, 2002-2007
|
||||
*
|
||||
* 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 __function_h
|
||||
#define __function_h
|
||||
|
||||
#include "affectation.h"
|
||||
#include "affectation_eval.h"
|
||||
#include "affectation_init.h"
|
||||
#include "deviation.h"
|
||||
#include "deviation_incr_eval.h"
|
||||
#include "deviation_init.h"
|
||||
#include "deviation_next.h"
|
||||
|
||||
#endif
|
||||
45
branches/cmakemodif/paradiseo-mo/tutorial/examples/tsp/CMakeLists.txt
Executable file
45
branches/cmakemodif/paradiseo-mo/tutorial/examples/tsp/CMakeLists.txt
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
######################################################################################
|
||||
### 1) Include the sources
|
||||
######################################################################################
|
||||
|
||||
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
|
||||
INCLUDE_DIRECTORIES(${MO_SRC_DIR}/src)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 2) Define your target(s): just the tsp here
|
||||
######################################################################################
|
||||
|
||||
SET(TSP_LIB_OUTPUT_PATH ${TSP_BIN_DIR}/lib)
|
||||
SET(LIBRARY_OUTPUT_PATH ${TSP_LIB_OUTPUT_PATH})
|
||||
|
||||
SET (TSP_SOURCES graph.cpp
|
||||
route_init.cpp
|
||||
route_eval.cpp
|
||||
part_route_eval.cpp
|
||||
edge_xover.cpp
|
||||
order_xover.cpp
|
||||
route_valid.cpp
|
||||
partial_mapped_xover.cpp
|
||||
city_swap.cpp
|
||||
two_opt.cpp
|
||||
two_opt_init.cpp
|
||||
two_opt_next.cpp
|
||||
two_opt_incr_eval.cpp
|
||||
two_opt_tabu_list.cpp
|
||||
two_opt_rand.cpp)
|
||||
|
||||
ADD_LIBRARY(tsp STATIC ${TSP_SOURCES})
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
||||
######################################################################################
|
||||
### 3) Optionnal: define your target(s)'s version: no effect for windows
|
||||
######################################################################################
|
||||
|
||||
SET(TSP_VERSION "${GLOBAL_VERSION}")
|
||||
SET_TARGET_PROPERTIES(tsp PROPERTIES VERSION "${TSP_VERSION}")
|
||||
######################################################################################
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
NAME: berlin52
|
||||
TYPE: TSP
|
||||
COMMENT: 52 locations in Berlin (Groetschel)
|
||||
DIMENSION: 52
|
||||
EDGE_WEIGHT_TYPE: EUC_2D
|
||||
NODE_COORD_SECTION
|
||||
1 565.0 575.0
|
||||
2 25.0 185.0
|
||||
3 345.0 750.0
|
||||
4 945.0 685.0
|
||||
5 845.0 655.0
|
||||
6 880.0 660.0
|
||||
7 25.0 230.0
|
||||
8 525.0 1000.0
|
||||
9 580.0 1175.0
|
||||
10 650.0 1130.0
|
||||
11 1605.0 620.0
|
||||
12 1220.0 580.0
|
||||
13 1465.0 200.0
|
||||
14 1530.0 5.0
|
||||
15 845.0 680.0
|
||||
16 725.0 370.0
|
||||
17 145.0 665.0
|
||||
18 415.0 635.0
|
||||
19 510.0 875.0
|
||||
20 560.0 365.0
|
||||
21 300.0 465.0
|
||||
22 520.0 585.0
|
||||
23 480.0 415.0
|
||||
24 835.0 625.0
|
||||
25 975.0 580.0
|
||||
26 1215.0 245.0
|
||||
27 1320.0 315.0
|
||||
28 1250.0 400.0
|
||||
29 660.0 180.0
|
||||
30 410.0 250.0
|
||||
31 420.0 555.0
|
||||
32 575.0 665.0
|
||||
33 1150.0 1160.0
|
||||
34 700.0 580.0
|
||||
35 685.0 595.0
|
||||
36 685.0 610.0
|
||||
37 770.0 610.0
|
||||
38 795.0 645.0
|
||||
39 720.0 635.0
|
||||
40 760.0 650.0
|
||||
41 475.0 960.0
|
||||
42 95.0 260.0
|
||||
43 875.0 920.0
|
||||
44 700.0 500.0
|
||||
45 555.0 815.0
|
||||
46 830.0 485.0
|
||||
47 1170.0 65.0
|
||||
48 830.0 610.0
|
||||
49 605.0 625.0
|
||||
50 595.0 360.0
|
||||
51 1340.0 725.0
|
||||
52 1740.0 245.0
|
||||
EOF
|
||||
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
NAME: eil101
|
||||
TYPE: TSP
|
||||
COMMENT: 101-city problem (Christofides/Eilon)
|
||||
DIMENSION: 101
|
||||
EDGE_WEIGHT_TYPE: EUC_2D
|
||||
NODE_COORD_SECTION
|
||||
1 41 49
|
||||
2 35 17
|
||||
3 55 45
|
||||
4 55 20
|
||||
5 15 30
|
||||
6 25 30
|
||||
7 20 50
|
||||
8 10 43
|
||||
9 55 60
|
||||
10 30 60
|
||||
11 20 65
|
||||
12 50 35
|
||||
13 30 25
|
||||
14 15 10
|
||||
15 30 5
|
||||
16 10 20
|
||||
17 5 30
|
||||
18 20 40
|
||||
19 15 60
|
||||
20 45 65
|
||||
21 45 20
|
||||
22 45 10
|
||||
23 55 5
|
||||
24 65 35
|
||||
25 65 20
|
||||
26 45 30
|
||||
27 35 40
|
||||
28 41 37
|
||||
29 64 42
|
||||
30 40 60
|
||||
31 31 52
|
||||
32 35 69
|
||||
33 53 52
|
||||
34 65 55
|
||||
35 63 65
|
||||
36 2 60
|
||||
37 20 20
|
||||
38 5 5
|
||||
39 60 12
|
||||
40 40 25
|
||||
41 42 7
|
||||
42 24 12
|
||||
43 23 3
|
||||
44 11 14
|
||||
45 6 38
|
||||
46 2 48
|
||||
47 8 56
|
||||
48 13 52
|
||||
49 6 68
|
||||
50 47 47
|
||||
51 49 58
|
||||
52 27 43
|
||||
53 37 31
|
||||
54 57 29
|
||||
55 63 23
|
||||
56 53 12
|
||||
57 32 12
|
||||
58 36 26
|
||||
59 21 24
|
||||
60 17 34
|
||||
61 12 24
|
||||
62 24 58
|
||||
63 27 69
|
||||
64 15 77
|
||||
65 62 77
|
||||
66 49 73
|
||||
67 67 5
|
||||
68 56 39
|
||||
69 37 47
|
||||
70 37 56
|
||||
71 57 68
|
||||
72 47 16
|
||||
73 44 17
|
||||
74 46 13
|
||||
75 49 11
|
||||
76 49 42
|
||||
77 53 43
|
||||
78 61 52
|
||||
79 57 48
|
||||
80 56 37
|
||||
81 55 54
|
||||
82 15 47
|
||||
83 14 37
|
||||
84 11 31
|
||||
85 16 22
|
||||
86 4 18
|
||||
87 28 18
|
||||
88 26 52
|
||||
89 26 35
|
||||
90 31 67
|
||||
91 15 19
|
||||
92 22 22
|
||||
93 18 24
|
||||
94 26 27
|
||||
95 25 24
|
||||
96 22 27
|
||||
97 25 21
|
||||
98 19 21
|
||||
99 20 26
|
||||
100 18 18
|
||||
101 35 35
|
||||
EOF
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue