rename files
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1754 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
31066ad27b
commit
0720d5f05d
14 changed files with 144 additions and 68 deletions
|
|
@ -31,7 +31,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
#define _moFirstImprHC_h
|
#define _moFirstImprHC_h
|
||||||
|
|
||||||
#include <algo/moLocalSearch.h>
|
#include <algo/moLocalSearch.h>
|
||||||
#include <explorer/moFirstImprExplorer.h>
|
#include <explorer/moFirstImprHCexplorer.h>
|
||||||
#include <continuator/moTrueContinuator.h>
|
#include <continuator/moTrueContinuator.h>
|
||||||
#include <eval/moEval.h>
|
#include <eval/moEval.h>
|
||||||
#include <eoEvalFunc.h>
|
#include <eoEvalFunc.h>
|
||||||
|
|
@ -88,7 +88,7 @@ private:
|
||||||
// compare the fitness values of the solution and the neighbor: true if strictly greater
|
// compare the fitness values of the solution and the neighbor: true if strictly greater
|
||||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||||
// the explorer of the first improvement HC
|
// the explorer of the first improvement HC
|
||||||
moFirstImprExplorer<Neighbor> explorer;
|
moFirstImprHCexplorer<Neighbor> explorer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
#define _moRandomBestHC_h
|
#define _moRandomBestHC_h
|
||||||
|
|
||||||
#include <algo/moLocalSearch.h>
|
#include <algo/moLocalSearch.h>
|
||||||
#include <explorer/moRandomBestHCExplorer.h>
|
#include <explorer/moRandomBestHCexplorer.h>
|
||||||
#include <continuator/moTrueContinuator.h>
|
#include <continuator/moTrueContinuator.h>
|
||||||
#include <eval/moEval.h>
|
#include <eval/moEval.h>
|
||||||
#include <eoEvalFunc.h>
|
#include <eoEvalFunc.h>
|
||||||
|
|
@ -88,7 +88,7 @@ private:
|
||||||
// compare the fitness values of the solution and the neighbor: true if strictly greater
|
// compare the fitness values of the solution and the neighbor: true if strictly greater
|
||||||
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
moSolNeighborComparator<Neighbor> defaultSolNeighborComp;
|
||||||
// the explorer of the HC with random choice of the best solution
|
// the explorer of the HC with random choice of the best solution
|
||||||
moRandomBestHCExplorer<Neighbor> explorer;
|
moRandomBestHCexplorer<Neighbor> explorer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public:
|
||||||
* @param _spanNoMove maximum number of no improvement with equal temperature
|
* @param _spanNoMove maximum number of no improvement with equal temperature
|
||||||
* @param _nbSpan maximum number of span with no improvmement before stopping the search
|
* @param _nbSpan maximum number of span with no improvmement before stopping the search
|
||||||
*/
|
*/
|
||||||
moDynSpanCoolingSchedule(double _initT, double _alpha, unsigned _spanMove, unsigned _spanNoMove, unsigned _nbSpan) : initT(_initT), alpha(_alpha), spanMove(_spanMove), spanNoMove(_spanNoMove), nbSpan(_nbSpan) {
|
moDynSpanCoolingSchedule(double _initT, double _alpha, unsigned int _spanMove, unsigned int _spanNoMove, unsigned int _nbSpan) : initT(_initT), alpha(_alpha), spanMove(_spanMove), spanNoMove(_spanNoMove), nbSpan(_nbSpan) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -101,12 +101,22 @@ public:
|
||||||
private:
|
private:
|
||||||
// initial temperature
|
// initial temperature
|
||||||
double initT;
|
double initT;
|
||||||
|
|
||||||
// coefficient of decrease
|
// coefficient of decrease
|
||||||
double alpha;
|
double alpha;
|
||||||
|
|
||||||
|
//
|
||||||
|
unsigned int spanMove;
|
||||||
|
|
||||||
|
//
|
||||||
|
unsigned int spanNoMove;
|
||||||
|
|
||||||
// maximum number of iterations at the same temperature
|
// maximum number of iterations at the same temperature
|
||||||
unsigned int span;
|
unsigned int nbSpan;
|
||||||
|
|
||||||
// threshold temperature
|
// threshold temperature
|
||||||
double finalT;
|
double finalT;
|
||||||
|
|
||||||
// number of steps with the same temperature
|
// number of steps with the same temperature
|
||||||
unsigned int step;
|
unsigned int step;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
<moFirstImprExplorer.h>
|
<moFirstImprHCexplorer.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 _moFirstImprexplorer_h
|
#ifndef _moFirstImprHCexplorer_h
|
||||||
#define _moFirstImprexplorer_h
|
#define _moFirstImprHCexplorer_h
|
||||||
|
|
||||||
#include <explorer/moNeighborhoodExplorer.h>
|
#include <explorer/moNeighborhoodExplorer.h>
|
||||||
#include <comparator/moNeighborComparator.h>
|
#include <comparator/moNeighborComparator.h>
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
* Explorer for a first imporvement heuristic
|
* Explorer for a first imporvement heuristic
|
||||||
*/
|
*/
|
||||||
template< class Neighbor>
|
template< class Neighbor>
|
||||||
class moFirstImprExplorer : public moNeighborhoodExplorer<Neighbor>
|
class moFirstImprHCexplorer : public moNeighborhoodExplorer<Neighbor>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename Neighbor::EOT EOT ;
|
typedef typename Neighbor::EOT EOT ;
|
||||||
|
|
@ -60,7 +60,7 @@ public:
|
||||||
* @param _neighborComparator a neighbor comparator
|
* @param _neighborComparator a neighbor comparator
|
||||||
* @param _solNeighborComparator a solution vs neighbor comparator
|
* @param _solNeighborComparator a solution vs neighbor comparator
|
||||||
*/
|
*/
|
||||||
moFirstImprExplorer(Neighborhood& _neighborhood, moEval<Neighbor>& _eval, moNeighborComparator<Neighbor>& _neighborComparator, moSolNeighborComparator<Neighbor>& _solNeighborComparator) : moNeighborhoodExplorer<Neighbor>(_neighborhood, _eval), neighborComparator(_neighborComparator), solNeighborComparator(_solNeighborComparator) {
|
moFirstImprHCexplorer(Neighborhood& _neighborhood, moEval<Neighbor>& _eval, moNeighborComparator<Neighbor>& _neighborComparator, moSolNeighborComparator<Neighbor>& _solNeighborComparator) : moNeighborhoodExplorer<Neighbor>(_neighborhood, _eval), neighborComparator(_neighborComparator), solNeighborComparator(_solNeighborComparator) {
|
||||||
isAccept = false;
|
isAccept = false;
|
||||||
current=new Neighbor();
|
current=new Neighbor();
|
||||||
}
|
}
|
||||||
|
|
@ -68,7 +68,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
~moFirstImprExplorer() {
|
~moFirstImprHCexplorer() {
|
||||||
delete current;
|
delete current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
<moHCneutralExplorer.h>
|
<moNeutralHCexplorer.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,10 +32,10 @@
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _moHCneutralExplorer_h
|
#ifndef _moNeutralHCexplorer_h
|
||||||
#define _moHCneutralExplorer_h
|
#define _moNeutralHCexplorer_h
|
||||||
|
|
||||||
#include <explorer/moRandomBestHCExplorer.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 moRandomBestHCExplorer<Neighbor>
|
class moNeutralHCexplorer : 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 moRandomBestHCExplorer<Neighbor>::solNeighborComparator;
|
using moRandomBestHCexplorer<Neighbor>::solNeighborComparator;
|
||||||
using moRandomBestHCExplorer<Neighbor>::isAccept;
|
using moRandomBestHCexplorer<Neighbor>::isAccept;
|
||||||
using moRandomBestHCExplorer<Neighbor>::bestVector;
|
using moRandomBestHCexplorer<Neighbor>::bestVector;
|
||||||
using moRandomBestHCExplorer<Neighbor>::initParam;
|
using moRandomBestHCexplorer<Neighbor>::initParam;
|
||||||
using moRandomBestHCExplorer<Neighbor>::updateParam;
|
using moRandomBestHCexplorer<Neighbor>::updateParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|
@ -65,30 +65,30 @@ public:
|
||||||
* @param _solNeighborComparator a solution vs neighbor comparator
|
* @param _solNeighborComparator a solution vs neighbor comparator
|
||||||
* @param _nbStep maximum step to do
|
* @param _nbStep maximum step to do
|
||||||
*/
|
*/
|
||||||
moHCneutralExplorer(Neighborhood& _neighborhood,
|
moNeutralHCexplorer(Neighborhood& _neighborhood,
|
||||||
moEval<Neighbor>& _eval,
|
moEval<Neighbor>& _eval,
|
||||||
moNeighborComparator<Neighbor>& _neighborComparator,
|
moNeighborComparator<Neighbor>& _neighborComparator,
|
||||||
moSolNeighborComparator<Neighbor>& _solNeighborComparator,
|
moSolNeighborComparator<Neighbor>& _solNeighborComparator,
|
||||||
unsigned _nbStep) :
|
unsigned _nbStep) :
|
||||||
moRandomBestHCExplorer<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()) {
|
||||||
std::cout << "moHCneutralExplorer::Warning -> the neighborhood used is not random" << std::endl;
|
std::cout << "moNeutralHCexplorer::Warning -> the neighborhood used is not random" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
~moHCneutralExplorer() {
|
~moNeutralHCexplorer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initial number of step
|
* initial number of step
|
||||||
*/
|
*/
|
||||||
virtual void initParam(EOT & solution) {
|
virtual void initParam(EOT & solution) {
|
||||||
moRandomBestHCExplorer<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) {
|
||||||
moRandomBestHCExplorer<Neighbor>::updateParam(solution);
|
moRandomBestHCexplorer<Neighbor>::updateParam(solution);
|
||||||
|
|
||||||
step++;
|
step++;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
<moRandomBestHCExplorer.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
|
||||||
|
|
||||||
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
Sebastien Verel, Arnaud Liefooghe, Jeremie Humeau
|
||||||
|
|
@ -32,8 +32,8 @@
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _moRandomBestHCExplorer_h
|
#ifndef _moRandomBestHCexplorer_h
|
||||||
#define _moRandomBestHCExplorer_h
|
#define _moRandomBestHCexplorer_h
|
||||||
|
|
||||||
#include <explorer/moNeighborhoodExplorer.h>
|
#include <explorer/moNeighborhoodExplorer.h>
|
||||||
#include <comparator/moNeighborComparator.h>
|
#include <comparator/moNeighborComparator.h>
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
* which choose randomly one of the best solution in the neighborhood at each iteration
|
* which choose randomly one of the best solution in the neighborhood at each iteration
|
||||||
*/
|
*/
|
||||||
template< class Neighbor >
|
template< class Neighbor >
|
||||||
class moRandomBestHCExplorer : public moNeighborhoodExplorer<Neighbor>
|
class moRandomBestHCexplorer : public moNeighborhoodExplorer<Neighbor>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename Neighbor::EOT EOT ;
|
typedef typename Neighbor::EOT EOT ;
|
||||||
|
|
@ -63,7 +63,7 @@ public:
|
||||||
* @param _neighborComparator a neighbor comparator
|
* @param _neighborComparator a neighbor comparator
|
||||||
* @param _solNeighborComparator solution vs neighbor comparator
|
* @param _solNeighborComparator solution vs neighbor comparator
|
||||||
*/
|
*/
|
||||||
moRandomBestHCExplorer(Neighborhood& _neighborhood,
|
moRandomBestHCexplorer(Neighborhood& _neighborhood,
|
||||||
moEval<Neighbor>& _eval,
|
moEval<Neighbor>& _eval,
|
||||||
moNeighborComparator<Neighbor>& _neighborComparator,
|
moNeighborComparator<Neighbor>& _neighborComparator,
|
||||||
moSolNeighborComparator<Neighbor>& _solNeighborComparator) :
|
moSolNeighborComparator<Neighbor>& _solNeighborComparator) :
|
||||||
|
|
@ -77,7 +77,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
~moRandomBestHCExplorer() {
|
~moRandomBestHCexplorer() {
|
||||||
delete current;
|
delete current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
<moTSExplorer.h>
|
<moTSexplorer.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 _moTSExplorer_h
|
#ifndef _moTSexplorer_h
|
||||||
#define _moTSExplorer_h
|
#define _moTSexplorer_h
|
||||||
|
|
||||||
#include <explorer/moNeighborhoodExplorer.h>
|
#include <explorer/moNeighborhoodExplorer.h>
|
||||||
#include <comparator/moNeighborComparator.h>
|
#include <comparator/moNeighborComparator.h>
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
* Explorer for a Tabu Search
|
* Explorer for a Tabu Search
|
||||||
*/
|
*/
|
||||||
template< class Neighbor >
|
template< class Neighbor >
|
||||||
class moTSExplorer : public moNeighborhoodExplorer<Neighbor>
|
class moTSexplorer : public moNeighborhoodExplorer<Neighbor>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef typename Neighbor::EOT EOT ;
|
typedef typename Neighbor::EOT EOT ;
|
||||||
|
|
@ -65,7 +65,7 @@ public:
|
||||||
* @param _diversification the diversification box
|
* @param _diversification the diversification box
|
||||||
* @param _aspiration the aspiration criteria
|
* @param _aspiration the aspiration criteria
|
||||||
*/
|
*/
|
||||||
moTSExplorer(Neighborhood& _neighborhood,
|
moTSexplorer(Neighborhood& _neighborhood,
|
||||||
moEval<Neighbor>& _eval,
|
moEval<Neighbor>& _eval,
|
||||||
moNeighborComparator<Neighbor>& _neighborComparator,
|
moNeighborComparator<Neighbor>& _neighborComparator,
|
||||||
moSolNeighborComparator<Neighbor>& _solNeighborComparator,
|
moSolNeighborComparator<Neighbor>& _solNeighborComparator,
|
||||||
|
|
@ -85,7 +85,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
~moTSExplorer() {
|
~moTSexplorer() {
|
||||||
delete current;
|
delete current;
|
||||||
delete best;
|
delete best;
|
||||||
}
|
}
|
||||||
|
|
@ -70,15 +70,15 @@
|
||||||
#include <eval/moFullEvalByModif.h>
|
#include <eval/moFullEvalByModif.h>
|
||||||
#include <eval/moDummyEval.h>
|
#include <eval/moDummyEval.h>
|
||||||
|
|
||||||
#include <explorer/moFirstImprExplorer.h>
|
#include <explorer/moFirstImprHCexplorer.h>
|
||||||
#include <explorer/moHCneutralExplorer.h>
|
#include <explorer/moNeutralHCexplorer.h>
|
||||||
#include <explorer/moMetropolisHastingExplorer.h>
|
#include <explorer/moMetropolisHastingExplorer.h>
|
||||||
#include <explorer/moNeighborhoodExplorer.h>
|
#include <explorer/moNeighborhoodExplorer.h>
|
||||||
#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/moRandomBestHCExplorer.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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,13 @@ SET (TEST_LIST
|
||||||
t-moSolVectorTabuList
|
t-moSolVectorTabuList
|
||||||
t-moBestImprAspiration
|
t-moBestImprAspiration
|
||||||
t-moSimpleHCexplorer
|
t-moSimpleHCexplorer
|
||||||
t-moSimpleHCneutralExplorer
|
t-moRandomBestHCexplorer
|
||||||
t-moHCneutralExplorer
|
t-moNeutralHCexplorer
|
||||||
t-moFirstImprExplorer
|
t-moFirstImprHCexplorer
|
||||||
t-moRandomWalkExplorer
|
t-moRandomWalkExplorer
|
||||||
t-moMetropolisHastingExplorer
|
t-moMetropolisHastingExplorer
|
||||||
t-moRandomNeutralWalkExplorer
|
t-moRandomNeutralWalkExplorer
|
||||||
t-moTSExplorer
|
t-moTSexplorer
|
||||||
t-moForwardVariableNeighborhood
|
t-moForwardVariableNeighborhood
|
||||||
t-moSolComparator
|
t-moSolComparator
|
||||||
t-moDummyEval
|
t-moDummyEval
|
||||||
|
|
@ -74,6 +74,7 @@ SET (TEST_LIST
|
||||||
t-moSA
|
t-moSA
|
||||||
t-moLocalSearch
|
t-moLocalSearch
|
||||||
t-moILSexplorer
|
t-moILSexplorer
|
||||||
|
t-moSimpleHC
|
||||||
)
|
)
|
||||||
|
|
||||||
FOREACH (test ${TEST_LIST})
|
FOREACH (test ${TEST_LIST})
|
||||||
|
|
|
||||||
|
|
@ -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/moFirstImprExplorer.h>
|
#include <explorer/moFirstImprHCexplorer.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-moFirstImprExplorer] => START" << std::endl;
|
std::cout << "[t-moFirstImprHCexplorer] => 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;
|
||||||
|
|
||||||
moFirstImprExplorer<bitNeighbor> test(nh, eval, ncomp, sncomp);
|
moFirstImprHCexplorer<bitNeighbor> test(nh, eval, ncomp, sncomp);
|
||||||
|
|
||||||
//on verifie qu'on améliore peut continuer à explorer tant qu'on améliore la solution
|
//on verifie qu'on améliore peut continuer à explorer tant qu'on améliore la solution
|
||||||
|
|
||||||
|
|
@ -86,7 +86,7 @@ int main() {
|
||||||
assert(sol.fitness()==0);
|
assert(sol.fitness()==0);
|
||||||
assert(!test.isContinue(sol));
|
assert(!test.isContinue(sol));
|
||||||
|
|
||||||
std::cout << "[t-moFirstImprExplorer] => OK" << std::endl;
|
std::cout << "[t-moFirstImprHCexplorer] => OK" << std::endl;
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
<t-moHCneutralExplorer.cpp>
|
<t-moNeutralHCexplorer.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/moHCneutralExplorer.h>
|
#include <explorer/moNeutralHCexplorer.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-moHCneutralExplorer] => START" << std::endl;
|
std::cout << "[t-moNeutralHCexplorer] => 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;
|
||||||
|
|
||||||
moHCneutralExplorer<bitNeighbor> test(nh, eval, ncomp, sncomp,3);
|
moNeutralHCexplorer<bitNeighbor> test(nh, eval, ncomp, sncomp,3);
|
||||||
|
|
||||||
//on verifie qu'on ameliore bien la solution et que l'exploration dure 3 itérations
|
//on verifie qu'on ameliore bien la solution et que l'exploration dure 3 itérations
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ int main() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::cout << "[t-moHCneutralExplorer] => OK" << std::endl;
|
std::cout << "[t-moNeutralHCexplorer] => OK" << std::endl;
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
@ -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/moRandomBestHCExplorer.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-moRandomBestHCExplorer] => 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;
|
||||||
|
|
||||||
moRandomBestHCExplorer<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-moRandomBestHCExplorer] => OK" << std::endl;
|
std::cout << "[t-moRandomBestHCexplorer] => OK" << std::endl;
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
65
trunk/paradiseo-mo/test/t-moSimpleHC.cpp
Normal file
65
trunk/paradiseo-mo/test/t-moSimpleHC.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
/*
|
||||||
|
<t-moSimpleHC.cpp>
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
#include <algo/moSimpleHC.h>
|
||||||
|
#include "moTestClass.h"
|
||||||
|
#include <problems/eval/oneMaxFullEval.h>
|
||||||
|
#include <continuator/moTrueContinuator.h>
|
||||||
|
#include <comparator/moSolNeighborComparator.h>
|
||||||
|
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
|
||||||
|
std::cout << "[t-moSimpleHC] => START" << std::endl;
|
||||||
|
|
||||||
|
bitNeighborhood nh(4);
|
||||||
|
oneMaxFullEval<bitVector> fullEval;
|
||||||
|
evalOneMax eval(4);
|
||||||
|
|
||||||
|
//test first constructor
|
||||||
|
moSimpleHC<bitNeighbor> test1(nh, fullEval, eval);
|
||||||
|
|
||||||
|
//test second constructor
|
||||||
|
moTrueContinuator<bitNeighbor> cont;
|
||||||
|
moSimpleHC<bitNeighbor> test2(nh, fullEval, eval, cont);
|
||||||
|
|
||||||
|
//test third constructor
|
||||||
|
moSolNeighborComparator<bitNeighbor> sncomp;
|
||||||
|
moNeighborComparator<bitNeighbor> ncomp;
|
||||||
|
moSimpleHC<bitNeighbor> test3(nh, fullEval, eval, cont, ncomp, sncomp);
|
||||||
|
|
||||||
|
std::cout << "[t-moSimpleHC] => OK" << std::endl;
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
<t-moTSExplorer.cpp>
|
<t-moTSexplorer.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
|
||||||
|
|
@ -31,7 +31,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
#include <memory/moDummyIntensification.h>
|
#include <memory/moDummyIntensification.h>
|
||||||
#include <memory/moDummyDiversification.h>
|
#include <memory/moDummyDiversification.h>
|
||||||
#include <memory/moBestImprAspiration.h>
|
#include <memory/moBestImprAspiration.h>
|
||||||
#include <explorer/moTSExplorer.h>
|
#include <explorer/moTSexplorer.h>
|
||||||
#include "moTestClass.h"
|
#include "moTestClass.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
@ -40,7 +40,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
std::cout << "[t-moTSExplorer] => START" << std::endl;
|
std::cout << "[t-moTSexplorer] => START" << std::endl;
|
||||||
|
|
||||||
//instansiation
|
//instansiation
|
||||||
eoBit<eoMinimizingFitness> sol(4, true);
|
eoBit<eoMinimizingFitness> sol(4, true);
|
||||||
|
|
@ -55,8 +55,8 @@ int main() {
|
||||||
moSolVectorTabuList<bitNeighbor> tabuList(4,0);
|
moSolVectorTabuList<bitNeighbor> tabuList(4,0);
|
||||||
moBestImprAspiration<bitNeighbor> aspir;
|
moBestImprAspiration<bitNeighbor> aspir;
|
||||||
|
|
||||||
moTSExplorer<bitNeighbor> test(nh, eval, ncomp, sncomp, tabuList, intens, diver, aspir);
|
moTSexplorer<bitNeighbor> test(nh, eval, ncomp, sncomp, tabuList, intens, diver, aspir);
|
||||||
moTSExplorer<bitNeighbor> test2(emptyNH, eval, ncomp, sncomp, tabuList, intens, diver, aspir);
|
moTSexplorer<bitNeighbor> test2(emptyNH, eval, ncomp, sncomp, tabuList, intens, diver, aspir);
|
||||||
|
|
||||||
//test d'un voisinage vide
|
//test d'un voisinage vide
|
||||||
test2.initParam(sol);
|
test2.initParam(sol);
|
||||||
|
|
@ -130,7 +130,7 @@ int main() {
|
||||||
bitNeighborhood nh2(2);
|
bitNeighborhood nh2(2);
|
||||||
evalOneMax eval2(2);
|
evalOneMax eval2(2);
|
||||||
|
|
||||||
moTSExplorer<bitNeighbor> test3(nh2, eval2, ncomp, sncomp, tabuList, intens, diver, aspir);
|
moTSexplorer<bitNeighbor> test3(nh2, eval2, ncomp, sncomp, tabuList, intens, diver, aspir);
|
||||||
|
|
||||||
test3.initParam(sol2);
|
test3.initParam(sol2);
|
||||||
test3(sol2);
|
test3(sol2);
|
||||||
|
|
@ -158,7 +158,7 @@ int main() {
|
||||||
assert(!test3.accept(sol2));
|
assert(!test3.accept(sol2));
|
||||||
|
|
||||||
|
|
||||||
std::cout << "[t-moTSExplorer] => OK" << std::endl;
|
std::cout << "[t-moTSexplorer] => OK" << std::endl;
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue