update
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2697 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
8c1be9c10c
commit
56db6b7608
169 changed files with 18720 additions and 0 deletions
46
tags/ParadisEO-GPU-1.1/paradiseo-mo/CMakeLists.txt
Normal file
46
tags/ParadisEO-GPU-1.1/paradiseo-mo/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
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})
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${MO_SRC_DIR}/CTestCustom.cmake
|
||||
${MO_BIN_DIR}/CTestCustom.cmake)
|
||||
##########################################################################################################################################
|
||||
|
||||
7
tags/ParadisEO-GPU-1.1/paradiseo-mo/CTestConfig.cmake
Normal file
7
tags/ParadisEO-GPU-1.1/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)
|
||||
7
tags/ParadisEO-GPU-1.1/paradiseo-mo/CTestCustom.cmake
Normal file
7
tags/ParadisEO-GPU-1.1/paradiseo-mo/CTestCustom.cmake
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
||||
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
||||
"test/"
|
||||
"paradiseo-eo/"
|
||||
"problems/"
|
||||
"tutorial/"
|
||||
)
|
||||
26
tags/ParadisEO-GPU-1.1/paradiseo-mo/doc/CMakeLists.txt
Executable file
26
tags/ParadisEO-GPU-1.1/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)
|
||||
|
||||
##########################################################################################
|
||||
52
tags/ParadisEO-GPU-1.1/paradiseo-mo/doc/index.h
Normal file
52
tags/ParadisEO-GPU-1.1/paradiseo-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
tags/ParadisEO-GPU-1.1/paradiseo-mo/doc/mo.doxyfile.cmake
Normal file
1523
tags/ParadisEO-GPU-1.1/paradiseo-mo/doc/mo.doxyfile.cmake
Normal file
File diff suppressed because it is too large
Load diff
130
tags/ParadisEO-GPU-1.1/paradiseo-mo/install.cmake
Normal file
130
tags/ParadisEO-GPU-1.1/paradiseo-mo/install.cmake
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
######################################################################################
|
||||
### CMake basic configuration
|
||||
######################################################################################
|
||||
|
||||
# check cmake version compatibility
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
# regular expression checking
|
||||
INCLUDE_REGULAR_EXPRESSION("^.*$" "^$")
|
||||
|
||||
# set a language for the entire project.
|
||||
ENABLE_LANGUAGE(CXX)
|
||||
ENABLE_LANGUAGE(C)
|
||||
|
||||
####################################################################################
|
||||
|
||||
|
||||
#####################################################################################
|
||||
### Include required modules & utilities
|
||||
#####################################################################################
|
||||
INCLUDE(CMakeBackwardCompatibilityCXX)
|
||||
|
||||
INCLUDE(FindDoxygen)
|
||||
|
||||
INCLUDE(FindGnuplot)
|
||||
|
||||
INCLUDE(CheckLibraryExists)
|
||||
|
||||
INCLUDE(Dart OPTIONAL)
|
||||
|
||||
INCLUDE(CPack)
|
||||
|
||||
# Set a special flag if the environment is windows (should do the same in a config.g file)
|
||||
IF (WIN32)
|
||||
ADD_DEFINITIONS(-D_WINDOWS=1)
|
||||
ENDIF (WIN32)
|
||||
######################################################################################
|
||||
|
||||
|
||||
#####################################################################################
|
||||
### Manage the build type
|
||||
#####################################################################################
|
||||
|
||||
# the user should choose the build type on windows environments,excepted under cygwin (default=none)
|
||||
SET(CMAKE_DEFAULT_BUILD_TYPE "Release" CACHE STRING "Variable that stores the default CMake build type" FORCE)
|
||||
|
||||
FIND_PROGRAM(MEMORYCHECK_COMMAND
|
||||
NAMES purify valgrind
|
||||
PATHS
|
||||
"/usr/local/bin /usr/bin [HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
|
||||
DOC "Path to the memory checking command, used for memory error detection.")
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
SET( CMAKE_BUILD_TYPE
|
||||
${CMAKE_DEFAULT_BUILD_TYPE} CACHE STRING
|
||||
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
|
||||
FORCE)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
IF(WIN32 AND NOT CYGWIN)
|
||||
IF(CMAKE_CXX_COMPILER MATCHES cl)
|
||||
IF(NOT WITH_SHARED_LIBS)
|
||||
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008" OR CMAKE_GENERATOR STREQUAL "Visual Studio 10")
|
||||
SET(CMAKE_CXX_FLAGS "/nologo /Gy")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "/W3 /MTd /Z7 /Od")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "/w /MT /O2 /wd4530")
|
||||
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE")
|
||||
ENDIF(CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" OR CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008" OR CMAKE_GENERATOR STREQUAL "Visual Studio 10")
|
||||
ENDIF(NOT WITH_SHARED_LIBS)
|
||||
ENDIF(CMAKE_CXX_COMPILER MATCHES cl)
|
||||
ELSE(WIN32 AND NOT CYGWIN)
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -fprofile-arcs -ftest-coverage -Wall -Wextra -Wno-unused-parameter -Wno-ignored-qualifiers")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
||||
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -O6")
|
||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ENDIF(WIN32 AND NOT CYGWIN)
|
||||
|
||||
IF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
ADD_DEFINITIONS(-DCMAKE_VERBOSE_MAKEFILE=ON)
|
||||
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
|
||||
#####################################################################################
|
||||
|
||||
######################################################################################
|
||||
### compilation of examples?
|
||||
######################################################################################
|
||||
|
||||
SET(ENABLE_CMAKE_EXAMPLE TRUE CACHE BOOL "Enable copy of benchs and parameters file?")
|
||||
|
||||
######################################################################################
|
||||
### Test config
|
||||
######################################################################################
|
||||
|
||||
IF (ENABLE_CMAKE_TESTING OR ENABLE_MINIMAL_CMAKE_TESTING)
|
||||
ENABLE_TESTING()
|
||||
ENDIF (ENABLE_CMAKE_TESTING OR ENABLE_MINIMAL_CMAKE_TESTING)
|
||||
######################################################################################
|
||||
|
||||
#######################################################################################
|
||||
### Paths to EO, MO and MOEO must be specified above.
|
||||
#######################################################################################
|
||||
|
||||
SET(EO_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-eo" CACHE PATH "ParadisEO-EO source directory" FORCE)
|
||||
SET(EO_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-eo/build" CACHE PATH "ParadisEO-EO binary directory" FORCE)
|
||||
|
||||
SET(MO_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-mo" CACHE PATH "ParadisMO-MO source directory" FORCE)
|
||||
SET(MO_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-mo/build" CACHE PATH "ParadisMO-MO binary directory" FORCE)
|
||||
|
||||
SET(OLDMO_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-old-mo" CACHE PATH "ParadisMO-MO source directory" FORCE)
|
||||
SET(OLDMO_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-old-mo/build" CACHE PATH "ParadisMO-MO binary directory" FORCE)
|
||||
|
||||
SET(MOEO_SRC_DIR "${CMAKE_SOURCE_DIR}/../paradiseo-moeo" CACHE PATH "ParadisMOEO-MOEO source directory" FORCE)
|
||||
SET(MOEO_BIN_DIR "${CMAKE_BINARY_DIR}/../../paradiseo-moeo/build" CACHE PATH "ParadisMOEO-MOEO binary directory" FORCE)
|
||||
|
||||
SET(PROBLEMS_SRC_DIR "${CMAKE_SOURCE_DIR}/../problems" CACHE PATH "Problems dependant source directory" FORCE)
|
||||
|
||||
######################################################################################
|
||||
######################################################################################
|
||||
### Subdirectories that CMake should process for MO, MOEO and PEO
|
||||
######################################################################################
|
||||
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ADD_SUBDIRECTORY(test)
|
||||
ADD_SUBDIRECTORY(tutorial)
|
||||
######################################################################################
|
||||
|
||||
3
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/CMakeLists.txt
Normal file
3
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
###############################################################
|
||||
# This is a dummy 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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/algo/eoDummyMonOp.h
Normal file
56
tags/ParadisEO-GPU-1.1/paradiseo-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
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/algo/moDummyLS.h
Normal file
71
tags/ParadisEO-GPU-1.1/paradiseo-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
|
||||
112
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/algo/moFirstImprHC.h
Normal file
112
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/algo/moFirstImprHC.h
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
/*
|
||||
<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)
|
||||
{}
|
||||
|
||||
/**
|
||||
* 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
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/algo/moILS.h
Normal file
118
tags/ParadisEO-GPU-1.1/paradiseo-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
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/algo/moLocalSearch.h
Normal file
146
tags/ParadisEO-GPU-1.1/paradiseo-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
|
||||
|
||||
|
|
@ -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
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/algo/moNeutralHC.h
Normal file
106
tags/ParadisEO-GPU-1.1/paradiseo-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
tags/ParadisEO-GPU-1.1/paradiseo-mo/src/algo/moRandomBestHC.h
Normal file
104
tags/ParadisEO-GPU-1.1/paradiseo-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
|
||||
|
|
@ -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
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue