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:
jhumeau 2010-04-08 14:48:26 +00:00
commit 4819120e6c
21 changed files with 43 additions and 44 deletions

View file

@ -35,7 +35,7 @@
#ifndef _moHCneutralExplorer_h #ifndef _moHCneutralExplorer_h
#define _moHCneutralExplorer_h #define _moHCneutralExplorer_h
#include <explorer/moSimpleHCneutralExplorer.h> #include <explorer/moRandomBestHCExplorer.h>
#include <comparator/moNeighborComparator.h> #include <comparator/moNeighborComparator.h>
#include <comparator/moSolNeighborComparator.h> #include <comparator/moSolNeighborComparator.h>
#include <neighborhood/moNeighborhood.h> #include <neighborhood/moNeighborhood.h>
@ -44,18 +44,18 @@
* Explorer for a neutral Hill-climbing * Explorer for a neutral Hill-climbing
*/ */
template< class Neighbor > template< class Neighbor >
class moHCneutralExplorer : public moSimpleHCneutralExplorer<Neighbor> class moHCneutralExplorer : public moRandomBestHCExplorer<Neighbor>
{ {
public: public:
typedef typename Neighbor::EOT EOT ; typedef typename Neighbor::EOT EOT ;
typedef moNeighborhood<Neighbor> Neighborhood ; typedef moNeighborhood<Neighbor> Neighborhood ;
using moNeighborhoodExplorer<Neighbor>::neighborhood; using moNeighborhoodExplorer<Neighbor>::neighborhood;
using moSimpleHCneutralExplorer<Neighbor>::solNeighborComparator; using moRandomBestHCExplorer<Neighbor>::solNeighborComparator;
using moSimpleHCneutralExplorer<Neighbor>::isAccept; using moRandomBestHCExplorer<Neighbor>::isAccept;
using moSimpleHCneutralExplorer<Neighbor>::bestVector; using moRandomBestHCExplorer<Neighbor>::bestVector;
using moSimpleHCneutralExplorer<Neighbor>::initParam; using moRandomBestHCExplorer<Neighbor>::initParam;
using moSimpleHCneutralExplorer<Neighbor>::updateParam; using moRandomBestHCExplorer<Neighbor>::updateParam;
/** /**
* Constructor * Constructor
@ -70,7 +70,7 @@ public:
moNeighborComparator<Neighbor>& _neighborComparator, moNeighborComparator<Neighbor>& _neighborComparator,
moSolNeighborComparator<Neighbor>& _solNeighborComparator, moSolNeighborComparator<Neighbor>& _solNeighborComparator,
unsigned _nbStep) : unsigned _nbStep) :
moSimpleHCneutralExplorer<Neighbor>(_neighborhood, _eval, _neighborComparator, _solNeighborComparator), moRandomBestHCExplorer<Neighbor>(_neighborhood, _eval, _neighborComparator, _solNeighborComparator),
nbStep(_nbStep) { nbStep(_nbStep) {
//Some cycle is possible with equals fitness solutions if the neighborhood is not random //Some cycle is possible with equals fitness solutions if the neighborhood is not random
if (!neighborhood.isRandom()) { if (!neighborhood.isRandom()) {
@ -88,7 +88,7 @@ public:
* initial number of step * initial number of step
*/ */
virtual void initParam(EOT & solution) { virtual void initParam(EOT & solution) {
moSimpleHCneutralExplorer<Neighbor>::initParam(solution); moRandomBestHCExplorer<Neighbor>::initParam(solution);
step = 0; step = 0;
}; };
@ -97,7 +97,7 @@ public:
* one more step * one more step
*/ */
virtual void updateParam(EOT & solution) { virtual void updateParam(EOT & solution) {
moSimpleHCneutralExplorer<Neighbor>::updateParam(solution); moRandomBestHCExplorer<Neighbor>::updateParam(solution);
step++; step++;
}; };

View file

@ -48,12 +48,12 @@
* Explorer for an Iterated Local Search * Explorer for an Iterated Local Search
*/ */
template< class Neighbor > template< class Neighbor >
class moILSexplorer : public moNeighborhoodExplorer< moDummyNeighbor<typename Neighbor::EOT, typename Neighbor::EOT::Fitness> > class moILSexplorer : public moNeighborhoodExplorer< moDummyNeighbor<typename Neighbor::EOT> >
{ {
public: public:
typedef moNeighborhood<Neighbor> Neighborhood ; typedef moNeighborhood<Neighbor> Neighborhood ;
typedef typename Neighbor::EOT EOT; typedef typename Neighbor::EOT EOT;
typedef moDummyNeighbor<EOT,typename EOT::Fitness> dummyNeighbor; typedef moDummyNeighbor<EOT> dummyNeighbor;
typedef moDummyNeighborhood<dummyNeighbor> dummyNeighborhood; typedef moDummyNeighborhood<dummyNeighbor> dummyNeighborhood;
/** /**

View file

@ -1,5 +1,5 @@
/* /*
<moSimpleHCneutralExplorer.h> <moRandomBestHCExplorer.h>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau
@ -32,8 +32,8 @@
Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*/ */
#ifndef _moSimpleHCneutralExplorer_h #ifndef _moRandomBestHCExplorer_h
#define _moSimpleHCneutralExplorer_h #define _moRandomBestHCExplorer_h
#include <explorer/moNeighborhoodExplorer.h> #include <explorer/moNeighborhoodExplorer.h>
#include <comparator/moNeighborComparator.h> #include <comparator/moNeighborComparator.h>
@ -46,7 +46,7 @@
* Explorer for a simple neutral Hill-climbing * Explorer for a simple neutral Hill-climbing
*/ */
template< class Neighbor > template< class Neighbor >
class moSimpleHCneutralExplorer : public moNeighborhoodExplorer<Neighbor> class moRandomBestHCExplorer : public moNeighborhoodExplorer<Neighbor>
{ {
public: public:
typedef typename Neighbor::EOT EOT ; typedef typename Neighbor::EOT EOT ;
@ -62,7 +62,7 @@ public:
* @param _neighborComparator a neighbor comparator * @param _neighborComparator a neighbor comparator
* @param _solNeighborComparator solution vs neighbor comparator * @param _solNeighborComparator solution vs neighbor comparator
*/ */
moSimpleHCneutralExplorer(Neighborhood& _neighborhood, moRandomBestHCExplorer(Neighborhood& _neighborhood,
moEval<Neighbor>& _eval, moEval<Neighbor>& _eval,
moNeighborComparator<Neighbor>& _neighborComparator, moNeighborComparator<Neighbor>& _neighborComparator,
moSolNeighborComparator<Neighbor>& _solNeighborComparator) : moSolNeighborComparator<Neighbor>& _solNeighborComparator) :
@ -76,7 +76,7 @@ public:
/** /**
* Destructor * Destructor
*/ */
~moSimpleHCneutralExplorer() { ~moRandomBestHCExplorer() {
delete current; delete current;
} }

View file

@ -72,7 +72,7 @@
#include <explorer/moRandomNeutralWalkExplorer.h> #include <explorer/moRandomNeutralWalkExplorer.h>
#include <explorer/moRandomWalkExplorer.h> #include <explorer/moRandomWalkExplorer.h>
#include <explorer/moSimpleHCexplorer.h> #include <explorer/moSimpleHCexplorer.h>
#include <explorer/moSimpleHCneutralExplorer.h> #include <explorer/moRandomBestHCExplorer.h>
#include <explorer/moTSExplorer.h> #include <explorer/moTSExplorer.h>
#include <explorer/moILSexplorer.h> #include <explorer/moILSexplorer.h>
#include <explorer/moSAexplorer.h> #include <explorer/moSAexplorer.h>
@ -90,7 +90,6 @@
#include <memory/moCountMoveMemory.h> #include <memory/moCountMoveMemory.h>
#include <neighborhood/moBackableNeighbor.h> #include <neighborhood/moBackableNeighbor.h>
#include <neighborhood/moBitNeighbor.h>
#include <neighborhood/moIndexNeighbor.h> #include <neighborhood/moIndexNeighbor.h>
#include <neighborhood/moIndexNeighborhood.h> #include <neighborhood/moIndexNeighborhood.h>
#include <neighborhood/moNeighbor.h> #include <neighborhood/moNeighbor.h>
@ -112,6 +111,8 @@
#include <coolingSchedule/moCoolingSchedule.h> #include <coolingSchedule/moCoolingSchedule.h>
#include <coolingSchedule/moSimpleCoolingSchedule.h> #include <coolingSchedule/moSimpleCoolingSchedule.h>
#include <problems/bitString/moBitNeighbor.h>
//#include <old/moMove.h> //#include <old/moMove.h>
//#include <old/moMoveIncrEval.h> //#include <old/moMoveIncrEval.h>
//#include <old/moMoveInit.h> //#include <old/moMoveInit.h>

View file

@ -46,7 +46,7 @@
#include <ga/eoBit.h> #include <ga/eoBit.h>
#include <eoScalarFitness.h> #include <eoScalarFitness.h>
#include <neighborhood/moOrderNeighborhood.h> #include <neighborhood/moOrderNeighborhood.h>
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <neighborhood/moIndexNeighbor.h> #include <neighborhood/moIndexNeighbor.h>
#include <utils/eoMonitor.h> #include <utils/eoMonitor.h>

View file

@ -32,7 +32,7 @@
Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*/ */
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <cstdlib> #include <cstdlib>
#include <cassert> #include <cassert>

View file

@ -27,7 +27,7 @@ ParadisEO WebSite : http://paradiseo.gforge.inria.fr
Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*/ */
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <continuator/moDistanceStat.h> #include <continuator/moDistanceStat.h>
#include <utils/eoDistance.h> #include <utils/eoDistance.h>

View file

@ -28,7 +28,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
*/ */
#include <continuator/moFitnessStat.h> #include <continuator/moFitnessStat.h>
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>

View file

@ -32,7 +32,7 @@
Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*/ */
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <comparator/moNeighborComparator.h> #include <comparator/moNeighborComparator.h>
#include <ga/eoBit.h> #include <ga/eoBit.h>
#include <eoScalarFitness.h> #include <eoScalarFitness.h>

View file

@ -33,7 +33,7 @@
*/ */
#include <neighborhood/moOrderNeighborhood.h> #include <neighborhood/moOrderNeighborhood.h>
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <ga/eoBit.h> #include <ga/eoBit.h>
#include <cstdlib> #include <cstdlib>

View file

@ -28,7 +28,6 @@ Contact: paradiseo-help@lists.gforge.inria.fr
*/ */
#include <neighborhood/moRndWithReplNeighborhood.h> #include <neighborhood/moRndWithReplNeighborhood.h>
#include <neighborhood/moBitNeighbor.h>
#include "moTestClass.h" #include "moTestClass.h"
#include <iostream> #include <iostream>

View file

@ -28,7 +28,6 @@ Contact: paradiseo-help@lists.gforge.inria.fr
*/ */
#include <neighborhood/moRndWithoutReplNeighborhood.h> #include <neighborhood/moRndWithoutReplNeighborhood.h>
#include <neighborhood/moBitNeighbor.h>
#include "moTestClass.h" #include "moTestClass.h"
#include <iostream> #include <iostream>

View file

@ -1,5 +1,5 @@
/* /*
<t-moSimpleHCneutralExplorer.cpp> <t-moRandomBestHCExplorer.cpp>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
Sébastien Verel, Arnaud Liefooghe, Jérémie Humeau 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/moNeighborComparator.h>
#include <comparator/moSolNeighborComparator.h> #include <comparator/moSolNeighborComparator.h>
#include <explorer/moSimpleHCneutralExplorer.h> #include <explorer/moRandomBestHCExplorer.h>
#include "moTestClass.h" #include "moTestClass.h"
#include <iostream> #include <iostream>
@ -38,7 +38,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
int main() { int main() {
std::cout << "[t-moSimpleHCneutralExplorer] => START" << std::endl; std::cout << "[t-moRandomBestHCExplorer] => START" << std::endl;
//instanciation //instanciation
eoBit<eoMinimizingFitness> sol(4, true); eoBit<eoMinimizingFitness> sol(4, true);
@ -48,7 +48,7 @@ int main() {
moNeighborComparator<bitNeighbor> ncomp; moNeighborComparator<bitNeighbor> ncomp;
moSolNeighborComparator<bitNeighbor> sncomp; 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 qu'on ameliore bien a chaque itération
test.initParam(sol); test.initParam(sol);
@ -94,7 +94,7 @@ int main() {
test.updateParam(sol); test.updateParam(sol);
std::cout << "[t-moSimpleHCneutralExplorer] => OK" << std::endl; std::cout << "[t-moRandomBestHCExplorer] => OK" << std::endl;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View file

@ -32,7 +32,7 @@
Contact: paradiseo-help@lists.gforge.inria.fr Contact: paradiseo-help@lists.gforge.inria.fr
*/ */
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <eoScalarFitness.h> #include <eoScalarFitness.h>
#include <comparator/moSolNeighborComparator.h> #include <comparator/moSolNeighborComparator.h>
#include <ga/eoBit.h> #include <ga/eoBit.h>

View file

@ -1 +1 @@
#ADD_SUBDIRECTORY(oneMax) ADD_SUBDIRECTORY(oneMax)

View file

@ -7,7 +7,7 @@ LINK_DIRECTORIES(${EO_BIN_DIR}/lib)
ADD_EXECUTABLE(testSimpleHC testSimpleHC.cpp) ADD_EXECUTABLE(testSimpleHC testSimpleHC.cpp)
ADD_EXECUTABLE(testFirstImpr testFirstImpr.cpp) ADD_EXECUTABLE(testFirstImpr testFirstImpr.cpp)
ADD_EXECUTABLE(testRandomWalk testRandomWalk.cpp) ADD_EXECUTABLE(testRandomWalk testRandomWalk.cpp)
ADD_EXECUTABLE(testSimpleHCneutral testSimpleHCneutral.cpp) ADD_EXECUTABLE(testRandomBestHC testRandomBestHC.cpp)
ADD_EXECUTABLE(testHCneutral testHCneutral.cpp) ADD_EXECUTABLE(testHCneutral testHCneutral.cpp)
ADD_EXECUTABLE(testMetropolisHasting testMetropolisHasting.cpp) ADD_EXECUTABLE(testMetropolisHasting testMetropolisHasting.cpp)
#ADD_EXECUTABLE(testWithMove testWithMove.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(testSimpleHC eoutils ga eo)
TARGET_LINK_LIBRARIES(testFirstImpr eoutils ga eo) TARGET_LINK_LIBRARIES(testFirstImpr eoutils ga eo)
TARGET_LINK_LIBRARIES(testRandomWalk 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(testHCneutral eoutils ga eo)
TARGET_LINK_LIBRARIES(testMetropolisHasting eoutils ga eo) TARGET_LINK_LIBRARIES(testMetropolisHasting eoutils ga eo)
#TARGET_LINK_LIBRARIES(testWithMove eoutils ga eo) #TARGET_LINK_LIBRARIES(testWithMove eoutils ga eo)

View file

@ -194,9 +194,9 @@ void main_function(int argc, char **argv)
moILSexplorer< Neighbor > explorerILS(hc, perturb, accept); 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);
/* ========================================================= /* =========================================================

View file

@ -1,5 +1,5 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** testSimpleHCneutral.cpp /** testRandomBestHC.cpp
* *
* SV - 24/01/10 * SV - 24/01/10
* *
@ -34,7 +34,7 @@ using namespace std;
#include <comparator/moSolNeighborComparator.h> #include <comparator/moSolNeighborComparator.h>
#include <continuator/moTrueContinuator.h> #include <continuator/moTrueContinuator.h>
#include <algo/moLocalSearch.h> #include <algo/moLocalSearch.h>
#include <explorer/moSimpleHCneutralExplorer.h> #include <explorer/moRandomBestHCExplorer.h>
// REPRESENTATION // 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);
/* ========================================================= /* =========================================================

View file

@ -26,7 +26,7 @@ using namespace std;
#include <funcRoyalRoad.h> #include <funcRoyalRoad.h>
#include <eoInt.h> #include <eoInt.h>
#include <neighborhood/moRndWithoutReplNeighborhood.h> #include <neighborhood/moRndWithoutReplNeighborhood.h>
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <eval/moFullEvalByModif.h> #include <eval/moFullEvalByModif.h>
#include <eval/moFullEvalByCopy.h> #include <eval/moFullEvalByCopy.h>

View file

@ -1,7 +1,7 @@
#ifndef _oneMaxBitNeighbor_h #ifndef _oneMaxBitNeighbor_h
#define _oneMaxBitNeighbor_h #define _oneMaxBitNeighbor_h
#include <neighborhood/moBitNeighbor.h> #include <problems/bitString/moBitNeighbor.h>
#include <ga.h> #include <ga.h>
/* /*