git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2331 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
3e9c8c95fd
commit
072c9c0a48
6 changed files with 0 additions and 438 deletions
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
<moComparator.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie 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 _moComparator_h
|
||||
#define _moComparator_h
|
||||
|
||||
#include <EO.h>
|
||||
#include <eoFunctor.h>
|
||||
|
||||
|
||||
/**
|
||||
* Comparator of two types
|
||||
*/
|
||||
template< class T1, class T2 >
|
||||
class moComparator : public eoBF<const T1 & , const T2 & , bool>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* @param _ref1 a reference on a variable of type T1
|
||||
* @param _ref2 a reference on a variable of type T2
|
||||
* @return true if _ref1 and _ref2 are equals
|
||||
*/
|
||||
virtual bool equals(const T1& _ref1, const T2& _ref2) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
<moEqualNeighborComparator.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie 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 _moEqualNeighborComparator_h
|
||||
#define _moEqualNeighborComparator_h
|
||||
|
||||
#include <neighborhood/moNeighbor.h>
|
||||
#include <comparator/moNeighborComparator.h>
|
||||
|
||||
/**
|
||||
* Comparator of two neighbors : a neighbor is better if the fitness is higher or equal
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moEqualNeighborComparator : public moNeighborComparator<Neighbor>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Compare two neighbors
|
||||
* @param _neighbor1 the first neighbor
|
||||
* @param _neighbor2 the second neighbor
|
||||
* @return true if the neighbor2 is better or equal than neighbor1
|
||||
*/
|
||||
virtual bool operator()(const Neighbor& _neighbor1, const Neighbor& _neighbor2) {
|
||||
return (_neighbor1.fitness() <= _neighbor2.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the class Name
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moEqualNeighborComparator";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
<moEqualSolNeighborComparator.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie 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 _moEqualSolNeighborComparator_h
|
||||
#define _moEqualSolNeighborComparator_h
|
||||
|
||||
#include <EO.h>
|
||||
#include <eoFunctor.h>
|
||||
|
||||
#include <neighborhood/moNeighbor.h>
|
||||
#include <comparator/moSolNeighborComparator.h>
|
||||
|
||||
|
||||
/**
|
||||
* Comparator of a solution and its neighbor : a neighbor is better if the fitness is higher or equal
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moEqualSolNeighborComparator : public moSolNeighborComparator<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT ;
|
||||
|
||||
/**
|
||||
* Compare two neighbors
|
||||
* @param _sol the solution
|
||||
* @param _neighbor the neighbor
|
||||
* @return true if the neighbor is better or equal than sol
|
||||
*/
|
||||
virtual bool operator()(const EOT& _sol, const Neighbor& _neighbor) {
|
||||
return (_sol.fitness() <= _neighbor.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the class Name
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moEqualSolNeighborComparator";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
/*
|
||||
<moNeighborComparator.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie 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 _moNeighborComparator_h
|
||||
#define _moNeighborComparator_h
|
||||
|
||||
#include <neighborhood/moNeighbor.h>
|
||||
#include <comparator/moComparator.h>
|
||||
|
||||
/**
|
||||
* Comparator of two neighbors
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moNeighborComparator : public moComparator<Neighbor, Neighbor>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Compare two neighbors
|
||||
* @param _neighbor1 the first neighbor
|
||||
* @param _neighbor2 the second neighbor
|
||||
* @return true if the neighbor2 is better than neighbor1
|
||||
*/
|
||||
virtual bool operator()(const Neighbor& _neighbor1, const Neighbor& _neighbor2) {
|
||||
return (_neighbor1.fitness() < _neighbor2.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two neighbors
|
||||
* @param _neighbor1 the first neighbor
|
||||
* @param _neighbor2 the second neighbor
|
||||
* @return true if the neighbor2 is equal to neighbor1
|
||||
*/
|
||||
virtual bool equals(const Neighbor& _neighbor1, const Neighbor& _neighbor2) {
|
||||
return (_neighbor1.fitness() == _neighbor2.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the class Name
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moNeighborComparator";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
<moSolComparator.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can ue,
|
||||
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".
|
||||
|
||||
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 _moSolComparator_h
|
||||
#define _moSolComparator_h
|
||||
|
||||
#include <comparator/moComparator.h>
|
||||
|
||||
/**
|
||||
* Comparator of two solutions
|
||||
*/
|
||||
template< class EOT >
|
||||
class moSolComparator : public moComparator<EOT, EOT>
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Compare two solutions
|
||||
* @param _sol1 the first solution
|
||||
* @param _sol2 the second solution
|
||||
* @return true if the solution2 is better than solution1
|
||||
*/
|
||||
virtual bool operator()(const EOT& _sol1, const EOT& _sol2) {
|
||||
return (_sol1.fitness() < _sol2.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the equality between two solutions
|
||||
* @param _sol1 the first solution
|
||||
* @param _sol2 the second solution
|
||||
* @return true if the solution2 is equal to solution1
|
||||
*/
|
||||
virtual bool equals(const EOT& _sol1, const EOT& _sol2) {
|
||||
return (_sol1.fitness() == _sol2.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the class Name
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moSolComparator";
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
<moSolNeighborComparator.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie 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 _moSolNeighborComparator_h
|
||||
#define _moSolNeighborComparator_h
|
||||
|
||||
#include <EO.h>
|
||||
#include <eoFunctor.h>
|
||||
|
||||
#include <neighborhood/moNeighbor.h>
|
||||
#include <comparator/moComparator.h>
|
||||
|
||||
|
||||
/**
|
||||
* Comparator of a solution and its neighbor
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moSolNeighborComparator : public moComparator<typename Neighbor::EOT, Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT ;
|
||||
|
||||
/**
|
||||
* Compare two neighbors
|
||||
* @param _sol the solution
|
||||
* @param _neighbor the neighbor
|
||||
* @return true if the neighbor is better than sol
|
||||
*/
|
||||
virtual bool operator()(const EOT& _sol, const Neighbor& _neighbor) {
|
||||
return (_sol.fitness() < _neighbor.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the equality between two neighbors
|
||||
* @param _sol the solution
|
||||
* @param _neighbor the neighbor
|
||||
* @return true if the neighbor is equal to the solution
|
||||
*/
|
||||
virtual bool equals(const EOT& _sol, const Neighbor& _neighbor) {
|
||||
return (_sol.fitness() == _neighbor.fitness());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the class Name
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moSolNeighborComparator";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue