Add problems directory and rename SimpleHCneutralExplorer in RamdomBestHCExplorer
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1735 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
67a701f9ff
commit
4819120e6c
21 changed files with 43 additions and 44 deletions
|
|
@ -35,7 +35,7 @@
|
|||
#ifndef _moHCneutralExplorer_h
|
||||
#define _moHCneutralExplorer_h
|
||||
|
||||
#include <explorer/moSimpleHCneutralExplorer.h>
|
||||
#include <explorer/moRandomBestHCExplorer.h>
|
||||
#include <comparator/moNeighborComparator.h>
|
||||
#include <comparator/moSolNeighborComparator.h>
|
||||
#include <neighborhood/moNeighborhood.h>
|
||||
|
|
@ -44,18 +44,18 @@
|
|||
* Explorer for a neutral Hill-climbing
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moHCneutralExplorer : public moSimpleHCneutralExplorer<Neighbor>
|
||||
class moHCneutralExplorer : public moRandomBestHCExplorer<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT ;
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
|
||||
using moNeighborhoodExplorer<Neighbor>::neighborhood;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::solNeighborComparator;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::isAccept;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::bestVector;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::initParam;
|
||||
using moSimpleHCneutralExplorer<Neighbor>::updateParam;
|
||||
using moRandomBestHCExplorer<Neighbor>::solNeighborComparator;
|
||||
using moRandomBestHCExplorer<Neighbor>::isAccept;
|
||||
using moRandomBestHCExplorer<Neighbor>::bestVector;
|
||||
using moRandomBestHCExplorer<Neighbor>::initParam;
|
||||
using moRandomBestHCExplorer<Neighbor>::updateParam;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
@ -70,7 +70,7 @@ public:
|
|||
moNeighborComparator<Neighbor>& _neighborComparator,
|
||||
moSolNeighborComparator<Neighbor>& _solNeighborComparator,
|
||||
unsigned _nbStep) :
|
||||
moSimpleHCneutralExplorer<Neighbor>(_neighborhood, _eval, _neighborComparator, _solNeighborComparator),
|
||||
moRandomBestHCExplorer<Neighbor>(_neighborhood, _eval, _neighborComparator, _solNeighborComparator),
|
||||
nbStep(_nbStep) {
|
||||
//Some cycle is possible with equals fitness solutions if the neighborhood is not random
|
||||
if (!neighborhood.isRandom()) {
|
||||
|
|
@ -88,7 +88,7 @@ public:
|
|||
* initial number of step
|
||||
*/
|
||||
virtual void initParam(EOT & solution) {
|
||||
moSimpleHCneutralExplorer<Neighbor>::initParam(solution);
|
||||
moRandomBestHCExplorer<Neighbor>::initParam(solution);
|
||||
|
||||
step = 0;
|
||||
};
|
||||
|
|
@ -97,7 +97,7 @@ public:
|
|||
* one more step
|
||||
*/
|
||||
virtual void updateParam(EOT & solution) {
|
||||
moSimpleHCneutralExplorer<Neighbor>::updateParam(solution);
|
||||
moRandomBestHCExplorer<Neighbor>::updateParam(solution);
|
||||
|
||||
step++;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,12 +48,12 @@
|
|||
* Explorer for an Iterated Local Search
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moILSexplorer : public moNeighborhoodExplorer< moDummyNeighbor<typename Neighbor::EOT, typename Neighbor::EOT::Fitness> >
|
||||
class moILSexplorer : public moNeighborhoodExplorer< moDummyNeighbor<typename Neighbor::EOT> >
|
||||
{
|
||||
public:
|
||||
typedef moNeighborhood<Neighbor> Neighborhood ;
|
||||
typedef typename Neighbor::EOT EOT;
|
||||
typedef moDummyNeighbor<EOT,typename EOT::Fitness> dummyNeighbor;
|
||||
typedef moDummyNeighbor<EOT> dummyNeighbor;
|
||||
typedef moDummyNeighborhood<dummyNeighbor> dummyNeighborhood;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
<moSimpleHCneutralExplorer.h>
|
||||
<moRandomBestHCExplorer.h>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
|
|
@ -32,8 +32,8 @@
|
|||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#ifndef _moSimpleHCneutralExplorer_h
|
||||
#define _moSimpleHCneutralExplorer_h
|
||||
#ifndef _moRandomBestHCExplorer_h
|
||||
#define _moRandomBestHCExplorer_h
|
||||
|
||||
#include <explorer/moNeighborhoodExplorer.h>
|
||||
#include <comparator/moNeighborComparator.h>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
* Explorer for a simple neutral Hill-climbing
|
||||
*/
|
||||
template< class Neighbor >
|
||||
class moSimpleHCneutralExplorer : public moNeighborhoodExplorer<Neighbor>
|
||||
class moRandomBestHCExplorer : public moNeighborhoodExplorer<Neighbor>
|
||||
{
|
||||
public:
|
||||
typedef typename Neighbor::EOT EOT ;
|
||||
|
|
@ -62,7 +62,7 @@ public:
|
|||
* @param _neighborComparator a neighbor comparator
|
||||
* @param _solNeighborComparator solution vs neighbor comparator
|
||||
*/
|
||||
moSimpleHCneutralExplorer(Neighborhood& _neighborhood,
|
||||
moRandomBestHCExplorer(Neighborhood& _neighborhood,
|
||||
moEval<Neighbor>& _eval,
|
||||
moNeighborComparator<Neighbor>& _neighborComparator,
|
||||
moSolNeighborComparator<Neighbor>& _solNeighborComparator) :
|
||||
|
|
@ -76,7 +76,7 @@ public:
|
|||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~moSimpleHCneutralExplorer() {
|
||||
~moRandomBestHCExplorer() {
|
||||
delete current;
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
#include <explorer/moRandomNeutralWalkExplorer.h>
|
||||
#include <explorer/moRandomWalkExplorer.h>
|
||||
#include <explorer/moSimpleHCexplorer.h>
|
||||
#include <explorer/moSimpleHCneutralExplorer.h>
|
||||
#include <explorer/moRandomBestHCExplorer.h>
|
||||
#include <explorer/moTSExplorer.h>
|
||||
#include <explorer/moILSexplorer.h>
|
||||
#include <explorer/moSAexplorer.h>
|
||||
|
|
@ -90,7 +90,6 @@
|
|||
#include <memory/moCountMoveMemory.h>
|
||||
|
||||
#include <neighborhood/moBackableNeighbor.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <neighborhood/moIndexNeighbor.h>
|
||||
#include <neighborhood/moIndexNeighborhood.h>
|
||||
#include <neighborhood/moNeighbor.h>
|
||||
|
|
@ -112,6 +111,8 @@
|
|||
#include <coolingSchedule/moCoolingSchedule.h>
|
||||
#include <coolingSchedule/moSimpleCoolingSchedule.h>
|
||||
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
|
||||
//#include <old/moMove.h>
|
||||
//#include <old/moMoveIncrEval.h>
|
||||
//#include <old/moMoveInit.h>
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
#include <ga/eoBit.h>
|
||||
#include <eoScalarFitness.h>
|
||||
#include <neighborhood/moOrderNeighborhood.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
#include <neighborhood/moIndexNeighbor.h>
|
||||
|
||||
#include <utils/eoMonitor.h>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
|||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
#include <continuator/moDistanceStat.h>
|
||||
#include <utils/eoDistance.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
*/
|
||||
|
||||
#include <continuator/moFitnessStat.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
#include <comparator/moNeighborComparator.h>
|
||||
#include <ga/eoBit.h>
|
||||
#include <eoScalarFitness.h>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <neighborhood/moOrderNeighborhood.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
#include <ga/eoBit.h>
|
||||
|
||||
#include <cstdlib>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
*/
|
||||
|
||||
#include <neighborhood/moRndWithReplNeighborhood.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
|
||||
#include "moTestClass.h"
|
||||
#include <iostream>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
*/
|
||||
|
||||
#include <neighborhood/moRndWithoutReplNeighborhood.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
|
||||
#include "moTestClass.h"
|
||||
#include <iostream>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
<t-moSimpleHCneutralExplorer.cpp>
|
||||
<t-moRandomBestHCExplorer.cpp>
|
||||
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
|
||||
|
||||
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
|
||||
|
|
@ -29,7 +29,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
|
||||
#include <comparator/moNeighborComparator.h>
|
||||
#include <comparator/moSolNeighborComparator.h>
|
||||
#include <explorer/moSimpleHCneutralExplorer.h>
|
||||
#include <explorer/moRandomBestHCExplorer.h>
|
||||
#include "moTestClass.h"
|
||||
|
||||
#include <iostream>
|
||||
|
|
@ -38,7 +38,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
|||
|
||||
int main() {
|
||||
|
||||
std::cout << "[t-moSimpleHCneutralExplorer] => START" << std::endl;
|
||||
std::cout << "[t-moRandomBestHCExplorer] => START" << std::endl;
|
||||
|
||||
//instanciation
|
||||
eoBit<eoMinimizingFitness> sol(4, true);
|
||||
|
|
@ -48,7 +48,7 @@ int main() {
|
|||
moNeighborComparator<bitNeighbor> ncomp;
|
||||
moSolNeighborComparator<bitNeighbor> sncomp;
|
||||
|
||||
moSimpleHCneutralExplorer<bitNeighbor> test(nh, eval, ncomp, sncomp);
|
||||
moRandomBestHCExplorer<bitNeighbor> test(nh, eval, ncomp, sncomp);
|
||||
|
||||
//test qu'on ameliore bien a chaque itération
|
||||
test.initParam(sol);
|
||||
|
|
@ -94,7 +94,7 @@ int main() {
|
|||
test.updateParam(sol);
|
||||
|
||||
|
||||
std::cout << "[t-moSimpleHCneutralExplorer] => OK" << std::endl;
|
||||
std::cout << "[t-moRandomBestHCExplorer] => OK" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
#include <eoScalarFitness.h>
|
||||
#include <comparator/moSolNeighborComparator.h>
|
||||
#include <ga/eoBit.h>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
#ADD_SUBDIRECTORY(oneMax)
|
||||
ADD_SUBDIRECTORY(oneMax)
|
||||
|
|
@ -7,7 +7,7 @@ LINK_DIRECTORIES(${EO_BIN_DIR}/lib)
|
|||
ADD_EXECUTABLE(testSimpleHC testSimpleHC.cpp)
|
||||
ADD_EXECUTABLE(testFirstImpr testFirstImpr.cpp)
|
||||
ADD_EXECUTABLE(testRandomWalk testRandomWalk.cpp)
|
||||
ADD_EXECUTABLE(testSimpleHCneutral testSimpleHCneutral.cpp)
|
||||
ADD_EXECUTABLE(testRandomBestHC testRandomBestHC.cpp)
|
||||
ADD_EXECUTABLE(testHCneutral testHCneutral.cpp)
|
||||
ADD_EXECUTABLE(testMetropolisHasting testMetropolisHasting.cpp)
|
||||
#ADD_EXECUTABLE(testWithMove testWithMove.cpp)
|
||||
|
|
@ -19,7 +19,7 @@ ADD_EXECUTABLE(testSimulatedAnnealing testSimulatedAnnealing.cpp)
|
|||
TARGET_LINK_LIBRARIES(testSimpleHC eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testFirstImpr eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testRandomWalk eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testSimpleHCneutral eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testRandomBestHC eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testHCneutral eoutils ga eo)
|
||||
TARGET_LINK_LIBRARIES(testMetropolisHasting eoutils ga eo)
|
||||
#TARGET_LINK_LIBRARIES(testWithMove eoutils ga eo)
|
||||
|
|
|
|||
|
|
@ -194,9 +194,9 @@ void main_function(int argc, char **argv)
|
|||
|
||||
moILSexplorer< Neighbor > explorerILS(hc, perturb, accept);
|
||||
|
||||
moIterContinuator<moDummyNeighbor<Indi, Indi::Fitness> > continuatorILS(100);
|
||||
moIterContinuator<moDummyNeighbor<Indi> > continuatorILS(100);
|
||||
|
||||
moLocalSearch<moDummyNeighbor<Indi, Indi::Fitness> >localSearch(explorerILS, continuatorILS, eval);
|
||||
moLocalSearch<moDummyNeighbor<Indi> >localSearch(explorerILS, continuatorILS, eval);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
/** testSimpleHCneutral.cpp
|
||||
/** testRandomBestHC.cpp
|
||||
*
|
||||
* SV - 24/01/10
|
||||
*
|
||||
|
|
@ -34,7 +34,7 @@ using namespace std;
|
|||
#include <comparator/moSolNeighborComparator.h>
|
||||
#include <continuator/moTrueContinuator.h>
|
||||
#include <algo/moLocalSearch.h>
|
||||
#include <explorer/moSimpleHCneutralExplorer.h>
|
||||
#include <explorer/moRandomBestHCExplorer.h>
|
||||
|
||||
// REPRESENTATION
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -149,7 +149,7 @@ void main_function(int argc, char **argv)
|
|||
*
|
||||
* ========================================================= */
|
||||
|
||||
moSimpleHCneutralExplorer<Neighbor> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
moRandomBestHCExplorer<Neighbor> explorer(neighborhood, fulleval, comparator, solComparator);
|
||||
|
||||
|
||||
/* =========================================================
|
||||
|
|
@ -26,7 +26,7 @@ using namespace std;
|
|||
#include <funcRoyalRoad.h>
|
||||
#include <eoInt.h>
|
||||
#include <neighborhood/moRndWithoutReplNeighborhood.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
|
||||
#include <eval/moFullEvalByModif.h>
|
||||
#include <eval/moFullEvalByCopy.h>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _oneMaxBitNeighbor_h
|
||||
#define _oneMaxBitNeighbor_h
|
||||
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
#include <problems/bitString/moBitNeighbor.h>
|
||||
#include <ga.h>
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue