paradiseo new mo added
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1712 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
e2546ca8d5
commit
d7496cafff
116 changed files with 12034 additions and 0 deletions
4
trunk/paradiseo-mo/AUTHORS
Normal file
4
trunk/paradiseo-mo/AUTHORS
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Authors:
|
||||
Sebastien Verel
|
||||
Arnaud Liefooghe
|
||||
Jérémie Humeau
|
||||
41
trunk/paradiseo-mo/CMakeLists.txt
Normal file
41
trunk/paradiseo-mo/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
##########################################################################################################################################
|
||||
### 0) If you want to set your own variables in mo-conf.cmake and avoid the cmd line
|
||||
##########################################################################################################################################
|
||||
|
||||
INCLUDE(mo-conf.cmake OPTIONAL)
|
||||
|
||||
##########################################################################################################################################
|
||||
|
||||
|
||||
##########################################################################################################################################
|
||||
### 1) Project properties
|
||||
##########################################################################################################################################
|
||||
|
||||
# set the project name
|
||||
PROJECT(ParadisEO-MO)
|
||||
|
||||
SET(PACKAGE_BUGREPORT "paradiseo-help@lists.gforge.inria.fr" CACHE STRING "Package bug report" FORCE)
|
||||
SET(PACKAGE_NAME "ParadisEO-MO - Moving Objects" CACHE STRING "Package name" FORCE)
|
||||
SET(PACKAGE_STRING "ParadisEO-MO 1.3" CACHE STRING "MO Package string full name" FORCE)
|
||||
SET(PACKAGE_VERSION "1.3" CACHE STRING "Package version" FORCE)
|
||||
SET(GLOBAL_VERSION "1.3" CACHE STRING "Global version" FORCE)
|
||||
SET(VERSION "1.3.0" CACHE STRING "Version" FORCE)
|
||||
##########################################################################################################################################
|
||||
|
||||
|
||||
##########################################################################################################################################
|
||||
### 2) Include the common CMake configuration
|
||||
##########################################################################################################################################
|
||||
|
||||
# The "config" variable must be provided on the command line
|
||||
IF(NOT DEFINED config OR NOT config)
|
||||
MESSAGE(FATAL_ERROR "The \"config\" variable must be set on the command line to
|
||||
give the path of the install configuration file. ")
|
||||
ENDIF(NOT DEFINED config OR NOT config)
|
||||
|
||||
# Need the config file whose full path is given thanks to the "config" variable
|
||||
INCLUDE(${config})
|
||||
##########################################################################################################################################
|
||||
|
||||
7
trunk/paradiseo-mo/CTestConfig.cmake
Normal file
7
trunk/paradiseo-mo/CTestConfig.cmake
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
set(CTEST_PROJECT_NAME "ParadisEO")
|
||||
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
|
||||
|
||||
set(CTEST_DROP_METHOD "http")
|
||||
set(CTEST_DROP_SITE "cdash.inria.fr")
|
||||
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=ParadisEO")
|
||||
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
26
trunk/paradiseo-mo/doc/CMakeLists.txt
Executable file
26
trunk/paradiseo-mo/doc/CMakeLists.txt
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
##########################################################################################
|
||||
### MO Doc generation using Doxygen
|
||||
##########################################################################################
|
||||
|
||||
IF (DOXYGEN_FOUND)
|
||||
|
||||
SET(DOC_DIR ${CMAKE_BINARY_DIR}/doc CACHE PATH "MO documentation directory")
|
||||
SET(MO_DOC_CONFIG_FILE "mo.doxyfile" CACHE PATH "MO documentation configuration file")
|
||||
# define the doc target
|
||||
IF (DOXYGEN_EXECUTABLE)
|
||||
ADD_CUSTOM_TARGET(doc
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${MO_DOC_CONFIG_FILE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
ENDIF (DOXYGEN_EXECUTABLE)
|
||||
|
||||
# configure doxyfile file
|
||||
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/doc/${MO_DOC_CONFIG_FILE}.cmake"
|
||||
"${CMAKE_BINARY_DIR}/doc/${MO_DOC_CONFIG_FILE}")
|
||||
|
||||
ELSE (DOXYGEN_FOUND)
|
||||
MESSAGE(STATUS "Unable to generate the documentation, Doxygen package not found")
|
||||
ENDIF (DOXYGEN_FOUND)
|
||||
|
||||
##########################################################################################
|
||||
1523
trunk/paradiseo-mo/doc/mo.doxyfile.cmake
Normal file
1523
trunk/paradiseo-mo/doc/mo.doxyfile.cmake
Normal file
File diff suppressed because it is too large
Load diff
22
trunk/paradiseo-mo/install.cmake
Normal file
22
trunk/paradiseo-mo/install.cmake
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#########################################################################################################
|
||||
# 1) ParadisEO install: SIMPLE Configuration
|
||||
#########################################################################################################
|
||||
|
||||
|
||||
# Here, just specify PARADISEO_DIR : the directory where ParadisEO has been installed
|
||||
SET(PARADISEO_DIR "${paradis}" CACHE PATH "ParadisEO directory" FORCE)
|
||||
|
||||
#########################################################################################################
|
||||
|
||||
|
||||
#########################################################################################################
|
||||
# 2) ParadisEO install: ADVANCED Configuration
|
||||
#########################################################################################################
|
||||
|
||||
SET(PARADISEO_EO_SRC_DIR "${PARADISEO_DIR}/paradiseo-eo" CACHE PATH "ParadisEO-EO source directory" FORCE)
|
||||
SET(PARADISEO_EO_BIN_DIR "${PARADISEO_DIR}/paradiseo-eo/build" CACHE PATH "ParadisEO-EO binary directory" FORCE)
|
||||
|
||||
SET(NEWMO_SRC_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "ParadisEO-EO source directory" FORCE)
|
||||
SET(NEWMO_BIN_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "ParadisEO-EO binary directory" FORCE)
|
||||
|
||||
|
||||
3
trunk/paradiseo-mo/src/CMakeLists.txt
Normal file
3
trunk/paradiseo-mo/src/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
###############################################################
|
||||
# This is a dummy file
|
||||
###############################################################
|
||||
112
trunk/paradiseo-mo/src/algo/moLocalSearch.h
Normal file
112
trunk/paradiseo-mo/src/algo/moLocalSearch.h
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
<moLocalSearch.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 _moLocalSearch_h
|
||||
#define _moLocalSearch_h
|
||||
|
||||
#include <explorer/moNeighborhoodExplorer.h>
|
||||
#include <continuator/moContinuator.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* the main algorithm of the local search
|
||||
*/
|
||||
template<class NHE>
|
||||
class moLocalSearch: public eoMonOp<typename NHE::EOT>
|
||||
{
|
||||
public:
|
||||
typedef NHE NeighborhoodExplorer ;
|
||||
typedef typename NeighborhoodExplorer::EOT EOT ;
|
||||
typedef typename NeighborhoodExplorer::Neighborhood Neighborhood ;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor of a moLocalSearch needs a NeighborhooExplorer and a Continuator
|
||||
*/
|
||||
moLocalSearch(NeighborhoodExplorer& _searchExpl, moContinuator<Neighborhood> & _continuator, eoEvalFunc<EOT>& _fullEval) : searchExplorer(_searchExpl), continuator(_continuator), fullEval(_fullEval) { } ;
|
||||
|
||||
/**
|
||||
* Run the local search on a solution
|
||||
* @param _solution the related solution
|
||||
*/
|
||||
virtual bool operator() (EOT & _solution) {
|
||||
|
||||
if(_solution.invalid())
|
||||
fullEval(_solution);
|
||||
|
||||
// initialization of the parameter of the search (for example fill empty the tabu list)
|
||||
searchExplorer.initParam(_solution);
|
||||
|
||||
// initialization of the external continuator (for example the time, or the number of generations)
|
||||
continuator.init(_solution);
|
||||
|
||||
bool b=continuator(_solution);
|
||||
|
||||
do {
|
||||
// explore the neighborhood of the solution
|
||||
searchExplorer(_solution);
|
||||
// if a solution in the neighborhood can be accepted
|
||||
if (searchExplorer.accept(_solution)){
|
||||
searchExplorer.move(_solution);
|
||||
searchExplorer.moveApplied(true);
|
||||
}
|
||||
else
|
||||
searchExplorer.moveApplied(false);
|
||||
|
||||
// update the parameter of the search (for ex. Temperature of the SA)
|
||||
searchExplorer.updateParam(_solution);
|
||||
|
||||
b=continuator(_solution);
|
||||
} while (b && searchExplorer.isContinue(_solution));
|
||||
|
||||
searchExplorer.terminate(_solution);
|
||||
|
||||
continuator.lastCall(_solution);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
private:
|
||||
// make the exploration of the neighborhood according to a local search heuristic
|
||||
NeighborhoodExplorer& searchExplorer ;
|
||||
|
||||
// external continuator
|
||||
moContinuator<Neighborhood>& continuator ;
|
||||
|
||||
//full evaluation function
|
||||
eoEvalFunc<EOT>& fullEval;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
73
trunk/paradiseo-mo/src/comparator/moComparator.h
Normal file
73
trunk/paradiseo-mo/src/comparator/moComparator.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
<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>
|
||||
|
||||
// moComparator => comparer deux solutions
|
||||
// idée :
|
||||
// - eoComparator
|
||||
// - moComparator qui hérite de eoComparator ?
|
||||
// - moeoComparator qui hérite de eoComparator
|
||||
// idée J :
|
||||
// - eoComparator<TYPE> : eoBF <const TYPE & , const TYPE & , bool>
|
||||
// - eoSolComparator : eoComparator<EOT> ?
|
||||
// - moNeighborCompartor : : eoComparator<Neighbor>
|
||||
//
|
||||
// une instantiation possible !!
|
||||
|
||||
|
||||
/**
|
||||
* Comparator of two types
|
||||
*/
|
||||
template< class T1, class T2 >
|
||||
class moComparator : public eoBF<const T1 & , const T2 & , bool>
|
||||
{
|
||||
public:
|
||||
virtual bool equals(const T1&, const T2&) = 0;
|
||||
|
||||
/**
|
||||
* Return the class id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moComparator";
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
83
trunk/paradiseo-mo/src/comparator/moNeighborComparator.h
Normal file
83
trunk/paradiseo-mo/src/comparator/moNeighborComparator.h
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
<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 <EO.h>
|
||||
#include <eoFunctor.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 id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moNeighborComparator";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
84
trunk/paradiseo-mo/src/comparator/moSolNeighborComparator.h
Normal file
84
trunk/paradiseo-mo/src/comparator/moSolNeighborComparator.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
<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 two neighbors
|
||||
*/
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare 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 id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moSolNeighborComparator";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
170
trunk/paradiseo-mo/src/continuator/moCheckpoint.h
Normal file
170
trunk/paradiseo-mo/src/continuator/moCheckpoint.h
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
<moCheckpoint.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 moCheckpoint_h
|
||||
#define moCheckpoint_h
|
||||
|
||||
#include <continuator/moContinuator.h>
|
||||
#include <utils/eoMonitor.h>
|
||||
#include <continuator/moStatBase.h>
|
||||
#include <utils/eoUpdater.h>
|
||||
|
||||
/**
|
||||
* Continuator allowing to add others (continuators, stats, monitors or updaters)
|
||||
*/
|
||||
template <class NH>
|
||||
class moCheckpoint : public moContinuator<NH> {
|
||||
public :
|
||||
|
||||
typedef NH Neighborhood ;
|
||||
typedef typename Neighborhood::EOT EOT ;
|
||||
|
||||
/**
|
||||
* Default constructor (moCheckpoint must have at least one continuator)
|
||||
* @param _cont a continuator
|
||||
* @param _interval frequency to compute statistical operators
|
||||
*/
|
||||
moCheckpoint(moContinuator<Neighborhood>& _cont, unsigned int _interval=1):interval(_interval), counter(0){
|
||||
continuators.push_back(&_cont);
|
||||
}
|
||||
|
||||
/**
|
||||
* add a continuator to the checkpoint
|
||||
* @param _cont a continuator
|
||||
*/
|
||||
void add(moContinuator<Neighborhood>& _cont) {
|
||||
continuators.push_back(&_cont);
|
||||
}
|
||||
|
||||
/**
|
||||
* add a statistic operator to the checkpoint
|
||||
* @param _stat a statistic operator
|
||||
*/
|
||||
void add(moStatBase<EOT>& _stat) {
|
||||
stats.push_back(&_stat);
|
||||
}
|
||||
|
||||
/**
|
||||
* add a monitor to the checkpoint
|
||||
* @param _mon a monitor
|
||||
*/
|
||||
void add(eoMonitor& _mon) {
|
||||
monitors.push_back(&_mon);
|
||||
}
|
||||
|
||||
/**
|
||||
* add a updater to the checkpoint
|
||||
* @param _upd an updater
|
||||
*/
|
||||
void add(eoUpdater& _upd) {
|
||||
updaters.push_back(&_upd);
|
||||
}
|
||||
|
||||
/**
|
||||
* init all continuators containing in the checkpoint regarding a solution
|
||||
* @param _sol the corresponding solution
|
||||
*/
|
||||
virtual void init(EOT& _sol) {
|
||||
for(unsigned i = 0; i < continuators.size(); ++i)
|
||||
continuators[i]->init(_sol);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return class name
|
||||
*/
|
||||
virtual std::string className(void) const {
|
||||
return "moCheckpoint";
|
||||
}
|
||||
|
||||
/**
|
||||
* apply operator of checkpoint's containers
|
||||
* @param _sol reference of the solution
|
||||
* @return true if all continuator return true
|
||||
*/
|
||||
bool operator()(EOT & _sol) {
|
||||
unsigned i;
|
||||
bool bContinue = true;
|
||||
|
||||
for (i = 0; i < stats.size(); ++i){
|
||||
if(counter % interval == 0)
|
||||
(*stats[i])(_sol);
|
||||
counter++;
|
||||
}
|
||||
|
||||
for (i = 0; i < updaters.size(); ++i)
|
||||
(*updaters[i])();
|
||||
|
||||
for (i = 0; i < monitors.size(); ++i)
|
||||
(*monitors[i])();
|
||||
|
||||
for (i = 0; i < continuators.size(); ++i)
|
||||
if ( !(*continuators[i])(_sol) )
|
||||
bContinue = false;
|
||||
|
||||
return bContinue;
|
||||
}
|
||||
|
||||
/**
|
||||
* last call of statistic operators, monitors and updaters
|
||||
* @param _sol reference of the solution
|
||||
*/
|
||||
void lastCall(EOT& _sol){
|
||||
unsigned int i;
|
||||
for (i = 0; i < stats.size(); ++i)
|
||||
stats[i]->lastCall(_sol);
|
||||
|
||||
for (i = 0; i < updaters.size(); ++i)
|
||||
updaters[i]->lastCall();
|
||||
|
||||
for (i = 0; i < monitors.size(); ++i)
|
||||
monitors[i]->lastCall();
|
||||
}
|
||||
|
||||
private :
|
||||
/** continuators vector */
|
||||
std::vector<moContinuator<Neighborhood>*> continuators;
|
||||
/** statistic operators vector */
|
||||
std::vector<moStatBase<EOT>*> stats;
|
||||
/** monitors vector */
|
||||
std::vector<eoMonitor*> monitors;
|
||||
/** updaters vector */
|
||||
std::vector<eoUpdater*> updaters;
|
||||
|
||||
unsigned int interval;
|
||||
unsigned int counter;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
63
trunk/paradiseo-mo/src/continuator/moContinuator.h
Normal file
63
trunk/paradiseo-mo/src/continuator/moContinuator.h
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
<moContinuator.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 _moContinuator_h
|
||||
#define _moContinuator_h
|
||||
|
||||
#include <eoFunctor.h>
|
||||
|
||||
/**
|
||||
* To make specific continuator from a solution
|
||||
*/
|
||||
template< class NH >
|
||||
class moContinuator : public eoUF<typename NH::EOT &, bool>
|
||||
{
|
||||
public:
|
||||
typedef NH Neighborhood ;
|
||||
typedef typename Neighborhood::EOT EOT ;
|
||||
|
||||
/**
|
||||
* Init Continuator parameters
|
||||
* @param _solution the related solution
|
||||
*/
|
||||
virtual void init(EOT& _solution){};
|
||||
|
||||
/**
|
||||
* Last Call to terminate the checkpoint
|
||||
* @param _solution the related solution
|
||||
*/
|
||||
virtual void lastCall(EOT& _solution){};
|
||||
};
|
||||
|
||||
#endif
|
||||
97
trunk/paradiseo-mo/src/continuator/moCounterMonitorSaver.h
Normal file
97
trunk/paradiseo-mo/src/continuator/moCounterMonitorSaver.h
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
<moCounterMonitorSaver.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 moCounterMonitorSaver_h
|
||||
#define moCounterMonitorSaver_h
|
||||
|
||||
#include <utils/eoUpdater.h>
|
||||
#include <utils/eoMonitor.h>
|
||||
|
||||
/**
|
||||
* The actual class that will be used as base for all statistics
|
||||
* that need to be calculated over the solution
|
||||
* It is a moStatBase AND an eoValueParam so it can be used in Monitors.
|
||||
*/
|
||||
class moCounterMonitorSaver : public eoUpdater {
|
||||
public :
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _interval frequency to call monitors
|
||||
* @param _mon a monitor
|
||||
*/
|
||||
moCounterMonitorSaver(unsigned _interval, eoMonitor& _mon) : interval(_interval), counter(0) {
|
||||
monitors.push_back(&_mon);
|
||||
}
|
||||
|
||||
/**
|
||||
* call monitors if interval is reach by a counter
|
||||
*/
|
||||
void operator()(void) {
|
||||
if (counter++ % interval == 0)
|
||||
for (unsigned i = 0; i < monitors.size(); i++)
|
||||
(*monitors[i])();
|
||||
}
|
||||
|
||||
/**
|
||||
* last call of monitors
|
||||
*/
|
||||
void lastCall(void) {
|
||||
for (unsigned i = 0; i < monitors.size(); i++)
|
||||
monitors[i]->lastCall();
|
||||
}
|
||||
|
||||
/**
|
||||
* attach another monitor to this class
|
||||
* @param _mon the monitor to attach
|
||||
*/
|
||||
void add(eoMonitor& _mon) {
|
||||
monitors.push_back(&_mon);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return name of the class
|
||||
*/
|
||||
virtual std::string className(void) const { return "moCounterMonitorSaver"; }
|
||||
|
||||
private :
|
||||
/** interval and counter value */
|
||||
unsigned int interval, counter;
|
||||
|
||||
/** monitor's vector */
|
||||
std::vector<eoMonitor*> monitors;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
83
trunk/paradiseo-mo/src/continuator/moDistanceStat.h
Normal file
83
trunk/paradiseo-mo/src/continuator/moDistanceStat.h
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/*
|
||||
<moDistanceStat.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 moDistanceStat_h
|
||||
#define moDistanceStat_h
|
||||
|
||||
#include <utils/eoDistance.h>
|
||||
#include <continuator/moStat.h>
|
||||
|
||||
/**
|
||||
* The statistic gives the distance to a reference solution
|
||||
* The reference solution could be the global optimum, or the best knowed solution
|
||||
* It allows to compute the Fitness-Distance correlation (FDC)
|
||||
*/
|
||||
template <class EOT, class T = double>
|
||||
class moDistanceStat : public moStat<EOT, T>
|
||||
{
|
||||
public :
|
||||
using moStat< EOT, T >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _dist a distance
|
||||
* @param _ref the reference solution
|
||||
*/
|
||||
moDistanceStat(eoDistance<EOT> & _dist, EOT & _ref): moStat<EOT, T>(0, "distance"), dist(_dist), refSolution(_ref){}
|
||||
|
||||
/**
|
||||
* Compute distance between a solution and the reference solution
|
||||
* @param _sol a solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol){
|
||||
value() = dist(_sol, refSolution);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return name of the class
|
||||
*/
|
||||
virtual std::string className(void) const { return "moDistanceStat"; }
|
||||
|
||||
private:
|
||||
/** the distance */
|
||||
eoDistance<EOT> & dist;
|
||||
/**
|
||||
* the reference solution does not change during the run
|
||||
* it could be the best solution knowed of the problem
|
||||
*/
|
||||
EOT refSolution;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
74
trunk/paradiseo-mo/src/continuator/moFitnessStat.h
Normal file
74
trunk/paradiseo-mo/src/continuator/moFitnessStat.h
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
<moFitnessStat.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 moFitnessStat_h
|
||||
#define moFitnessStat_h
|
||||
|
||||
#include <continuator/moStat.h>
|
||||
|
||||
/**
|
||||
* The actual class that will be used as base for all statistics
|
||||
* that need to be calculated over the solution
|
||||
* It is a moStatBase AND an eoValueParam so it can be used in Monitors.
|
||||
*/
|
||||
template <class EOT, class T=typename EOT::Fitness>
|
||||
class moFitnessStat : public moStat<EOT, T>
|
||||
{
|
||||
public :
|
||||
typedef T Fitness;
|
||||
using moStat< EOT, Fitness >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _description a description of the stat
|
||||
*/
|
||||
moFitnessStat(std::string _description = "fitness"):
|
||||
moStat<EOT, Fitness>(Fitness(), _description){}
|
||||
|
||||
/**
|
||||
* store fitness value
|
||||
* @param _sol the corresponding solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol)
|
||||
{
|
||||
value() = _sol.fitness();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name of the class
|
||||
*/
|
||||
virtual std::string className(void) const { return "moFitnessStat"; }
|
||||
};
|
||||
|
||||
#endif
|
||||
78
trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h
Normal file
78
trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
<moMaxNeighborStat.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 moMaxNeighborStat_h
|
||||
#define moMaxNeighborStat_h
|
||||
|
||||
#include <continuator/moStat.h>
|
||||
#include <continuator/moNeighborhoodStat.h>
|
||||
|
||||
/**
|
||||
* From moNeighborhoodStat, to compute the max fitness in the neighborhood
|
||||
*/
|
||||
template< class Neighborhood >
|
||||
class moMaxNeighborStat : public moStat<typename Neighborhood::EOT, typename Neighborhood::EOT::Fitness>
|
||||
{
|
||||
public :
|
||||
typedef typename Neighborhood::EOT EOT ;
|
||||
typedef typename EOT::Fitness Fitness ;
|
||||
|
||||
using moStat< EOT, Fitness >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _nhStat a neighborhoodStat
|
||||
*/
|
||||
moMaxNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
|
||||
moStat<EOT, Fitness>(Fitness(), "min"), nhStat(_nhStat){}
|
||||
|
||||
/**
|
||||
* Set the max fitness in the neighborhood
|
||||
* @param _sol the corresponding solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol){
|
||||
value() = nhStat.getMax();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the class name
|
||||
*/
|
||||
virtual std::string className(void) const { return "moMaxNeighborStat"; }
|
||||
|
||||
private:
|
||||
/** moNeighborhoodStat */
|
||||
moNeighborhoodStat<Neighborhood> & nhStat;
|
||||
};
|
||||
|
||||
#endif
|
||||
78
trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h
Normal file
78
trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
<moMinNeighborStat.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 moMinNeighborStat_h
|
||||
#define moMinNeighborStat_h
|
||||
|
||||
#include <continuator/moStat.h>
|
||||
#include <continuator/moNeighborhoodStat.h>
|
||||
|
||||
/**
|
||||
* From moNeighborhoodStat, to compute the min fitness in the neighborhood
|
||||
*/
|
||||
template< class Neighborhood >
|
||||
class moMinNeighborStat : public moStat<typename Neighborhood::EOT, typename Neighborhood::EOT::Fitness>
|
||||
{
|
||||
public :
|
||||
typedef typename Neighborhood::EOT EOT ;
|
||||
typedef typename EOT::Fitness Fitness ;
|
||||
|
||||
using moStat< EOT, Fitness >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _nhStat a neighborhoodStat
|
||||
*/
|
||||
moMinNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
|
||||
moStat<EOT, Fitness>(Fitness(), "min"), nhStat(_nhStat){}
|
||||
|
||||
/**
|
||||
* Set the worst fitness in the neighborhood
|
||||
* @param _sol the corresponding solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol){
|
||||
value() = nhStat.getMin();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the class name
|
||||
*/
|
||||
virtual std::string className(void) const { return "moMinNeighborStat"; }
|
||||
|
||||
private:
|
||||
/** moNeighborhoodStat */
|
||||
moNeighborhoodStat<Neighborhood> & nhStat;
|
||||
};
|
||||
|
||||
#endif
|
||||
81
trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h
Normal file
81
trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
<moNbInfNeighborStat.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 moNbInfNeighborStat_h
|
||||
#define moNbInfNeighborStat_h
|
||||
|
||||
#include <continuator/moStat.h>
|
||||
#include <continuator/moNeighborhoodStat.h>
|
||||
|
||||
/**
|
||||
*
|
||||
* From moNeighborhoodStat, to compute the number of solutions in the neighborhood
|
||||
* with (strictly) lower fitness than the current solution
|
||||
*
|
||||
*/
|
||||
template< class Neighborhood >
|
||||
class moNbInfNeighborStat : public moStat<typename Neighborhood::EOT, unsigned>
|
||||
{
|
||||
public :
|
||||
typedef typename Neighborhood::EOT EOT ;
|
||||
typedef typename EOT::Fitness Fitness ;
|
||||
|
||||
using moStat< EOT, unsigned >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _nhStat a neighborhoodStat
|
||||
*/
|
||||
moNbInfNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
|
||||
moStat<EOT, unsigned>(0, "nb inf"), nhStat(_nhStat){}
|
||||
|
||||
/**
|
||||
* Set the number of solutions in the neighborhood with (strictly) lower fitness than the current solution
|
||||
* @param _sol the corresponding solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol){
|
||||
value() = nhStat.getNbInf();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the class name
|
||||
*/
|
||||
virtual std::string className(void) const { return "moNbInfNeighborStat"; }
|
||||
|
||||
private:
|
||||
/** moNeighborhoodStat */
|
||||
moNeighborhoodStat<Neighborhood> & nhStat;
|
||||
};
|
||||
|
||||
#endif
|
||||
81
trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h
Normal file
81
trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
<moNbSupNeighborStat.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 moNbSupNeighborStat_h
|
||||
#define moNbSupNeighborStat_h
|
||||
|
||||
#include <continuator/moStat.h>
|
||||
#include <continuator/moNeighborhoodStat.h>
|
||||
|
||||
/**
|
||||
*
|
||||
* From moNeighborhoodStat, to compute the number of solutions in the neighborhood
|
||||
* with higher fitness than the current solution
|
||||
*
|
||||
*/
|
||||
template< class Neighborhood >
|
||||
class moNbSupNeighborStat : public moStat<typename Neighborhood::EOT, unsigned>
|
||||
{
|
||||
public :
|
||||
typedef typename Neighborhood::EOT EOT ;
|
||||
typedef typename EOT::Fitness Fitness ;
|
||||
|
||||
using moStat< EOT, unsigned >::value;
|
||||
|
||||
/**
|
||||
* Default Constructor
|
||||
* @param _nhStat a neighborhoodStat
|
||||
*/
|
||||
moNbSupNeighborStat(moNeighborhoodStat<Neighborhood> & _nhStat):
|
||||
moStat<EOT, unsigned>(0, "nb sup"), nhStat(_nhStat){}
|
||||
|
||||
/**
|
||||
* Set the number of solutions in the neighborhood with better fitness than the current solution
|
||||
* @param _sol the corresponding solution
|
||||
*/
|
||||
virtual void operator()(EOT & _sol){
|
||||
value() = nhStat.getNbSup();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the class name
|
||||
*/
|
||||
virtual std::string className(void) const { return "moNbSupNeighborStat"; }
|
||||
|
||||
private:
|
||||
/** moNeighborhoodStat */
|
||||
moNeighborhoodStat<Neighborhood> & nhStat;
|
||||
};
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue