Migration from SVN
This commit is contained in:
parent
d7d6c3a217
commit
8cd56f37db
315 changed files with 0 additions and 4096888 deletions
17
mo/CMakeLists.txt
Normal file
17
mo/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
######################################################################################
|
||||
### 0) Include subdirectories
|
||||
######################################################################################
|
||||
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(src)
|
||||
|
||||
if(ENABLE_CMAKE_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif(ENABLE_CMAKE_TESTING)
|
||||
|
||||
if(ENABLE_CMAKE_EXAMPLE)
|
||||
if(${CMAKE_VERBOSE_MAKEFILE})
|
||||
message("MO Examples :")
|
||||
endif(${CMAKE_VERBOSE_MAKEFILE})
|
||||
add_subdirectory(tutorial)
|
||||
endif(ENABLE_CMAKE_EXAMPLE)
|
||||
37
mo/doc/CMakeLists.txt
Executable file
37
mo/doc/CMakeLists.txt
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
######################################################################################
|
||||
### 0) Documentation
|
||||
######################################################################################
|
||||
|
||||
if(DOXYGEN_FOUND)
|
||||
# Directory where the generation will be launched
|
||||
set(MO_DOC_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Documentation directory")
|
||||
# Name of the doxygene configuration file
|
||||
set(MO_DOC_CONFIG_FILE "mo.doxyfile" CACHE PATH "Documentation configuration file")
|
||||
if(DOXYGEN_EXECUTABLE)
|
||||
# Creating the custom target
|
||||
if(UNIX AND NOT ${CMAKE_VERBOSE_MAKEFILE})
|
||||
add_custom_target(doc-mo
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${MO_DOC_CONFIG_FILE} 2> /dev/null > /dev/null
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
else(UNIX AND NOT ${CMAKE_VERBOSE_MAKEFILE})
|
||||
add_custom_target(doc-mo
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${MO_DOC_CONFIG_FILE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif(UNIX AND NOT ${CMAKE_VERBOSE_MAKEFILE})
|
||||
endif(DOXYGEN_EXECUTABLE)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${MO_DOC_CONFIG_FILE}.cmake"
|
||||
"${MO_DOC_DIR}/${MO_DOC_CONFIG_FILE}")
|
||||
install(
|
||||
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DESTINATION local/share${INSTALL_SUB_DIR}/mo COMPONENT doc
|
||||
PATTERN "CMakeFiles" EXCLUDE
|
||||
PATTERN "cmake_install.cmake" EXCLUDE
|
||||
PATTERN "CTestTestfile.cmake" EXCLUDE
|
||||
PATTERN "Makefile" EXCLUDE
|
||||
PATTERN "mo.cfg" EXCLUDE
|
||||
PATTERN "mo.doxytag" EXCLUDE
|
||||
)
|
||||
else(DOXYGEN_FOUND)
|
||||
message(STATUS "Unable to generate the documentation, Doxygen package not found")
|
||||
endif(DOXYGEN_FOUND)
|
||||
|
||||
52
mo/doc/index.h
Normal file
52
mo/doc/index.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/** @mainpage Welcome to ParadisEO-MO
|
||||
|
||||
@section Introduction
|
||||
|
||||
ParadisEO-MO is a white-box object-oriented generic framework dedicated to the flexible design of local search algorithms (hill-climbing, tabu search, simulated annealing, ...)
|
||||
|
||||
@section tutorials Tutorials
|
||||
|
||||
Tutorials for ParadisEO-MO are available in the "Tutorials section" of the <a href="http://paradiseo.gforge.inria.fr">ParadisEO website</a>.
|
||||
|
||||
@section Design
|
||||
|
||||
For an introduction to the design of ParadisEO-MO,
|
||||
you can look at the <a href="http://paradiseo.gforge.inria.fr">ParadisEO website</a>.
|
||||
|
||||
@section LICENSE
|
||||
|
||||
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
|
||||
|
||||
*/
|
||||
|
||||
/** @page webpages Related webpages
|
||||
|
||||
- ParadisEO <a href="http://paradiseo.gforge.inria.fr">homepage</a>
|
||||
- INRIA GForge <a href="http://gforge.inria.fr/projects/paradiseo/">project page</a>
|
||||
- <a href="../../README">README</a>
|
||||
*/
|
||||
1523
mo/doc/mo.doxyfile.cmake
Normal file
1523
mo/doc/mo.doxyfile.cmake
Normal file
File diff suppressed because it is too large
Load diff
17
mo/src/CMakeLists.txt
Normal file
17
mo/src/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
######################################################################################
|
||||
### 0) Look for headers
|
||||
######################################################################################
|
||||
|
||||
file(GLOB HDRS *.h mo)
|
||||
install(FILES ${HDRS} DESTINATION local/include${INSTALL_SUB_DIR}/mo COMPONENT headers)
|
||||
|
||||
######################################################################################
|
||||
### 1) Install directories
|
||||
######################################################################################
|
||||
|
||||
install(DIRECTORY acceptCrit algo comparator continuator coolingSchedule eval eplorer memory neighborhood perturb problems sampling
|
||||
DESTINATION local/include${INSTALL_SUB_DIR}/mo
|
||||
COMPONENT headers
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
)
|
||||
|
||||
44
mo/src/acceptCrit/moAcceptanceCriterion.h
Normal file
44
mo/src/acceptCrit/moAcceptanceCriterion.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
<moAcceptanceCriterion.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 _moAcceptanceCriterion_h
|
||||
#define _moAcceptanceCriterion_h
|
||||
|
||||
#include <eoFunctor.h>
|
||||
#include <memory/moMemory.h>
|
||||
|
||||
/**
|
||||
* Abstract class for Acceptance criteria
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moAcceptanceCriterion : public eoBF<typename Neighbor::EOT&, typename Neighbor::EOT&, bool>, virtual public moMemory<Neighbor> {
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
57
mo/src/acceptCrit/moAlwaysAcceptCrit.h
Normal file
57
mo/src/acceptCrit/moAlwaysAcceptCrit.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
<moAlwaysAcceptCrit.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 _moAlwaysAcceptCrit_h
|
||||
#define _moAlwaysAcceptCrit_h
|
||||
|
||||
#include <acceptCrit/moAcceptanceCriterion.h>
|
||||
#include <memory/moDummyMemory.h>
|
||||
|
||||
/**
|
||||
* Acceptance Criterion for extreme diversification : always accept new solution
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moAlwaysAcceptCrit : public moAcceptanceCriterion<Neighbor>, public moDummyMemory<Neighbor> {
|
||||
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
|
||||
/**
|
||||
* Always accept the new solution
|
||||
* @param _sol1 the previous solution
|
||||
* @param _sol2 the new solution after local search
|
||||
* @return always true
|
||||
*/
|
||||
bool operator()(EOT& _sol1, EOT& _sol2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
76
mo/src/acceptCrit/moBetterAcceptCrit.h
Normal file
76
mo/src/acceptCrit/moBetterAcceptCrit.h
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
<moBetterAcceptCrit.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 _moBetterAcceptCrit_h
|
||||
#define _moBetterAcceptCrit_h
|
||||
|
||||
#include <acceptCrit/moAcceptanceCriterion.h>
|
||||
#include <memory/moDummyMemory.h>
|
||||
#include <comparator/moSolComparator.h>
|
||||
|
||||
/**
|
||||
* Acceptance Criterion for extreme intensification : accept if the new solution is better than previous one
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moBetterAcceptCrit : public moAcceptanceCriterion<Neighbor>, public moDummyMemory<Neighbor> {
|
||||
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
|
||||
/*
|
||||
constructor with a specific comparator
|
||||
|
||||
@param _comparator the comparaison method of two solutions
|
||||
*/
|
||||
moBetterAcceptCrit(moSolComparator<EOT>& _comparator):comparator(_comparator) {}
|
||||
|
||||
/*
|
||||
default constructor:
|
||||
compare the fitness value: accept if the fitness is higher
|
||||
*/
|
||||
moBetterAcceptCrit():comparator(defaultComparator) {}
|
||||
|
||||
/**
|
||||
* Accept if the new solution is better than previous one according to the comparator
|
||||
* @param _sol1 the previous solution
|
||||
* @param _sol2 the new solution after local search
|
||||
* @return true if the new solution is better than previous one
|
||||
*/
|
||||
bool operator()(EOT& _sol1, EOT& _sol2) {
|
||||
return comparator(_sol1, _sol2);
|
||||
}
|
||||
|
||||
private:
|
||||
moSolComparator<EOT>& comparator;
|
||||
|
||||
moSolComparator<EOT> defaultComparator;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
56
mo/src/algo/eoDummyMonOp.h
Normal file
56
mo/src/algo/eoDummyMonOp.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
<moDummyMonOp.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 _moDummyMonOp_h
|
||||
#define _moDummyMonOp_h
|
||||
|
||||
#include <eoOp.h>
|
||||
|
||||
/**
|
||||
* The mutation operator that does nothing at all !
|
||||
*/
|
||||
template<class EOT>
|
||||
class eoDummyMonOp: public eoMonOp<EOT> {
|
||||
public:
|
||||
/**
|
||||
* Do nothing on the solution
|
||||
* @param _solution the related solution
|
||||
*/
|
||||
virtual bool operator()(EOT & _solution) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
71
mo/src/algo/moDummyLS.h
Normal file
71
mo/src/algo/moDummyLS.h
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
<moDummyLS.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can 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 _moDummyLS_h
|
||||
#define _moDummyLS_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moDummyExplorer.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
|
||||
/**
|
||||
* Dummy Local Search:
|
||||
*
|
||||
* To do nothing, only the full evaluation of the solution if necessary ;-)
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moDummyLS: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
/**
|
||||
* Simple constructor
|
||||
* @param _fullEval the full evaluation function
|
||||
*/
|
||||
moDummyLS(eoEvalFunc<EOT>& _fullEval):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @return name of the class
|
||||
*/
|
||||
virtual std::string className(void) const {
|
||||
return "moDummyLS";
|
||||
}
|
||||
|
||||
private:
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// dummy Explorer
|
||||
moDummyExplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
120
mo/src/algo/moFirstImprHC.h
Normal file
120
mo/src/algo/moFirstImprHC.h
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
<moFirstImprHC.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can 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 _moFirstImprHC_h
|
||||
#define _moFirstImprHC_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moFirstImprHCexplorer.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <eval/moEval.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* First improvement HC:
|
||||
* Hill-Climbing local search
|
||||
*
|
||||
* At each iteration,
|
||||
* one of the random solution in the neighborhood is selected
|
||||
* if the selected neighbor have higher fitness than the current solution
|
||||
* then the solution is replaced by the selected neighbor
|
||||
* the algorithm stops when there is no higher neighbor
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moFirstImprHC: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
/**
|
||||
* Basic constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
*/
|
||||
moFirstImprHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moFirstImprHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _cont an external continuator
|
||||
* @param _compN a neighbor vs neighbor comparator
|
||||
* @param _compSN a solution vs neighbor comparator
|
||||
*/
|
||||
moFirstImprHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, moContinuator<Neighbor>& _cont, moNeighborComparator<Neighbor>& _compN, moSolNeighborComparator<Neighbor>& _compSN):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, _compN, _compSN)
|
||||
{}
|
||||
|
||||
/**
|
||||
* to never stop the hill climbing
|
||||
*
|
||||
*/
|
||||
virtual void alwaysContinue() {
|
||||
explorer.alwaysContinue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the class id.
|
||||
* @return the class name as a std::string
|
||||
*/
|
||||
virtual std::string className() const {
|
||||
return "moFirstImprHV";
|
||||
}
|
||||
|
||||
private:
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// compare the fitness values of neighbors: true if strictly greater
|
||||
moNeighborComparator<Neighbor> defaultNeighborComp;
|
||||
// compare the fitness values of the solution and the neighbor: true if strictly greater
|
||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||
// the explorer of the first improvement HC
|
||||
moFirstImprHCexplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
118
mo/src/algo/moILS.h
Normal file
118
mo/src/algo/moILS.h
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
<moILS.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 _moILS_h
|
||||
#define _moILS_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moILSexplorer.h>
|
||||
#include <continuator/moIterContinuator.h>
|
||||
#include <eoOp.h>
|
||||
#include <neighborhood/moDummyNeighbor.h>
|
||||
#include <perturb/moMonOpPerturb.h>
|
||||
#include <perturb/moPerturbation.h>
|
||||
#include <acceptCrit/moAlwaysAcceptCrit.h>
|
||||
#include <eval/moEval.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
|
||||
/**
|
||||
* Iterated Local Search
|
||||
*/
|
||||
template<class Neighbor, class NeighborLO = moDummyNeighbor<typename Neighbor::EOT> >
|
||||
class moILS: public moLocalSearch< NeighborLO >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
|
||||
/**
|
||||
* Basic constructor for Iterated Local Search
|
||||
* @param _ls the local search to iterates
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _op the operator used to perturb solution
|
||||
* @param _nbIteration the time limit for search
|
||||
*/
|
||||
moILS(moLocalSearch<Neighbor>& _ls, eoEvalFunc<EOT>& _fullEval, eoMonOp<EOT>& _op, unsigned int _nbIteration):
|
||||
moLocalSearch< moDummyNeighbor<EOT> >(explorer, iterCont, _fullEval),
|
||||
iterCont(_nbIteration),
|
||||
defaultPerturb(_op, _fullEval),
|
||||
explorer(_ls, defaultPerturb, defaultAccept)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor for Iterated Local Search
|
||||
* @param _ls the local search to iterates
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _op the operator used to perturb solution
|
||||
* @param _cont a continuator
|
||||
*/
|
||||
moILS(moLocalSearch<Neighbor>& _ls, eoEvalFunc<EOT>& _fullEval, eoMonOp<EOT>& _op, moContinuator<NeighborLO>& _cont):
|
||||
moLocalSearch< NeighborLO >(explorer, _cont, _fullEval),
|
||||
iterCont(0),
|
||||
defaultPerturb(_op, _fullEval),
|
||||
explorer(_ls, defaultPerturb, defaultAccept)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for Iterated Local Search
|
||||
* @param _ls the local search to iterates
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _cont a continuator
|
||||
* @param _perturb a perturbation operator
|
||||
* @param _accept a acceptance criteria
|
||||
*/
|
||||
// moILS(moLocalSearch<Neighbor>& _ls, eoEvalFunc<EOT>& _fullEval, moContinuator<moDummyNeighbor<EOT> >& _cont, moMonOpPerturb<Neighbor>& _perturb, moAcceptanceCriterion<Neighbor>& _accept):
|
||||
// moILS(moLocalSearch<Neighbor>& _ls, eoEvalFunc<EOT>& _fullEval, moContinuator<NeighborLO>& _cont, moPerturbation<Neighbor>& _perturb):
|
||||
moILS(moLocalSearch<Neighbor>& _ls, eoEvalFunc<EOT>& _fullEval, moContinuator<NeighborLO>& _cont, moPerturbation<Neighbor>& _perturb, moAcceptanceCriterion<Neighbor>& _accept):
|
||||
moLocalSearch<NeighborLO>(explorer, _cont, _fullEval),
|
||||
iterCont(0),
|
||||
defaultPerturb(dummyOp, _fullEval),
|
||||
explorer(_ls, _perturb, _accept)
|
||||
{}
|
||||
|
||||
private:
|
||||
|
||||
class dummmyMonOp: public eoMonOp<EOT> {
|
||||
public:
|
||||
bool operator()(EOT&) {
|
||||
return false;
|
||||
}
|
||||
} dummyOp;
|
||||
|
||||
moIterContinuator<moDummyNeighbor<EOT> > iterCont;
|
||||
moMonOpPerturb<Neighbor> defaultPerturb;
|
||||
moAlwaysAcceptCrit<Neighbor> defaultAccept;
|
||||
moILSexplorer< Neighbor , NeighborLO > explorer; // inherits from moNeighborhoodExplorer< NeighborLO >
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
146
mo/src/algo/moLocalSearch.h
Normal file
146
mo/src/algo/moLocalSearch.h
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
/*
|
||||
<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 <neighborhood/moNeighborhood.h>
|
||||
#include <eoEvalFunc.h>
|
||||
#include <eoOp.h>
|
||||
|
||||
/**
|
||||
* the main algorithm of the local search
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moLocalSearch: public eoMonOp<typename Neighbor::EOT> {
|
||||
public:
|
||||
typedef moNeighborhood<Neighbor> Neighborhood;
|
||||
typedef moNeighborhoodExplorer<Neighbor> NeighborhoodExplorer;
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
|
||||
/**
|
||||
* Constructor of a moLocalSearch
|
||||
* @param _searchExpl a neighborhood explorer
|
||||
* @param _cont an external continuator (can be a checkpoint!)
|
||||
* @param _fullEval a full evaluation function
|
||||
*/
|
||||
moLocalSearch(NeighborhoodExplorer& _searchExpl,
|
||||
moContinuator<Neighbor> & _cont, eoEvalFunc<EOT>& _fullEval) :
|
||||
searchExplorer(_searchExpl), cont(&_cont), 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)
|
||||
cont->init(_solution);
|
||||
|
||||
bool b;
|
||||
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 = (*cont)(_solution);
|
||||
} while (b && searchExplorer.isContinue(_solution));
|
||||
|
||||
searchExplorer.terminate(_solution);
|
||||
|
||||
cont->lastCall(_solution);
|
||||
|
||||
return true;
|
||||
}
|
||||
;
|
||||
|
||||
/**
|
||||
* Set an external continuator
|
||||
* @param _cont the external continuator
|
||||
*/
|
||||
void setContinuator(moContinuator<Neighbor> & _cont) {
|
||||
cont = &_cont;
|
||||
}
|
||||
|
||||
/**
|
||||
* external continuator object
|
||||
*
|
||||
* @overload
|
||||
* @return the external continuator
|
||||
*/
|
||||
moContinuator<Neighbor>* getContinuator() const {
|
||||
return cont;
|
||||
}
|
||||
|
||||
/**
|
||||
* to get the neighborhood explorer
|
||||
*
|
||||
* @overload
|
||||
* @return the neighborhood explorer
|
||||
*/
|
||||
moNeighborhoodExplorer<Neighbor> & getNeighborhoodExplorer() const {
|
||||
return searchExplorer;
|
||||
}
|
||||
|
||||
protected:
|
||||
// make the exploration of the neighborhood according to a local search heuristic
|
||||
moNeighborhoodExplorer<Neighbor>& searchExplorer;
|
||||
|
||||
// external continuator
|
||||
moContinuator<Neighbor> * cont;
|
||||
|
||||
//full evaluation function
|
||||
eoEvalFunc<EOT>& fullEval;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
110
mo/src/algo/moMetropolisHasting.h
Normal file
110
mo/src/algo/moMetropolisHasting.h
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
<moMetropolisHasting.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can 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 _moMetropolisHasting_h
|
||||
#define _moMetropolisHasting_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moMetropolisHastingExplorer.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <eval/moEval.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* Metropolis-Hasting local search
|
||||
* Only the symetric case is considered when Q(x,y) = Q(y,x)
|
||||
* Fitness must be > 0
|
||||
*
|
||||
* At each iteration,
|
||||
* one of the random solution in the neighborhood is selected
|
||||
* if the selected neighbor have higher or equal fitness than the current solution
|
||||
* then the solution is replaced by the selected neighbor
|
||||
* if a random number from [0,1] is lower than fitness(neighbor) / fitness(solution)
|
||||
* then the solution is replaced by the selected neighbor
|
||||
* the algorithm stops when the number of iterations is too large
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moMetropolisHasting: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
/**
|
||||
* Basic constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor of the Metropolis-Hasting
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
* @param _cont an external continuator
|
||||
* @param _compN a neighbor vs neighbor comparator
|
||||
* @param _compSN a solution vs neighbor comparator
|
||||
*/
|
||||
moMetropolisHasting(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep, moContinuator<Neighbor>& _cont, moNeighborComparator<Neighbor>& _compN, moSolNeighborComparator<Neighbor>& _compSN):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, _compN, _compSN, _nbStep)
|
||||
{}
|
||||
|
||||
private:
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// compare the fitness values of neighbors
|
||||
moNeighborComparator<Neighbor> defaultNeighborComp;
|
||||
// compare the fitness values of the solution and the neighbor
|
||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||
// MetropolisHasting explorer
|
||||
moMetropolisHastingExplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
106
mo/src/algo/moNeutralHC.h
Normal file
106
mo/src/algo/moNeutralHC.h
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
<moNeutralHC.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can 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 _moNeutralHC_h
|
||||
#define _moNeutralHC_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moNeutralHCexplorer.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <eval/moEval.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* Hill-Climbing local search
|
||||
*
|
||||
* At each iteration,
|
||||
* one of the random best solution in the neighborhood is selected
|
||||
* if the selected neighbor have higher or equal fitness than the current solution
|
||||
* then the solution is replaced by the selected neighbor
|
||||
* the algorithm stops when there is no higher or equal neighbor, or if the number of iterations is too large
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moNeutralHC: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
/**
|
||||
* Basic constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
*/
|
||||
moNeutralHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moNeutralHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp, _nbStep)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStep maximum step to do
|
||||
* @param _cont an external continuator
|
||||
* @param _compN a neighbor vs neighbor comparator
|
||||
* @param _compSN a solution vs neighbor comparator
|
||||
*/
|
||||
moNeutralHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned int _nbStep, moContinuator<Neighbor>& _cont, moNeighborComparator<Neighbor>& _compN, moSolNeighborComparator<Neighbor>& _compSN):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, _compN, _compSN, _nbStep)
|
||||
{}
|
||||
|
||||
private:
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// compare the fitness values of neighbors
|
||||
moNeighborComparator<Neighbor> defaultNeighborComp;
|
||||
// compare the fitness values of the solution and the neighbor
|
||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||
// the explorer of the HC with neutral move (equals fitness move)
|
||||
moNeutralHCexplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
104
mo/src/algo/moRandomBestHC.h
Normal file
104
mo/src/algo/moRandomBestHC.h
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
<moRandomBestHC.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can 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 _moRandomBestHC_h
|
||||
#define _moRandomBestHC_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moRandomBestHCexplorer.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <eval/moEval.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* Random Best HC:
|
||||
* Hill-Climbing local search
|
||||
*
|
||||
* At each iteration,
|
||||
* one of the random best solution in the neighborhood is selected
|
||||
* if the selected neighbor have higher fitness than the current solution
|
||||
* then the solution is replaced by the selected neighbor
|
||||
* the algorithm stops when there is no higher neighbor
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moRandomBestHC: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
/**
|
||||
* Basic constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
*/
|
||||
moRandomBestHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moRandomBestHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultNeighborComp, defaultSolNeighborComp)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for a hill-climber
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _cont an external continuator
|
||||
* @param _compN a neighbor vs neighbor comparator
|
||||
* @param _compSN a solution vs neighbor comparator
|
||||
*/
|
||||
moRandomBestHC(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, moContinuator<Neighbor>& _cont, moNeighborComparator<Neighbor>& _compN, moSolNeighborComparator<Neighbor>& _compSN):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, _compN, _compSN)
|
||||
{}
|
||||
|
||||
private:
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// compare the fitness values of neighbors
|
||||
moNeighborComparator<Neighbor> defaultNeighborComp;
|
||||
// compare the fitness values of the solution and the neighbor
|
||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||
// the explorer of the HC with random choice of the best solution
|
||||
moRandomBestHCexplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
102
mo/src/algo/moRandomNeutralWalk.h
Normal file
102
mo/src/algo/moRandomNeutralWalk.h
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
<moRandomNeutralWalk.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can 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 _moRandomNeutralWalk_h
|
||||
#define _moRandomNeutralWalk_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moRandomNeutralWalkExplorer.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <eval/moEval.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* Random Neutral Walk:
|
||||
* Random Neutral walk local search
|
||||
*
|
||||
* At each iteration,
|
||||
* one random neighbor with the same fitness is selected and replace the current solution
|
||||
* the algorithm stops when the number of steps is reached
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moRandomNeutralWalk: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
/**
|
||||
* Basic constructor for a random walk
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStepMax number of step of the walk
|
||||
*/
|
||||
moRandomNeutralWalk(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned _nbStepMax):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultSolNeighborComp, _nbStepMax)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor for a random walk
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStepMax number of step of the walk
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moRandomNeutralWalk(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned _nbStepMax, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, defaultSolNeighborComp, _nbStepMax)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for a random walk
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStepMax number of step of the walk
|
||||
* @param _cont an external continuator
|
||||
* @param _comp a solution vs neighbor comparator
|
||||
*/
|
||||
moRandomNeutralWalk(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned _nbStepMax, moContinuator<Neighbor>& _cont, moSolNeighborComparator<Neighbor>& _comp):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_neighborhood, _eval, _comp, _nbStepMax)
|
||||
{}
|
||||
|
||||
private:
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// the explorer of the random walk
|
||||
moRandomNeutralWalkExplorer<Neighbor> explorer;
|
||||
// compare the fitness values of the solution and the neighbor
|
||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||
};
|
||||
|
||||
#endif
|
||||
90
mo/src/algo/moRandomSearch.h
Normal file
90
mo/src/algo/moRandomSearch.h
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
<moRandomSearch.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can 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 _moRandomSearch_h
|
||||
#define _moRandomSearch_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moRandomSearchExplorer.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <eoInit.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* Random Search:
|
||||
* Pure random search local search
|
||||
*
|
||||
* At each iteration,
|
||||
* one random solution is selected and replace the current solution
|
||||
* the algorithm stops when the number of solution is reached
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moRandomSearch: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
|
||||
/**
|
||||
* Simple constructor for a random search
|
||||
* @param _init the solution initializer, to explore at random the search space
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _nbSolMax number of solutions
|
||||
*/
|
||||
moRandomSearch(eoInit<EOT> & _init, eoEvalFunc<EOT>& _fullEval, unsigned _nbSolMax):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
explorer(_init, _fullEval, _nbSolMax>0?_nbSolMax - 1:0)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for a random search
|
||||
* @param _init the solution initializer, to explore at random the search space
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _nbSolMax number of solutions
|
||||
* @param _cont external continuator
|
||||
*/
|
||||
moRandomSearch(eoInit<EOT> & _init, eoEvalFunc<EOT>& _fullEval, unsigned _nbSolMax, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
explorer(_init, _fullEval, _nbSolMax>0?_nbSolMax - 1:0)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @return name of the class
|
||||
*/
|
||||
virtual std::string className(void) const {
|
||||
return "moRandomSearch";
|
||||
}
|
||||
|
||||
private:
|
||||
// always true continuator
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
// the explorer of the random walk
|
||||
moRandomSearchExplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
87
mo/src/algo/moRandomWalk.h
Normal file
87
mo/src/algo/moRandomWalk.h
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
<moRandomWalk.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can 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 _moRandomWalk_h
|
||||
#define _moRandomWalk_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moRandomWalkExplorer.h>
|
||||
#include <continuator/moIterContinuator.h>
|
||||
#include <eval/moEval.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* Random Walk:
|
||||
* Random walk local search
|
||||
*
|
||||
* At each iteration,
|
||||
* one random neighbor is selected and replace the current solution
|
||||
* the algorithm stops when the number of steps is reached
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moRandomWalk: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
/**
|
||||
* Simple constructor for a random walk
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _nbStepMax number of step of the walk
|
||||
*/
|
||||
moRandomWalk(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, unsigned _nbStepMax):
|
||||
moLocalSearch<Neighbor>(explorer, iterCont, _fullEval),
|
||||
iterCont(_nbStepMax),
|
||||
explorer(_neighborhood, _eval)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for a random walk
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _cont a user-defined continuator
|
||||
*/
|
||||
moRandomWalk(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
iterCont(0),
|
||||
explorer(_neighborhood, _eval)
|
||||
{}
|
||||
|
||||
private:
|
||||
// the continuator to stop on a maximum number of step
|
||||
moIterContinuator<Neighbor> iterCont;
|
||||
// the explorer of the random walk
|
||||
moRandomWalkExplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
120
mo/src/algo/moSA.h
Normal file
120
mo/src/algo/moSA.h
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
<moSA.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 _moSA_h
|
||||
#define _moSA_h
|
||||
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moSAexplorer.h>
|
||||
#include <coolingSchedule/moCoolingSchedule.h>
|
||||
#include <coolingSchedule/moSimpleCoolingSchedule.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <eval/moEval.h>
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
/**
|
||||
* Simulated Annealing
|
||||
*/
|
||||
template<class Neighbor>
|
||||
class moSA: public moLocalSearch<Neighbor>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
|
||||
/**
|
||||
* Basic constructor for a simulated annealing
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _initT initial temperature for cooling schedule (default = 10)
|
||||
* @param _alpha factor of decreasing for cooling schedule (default = 0.9)
|
||||
* @param _span number of iteration with equal temperature for cooling schedule (default = 100)
|
||||
* @param _finalT final temperature, threshold of the stopping criteria for cooling schedule (default = 0.01)
|
||||
*/
|
||||
moSA(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, double _initT=10, double _alpha=0.9, unsigned _span=100, double _finalT=0.01):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
defaultCool(_initT, _alpha, _span, _finalT),
|
||||
explorer(_neighborhood, _eval, defaultSolNeighborComp, defaultCool)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Simple constructor for a simulated annealing
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _cool a cooling schedule
|
||||
*/
|
||||
moSA(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, moCoolingSchedule<EOT>& _cool):
|
||||
moLocalSearch<Neighbor>(explorer, trueCont, _fullEval),
|
||||
defaultCool(0, 0, 0, 0),
|
||||
explorer(_neighborhood, _eval, defaultSolNeighborComp, _cool)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for a simulated annealing
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _cool a cooling schedule
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moSA(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, moCoolingSchedule<EOT>& _cool, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
defaultCool(0, 0, 0, 0),
|
||||
explorer(_neighborhood, _eval, defaultSolNeighborComp, _cool)
|
||||
{}
|
||||
|
||||
/**
|
||||
* General constructor for a simulated annealing
|
||||
* @param _neighborhood the neighborhood
|
||||
* @param _fullEval the full evaluation function
|
||||
* @param _eval neighbor's evaluation function
|
||||
* @param _cool a cooling schedule
|
||||
* @param _comp a solution vs neighbor comparator
|
||||
* @param _cont an external continuator
|
||||
*/
|
||||
moSA(Neighborhood& _neighborhood, eoEvalFunc<EOT>& _fullEval, moEval<Neighbor>& _eval, moCoolingSchedule<EOT>& _cool, moSolNeighborComparator<Neighbor>& _comp, moContinuator<Neighbor>& _cont):
|
||||
moLocalSearch<Neighbor>(explorer, _cont, _fullEval),
|
||||
defaultCool(0, 0, 0, 0),
|
||||
explorer(_neighborhood, _eval, _comp, _cool)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
moTrueContinuator<Neighbor> trueCont;
|
||||
moSimpleCoolingSchedule<EOT> defaultCool;
|
||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||
moSAexplorer<Neighbor> explorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue