Fin du nettoyage
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1812 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
c4b0699f53
commit
cc31901008
46 changed files with 417 additions and 546 deletions
|
|
@ -1295,7 +1295,7 @@ SKIP_FUNCTION_MACROS = YES
|
||||||
# If a tag file is not located in the directory in which doxygen
|
# If a tag file is not located in the directory in which doxygen
|
||||||
# is run, you must also specify the path to the tagfile here.
|
# is run, you must also specify the path to the tagfile here.
|
||||||
|
|
||||||
TAGFILES = @PARADISEO_EO_BIN_DIR@/doc/eo.doxytag=http://eodev.sourceforge.net/eo/doc/html
|
TAGFILES = @EO_BIN_DIR@/doc/eo.doxytag=http://eodev.sourceforge.net/eo/doc/html
|
||||||
|
|
||||||
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
|
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
|
||||||
# a tag file that is based on the input files it reads.
|
# a tag file that is based on the input files it reads.
|
||||||
|
|
|
||||||
|
|
@ -55,12 +55,6 @@ public:
|
||||||
moStat(T _value, std::string _description):
|
moStat(T _value, std::string _description):
|
||||||
eoValueParam<T>(_value, _description) {}
|
eoValueParam<T>(_value, _description) {}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * @return name of the class
|
|
||||||
// */
|
|
||||||
// virtual std::string className(void) const {
|
|
||||||
// return "moStat";
|
|
||||||
// }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ public :
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
|
* @param _stat a stat
|
||||||
*/
|
*/
|
||||||
moStatFromStat(moStat<EOT,T> & _stat): moStat<EOT, T>(0, _stat.description()), stat(_stat) {
|
moStatFromStat(moStat<EOT,T> & _stat): moStat<EOT, T>(0, _stat.description()), stat(_stat) {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ctor.
|
* Ctor.
|
||||||
* @param _max maximum running time
|
* @param _max maximum running time$
|
||||||
|
* @param _verbose verbose mode true/false -> on/off
|
||||||
*/
|
*/
|
||||||
moTimeContinuator(time_t _max, bool _verbose=true): max(_max), verbose(_verbose){
|
moTimeContinuator(time_t _max, bool _verbose=true): max(_max), verbose(_verbose){
|
||||||
start = time(NULL);
|
start = time(NULL);
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,8 @@ public:
|
||||||
moTrueContinuator() {} ;
|
moTrueContinuator() {} ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@param _solution a solution
|
* @param _solution a solution
|
||||||
*@return always true
|
* @return always true
|
||||||
*/
|
*/
|
||||||
virtual bool operator()(EOT & _solution) {
|
virtual bool operator()(EOT & _solution) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
* @param _param the parameter of type EOT to save in the vector
|
* @param _param the parameter of type eoScalarFitness to save in the vector
|
||||||
*/
|
*/
|
||||||
template <class ScalarType, class Compare>
|
template <class ScalarType, class Compare>
|
||||||
moVectorMonitor(eoValueParam<eoScalarFitness<ScalarType, Compare> > & _param) : doubleParam( & (eoValueParam<double>&)_param), intParam(NULL), eotParam(NULL)
|
moVectorMonitor(eoValueParam<eoScalarFitness<ScalarType, Compare> > & _param) : doubleParam( & (eoValueParam<double>&)_param), intParam(NULL), eotParam(NULL)
|
||||||
|
|
@ -80,7 +80,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
* @param _param the parameter of type EOT to save in the vector
|
* @param _param unvalid Parameter
|
||||||
*/
|
*/
|
||||||
template <class T>
|
template <class T>
|
||||||
moVectorMonitor(eoValueParam<T> & _param) : doubleParam(NULL), intParam(NULL), eotParam(NULL)
|
moVectorMonitor(eoValueParam<T> & _param) : doubleParam(NULL), intParam(NULL), eotParam(NULL)
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,7 @@ public:
|
||||||
* @param _span number of iteration with equal temperature
|
* @param _span number of iteration with equal temperature
|
||||||
* @param _finalT final temperature, threshold of the stopping criteria
|
* @param _finalT final temperature, threshold of the stopping criteria
|
||||||
*/
|
*/
|
||||||
moSimpleCoolingSchedule(double _initT, double _alpha, unsigned _span, double _finalT) : initT(_initT), alpha(_alpha), span(_span), finalT(_finalT) {
|
moSimpleCoolingSchedule(double _initT, double _alpha, unsigned _span, double _finalT) : initT(_initT), alpha(_alpha), span(_span), finalT(_finalT) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initial temperature
|
* Initial temperature
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,8 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NOTHING TO DO
|
* NOTHING TO DO
|
||||||
* @param _sol a solution
|
* @param _sol a solution (unused)
|
||||||
|
* @param _n a neighbor (unused)
|
||||||
*/
|
*/
|
||||||
void operator()(EOT& _sol, Neighbor& _n){}
|
void operator()(EOT& _sol, Neighbor& _n){}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,46 +51,46 @@ public:
|
||||||
moDummyExplorer(): moNeighborhoodExplorer<Neighbor>() { }
|
moDummyExplorer(): moNeighborhoodExplorer<Neighbor>() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init Search parameters
|
* NOTHING TO DO
|
||||||
* @param _solution the solution to explore
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
void initParam (EOT& _solution) { } ;
|
void initParam (EOT& _solution) { } ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update Search parameters
|
* NOTHING TO DO
|
||||||
* @param _solution the solution to explore
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
void updateParam (EOT& _solution) { } ;
|
void updateParam (EOT& _solution) { } ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if the exploration continue or not
|
* NOTHING TO DO
|
||||||
* @param _solution the solution to explore
|
* @param _solution a solution (unused)
|
||||||
* @return true if the exploration continue, else return false
|
* @return always false
|
||||||
*/
|
*/
|
||||||
bool isContinue(EOT& _solution) { return false; } ;
|
bool isContinue(EOT& _solution) { return false; } ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move a solution
|
* NOTHING TO DO
|
||||||
* @param _solution the solution to explore
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
void move(EOT& _solution) { } ;
|
void move(EOT& _solution) { } ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if a solution is accepted
|
* NOTHING TO DO
|
||||||
* @param _solution the solution to explore
|
* @param _solution a solution (unused)
|
||||||
* @return true if the solution is accepted, else return false
|
* @return always false
|
||||||
*/
|
*/
|
||||||
virtual bool accept(EOT& _solution) { return false; } ;
|
virtual bool accept(EOT& _solution) { return false; } ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Terminate the search
|
* NOTHING TO DO
|
||||||
* @param _solution the solution to explore
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void terminate(EOT& _solution) { } ;
|
virtual void terminate(EOT& _solution) { } ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explore the neighborhood of a solution
|
* NOTHING TO DO
|
||||||
* @param _solution
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
void operator()(EOT & _solution) { }
|
void operator()(EOT & _solution) { }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
#include <neighborhood/moNeighborhood.h>
|
#include <neighborhood/moNeighborhood.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explorer for a first imporvement heuristic
|
* Explorer for a first improvement heuristic
|
||||||
*/
|
*/
|
||||||
template< class Neighbor>
|
template< class Neighbor>
|
||||||
class moFirstImprHCexplorer : public moNeighborhoodExplorer<Neighbor>
|
class moFirstImprHCexplorer : public moNeighborhoodExplorer<Neighbor>
|
||||||
|
|
@ -74,21 +74,24 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initParam: NOTHING TO DO
|
* initParam: NOTHING TO DO
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void initParam(EOT & solution) {};
|
virtual void initParam(EOT & _solution) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* updateParam: NOTHING TO DO
|
* updateParam: NOTHING TO DO
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void updateParam(EOT & solution) {};
|
virtual void updateParam(EOT & _solution) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* terminate: NOTHING TO DO
|
* terminate: NOTHING TO DO
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void terminate(EOT & solution) {};
|
virtual void terminate(EOT & _solution) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explore the neighborhood of a solution
|
* Explore the neighborhood of a solution until an ameliorated neighbor is found
|
||||||
* @param _solution
|
* @param _solution
|
||||||
*/
|
*/
|
||||||
virtual void operator()(EOT & _solution) {
|
virtual void operator()(EOT & _solution) {
|
||||||
|
|
@ -136,7 +139,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* accept test if an amelirated neighbor was be found
|
* accept test if an ameliorated neighbor was be found
|
||||||
* @param _solution the solution
|
* @param _solution the solution
|
||||||
* @return true if the best neighbor ameliorate the fitness
|
* @return true if the best neighbor ameliorate the fitness
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -98,12 +98,13 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* terminate: NOTHING TO DO
|
* terminate: NOTHING TO DO
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void terminate(EOT & _solution){};
|
virtual void terminate(EOT & _solution){};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explore the neighborhood of a solution
|
* Perturb and apply local search on a solution
|
||||||
* @param _solution
|
* @param _solution the solution
|
||||||
*/
|
*/
|
||||||
virtual void operator()(EOT & _solution){
|
virtual void operator()(EOT & _solution){
|
||||||
//copy the solution to perform new local search
|
//copy the solution to perform new local search
|
||||||
|
|
@ -132,8 +133,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* move the solution with the best neighbor
|
* copy the solution found by the local search
|
||||||
* @param _solution the solution to move
|
* @param _solution the solution
|
||||||
*/
|
*/
|
||||||
virtual void move(EOT & _solution) {
|
virtual void move(EOT & _solution) {
|
||||||
_solution=current;
|
_solution=current;
|
||||||
|
|
|
||||||
|
|
@ -119,14 +119,6 @@ public:
|
||||||
isMoved=_isMoved;
|
isMoved=_isMoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the class id.
|
|
||||||
* @return the class name as a std::string
|
|
||||||
*/
|
|
||||||
// virtual std::string className() const {
|
|
||||||
// return "moNeighborhoodExplorer";
|
|
||||||
// }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
moDummyNeighborhood<Neighbor> dummyNeighborhood;
|
moDummyNeighborhood<Neighbor> dummyNeighborhood;
|
||||||
moDummyEval<Neighbor> dummyEval;
|
moDummyEval<Neighbor> dummyEval;
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,7 @@ public:
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -83,18 +82,20 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initial number of step
|
* initial number of step
|
||||||
|
* @param _solution the current solution
|
||||||
*/
|
*/
|
||||||
virtual void initParam(EOT & solution) {
|
virtual void initParam(EOT & _solution) {
|
||||||
moRandomBestHCexplorer<Neighbor>::initParam(solution);
|
moRandomBestHCexplorer<Neighbor>::initParam(_solution);
|
||||||
|
|
||||||
step = 0;
|
step = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* one more step
|
* one more step
|
||||||
|
* @param _solution the current solution
|
||||||
*/
|
*/
|
||||||
virtual void updateParam(EOT & solution) {
|
virtual void updateParam(EOT & _solution) {
|
||||||
moRandomBestHCexplorer<Neighbor>::updateParam(solution);
|
moRandomBestHCexplorer<Neighbor>::updateParam(_solution);
|
||||||
|
|
||||||
step++;
|
step++;
|
||||||
};
|
};
|
||||||
|
|
@ -109,7 +110,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* accept test if an ameliorated neighbor was be found
|
* accept test if an ameliorated or an equal neighbor was be found
|
||||||
* @param _solution the solution
|
* @param _solution the solution
|
||||||
* @return true if the best neighbor ameliorate the fitness or is equals
|
* @return true if the best neighbor ameliorate the fitness or is equals
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -83,28 +83,31 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* empty the vector of best solutions
|
* empty the vector of best solutions
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void initParam(EOT & solution) {
|
virtual void initParam(EOT & _solution) {
|
||||||
// delete all the best solutions
|
// delete all the best solutions
|
||||||
bestVector.clear();
|
bestVector.clear();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* empty the vector of best solutions
|
* empty the vector of best solutions
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void updateParam(EOT & solution) {
|
virtual void updateParam(EOT & _solution) {
|
||||||
// delete all the best solutions
|
// delete all the best solutions
|
||||||
bestVector.clear();
|
bestVector.clear();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* terminate: NOTHING TO DO
|
* terminate: NOTHING TO DO
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void terminate(EOT & solution) {};
|
virtual void terminate(EOT & _solution) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explore the neighborhood of a solution
|
* Explore the neighborhood of a solution
|
||||||
* @param _solution
|
* @param _solution the current solution
|
||||||
*/
|
*/
|
||||||
virtual void operator()(EOT & _solution) {
|
virtual void operator()(EOT & _solution) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,8 @@ public:
|
||||||
* @param _solNeighborComparator a solution vs neighbor comparator
|
* @param _solNeighborComparator a solution vs neighbor comparator
|
||||||
* @param _nbStep maximum number of step to do
|
* @param _nbStep maximum number of step to do
|
||||||
*/
|
*/
|
||||||
moRandomNeutralWalkExplorer(Neighborhood& _neighborhood, moEval<Neighbor>& _eval,
|
moRandomNeutralWalkExplorer(Neighborhood& _neighborhood,
|
||||||
|
moEval<Neighbor>& _eval,
|
||||||
moSolNeighborComparator<Neighbor>& _solNeighborComparator,
|
moSolNeighborComparator<Neighbor>& _solNeighborComparator,
|
||||||
unsigned _nbStep):
|
unsigned _nbStep):
|
||||||
moNeighborhoodExplorer<Neighbor>(_neighborhood, _eval),
|
moNeighborhoodExplorer<Neighbor>(_neighborhood, _eval),
|
||||||
|
|
@ -84,23 +85,26 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialization of the number of step to be done
|
* initialization of the number of step to be done
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void initParam(EOT & solution) {
|
virtual void initParam(EOT & _solution) {
|
||||||
step = 0;
|
step = 0;
|
||||||
isAccept = true;
|
isAccept = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* increase the number of step
|
* increase the number of step
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void updateParam(EOT & solution) {
|
virtual void updateParam(EOT & _solution) {
|
||||||
step++;
|
step++;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* terminate: NOTHING TO DO
|
* terminate: NOTHING TO DO
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void terminate(EOT & solution) {};
|
virtual void terminate(EOT & _solution) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explore the neighborhood of a solution
|
* Explore the neighborhood of a solution
|
||||||
|
|
@ -135,7 +139,7 @@ public:
|
||||||
* @return true there is some steps to do
|
* @return true there is some steps to do
|
||||||
*/
|
*/
|
||||||
virtual bool isContinue(EOT & _solution) {
|
virtual bool isContinue(EOT & _solution) {
|
||||||
return (step < nbStep) && isAccept ;
|
return (step < nbStep) && isAccept ;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -150,7 +154,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* accept test if an ameliorated neighbor was be found
|
* accept test if an equals neighbor was be found
|
||||||
* @param _solution the solution
|
* @param _solution the solution
|
||||||
* @return true if the best neighbor ameliorate the fitness
|
* @return true if the best neighbor ameliorate the fitness
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param _init the solution initializer, to explore at random the search space
|
* @param _init the solution initializer, to explore at random the search space
|
||||||
* @param _eval the evaluation function
|
* @param _fulleval the evaluation function
|
||||||
* @param _nbStep maximum number of step to do
|
* @param _nbStep maximum number of step to do
|
||||||
*/
|
*/
|
||||||
moRandomSearchExplorer(eoInit<EOT>& _init, eoEvalFunc<EOT>& _fulleval, unsigned _nbStep) : moNeighborhoodExplorer<Neighbor>(), init(_init), fulleval(_fulleval), nbStep(_nbStep) {
|
moRandomSearchExplorer(eoInit<EOT>& _init, eoEvalFunc<EOT>& _fulleval, unsigned _nbStep) : moNeighborhoodExplorer<Neighbor>(), init(_init), fulleval(_fulleval), nbStep(_nbStep) {
|
||||||
|
|
@ -68,27 +68,29 @@ public:
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
*/
|
*/
|
||||||
~moRandomSearchExplorer() {
|
~moRandomSearchExplorer() {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialization of the number of step to be done
|
* initialization of the number of step to be done
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void initParam(EOT & solution) {
|
virtual void initParam(EOT & _solution) {
|
||||||
step = 0;
|
step = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* increase the number of step
|
* increase the number of step
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void updateParam(EOT & solution) {
|
virtual void updateParam(EOT & _solution) {
|
||||||
step++;
|
step++;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* terminate: NOTHING TO DO
|
* terminate: NOTHING TO DO
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void terminate(EOT & solution) {};
|
virtual void terminate(EOT & _solution) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explore the neighborhood with only one random solution
|
* Explore the neighborhood with only one random solution
|
||||||
|
|
|
||||||
|
|
@ -78,28 +78,31 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialization of the number of step to be done
|
* initialization of the number of step to be done
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void initParam(EOT & solution) {
|
virtual void initParam(EOT & _solution) {
|
||||||
step = 0;
|
step = 0;
|
||||||
isAccept = true;
|
isAccept = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* increase the number of step
|
* increase the number of step
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void updateParam(EOT & solution) {
|
virtual void updateParam(EOT & _solution) {
|
||||||
step++;
|
step++;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* terminate: NOTHING TO DO
|
* terminate: NOTHING TO DO
|
||||||
|
* @param _solution a solution (unused)
|
||||||
*/
|
*/
|
||||||
virtual void terminate(EOT & solution) {};
|
virtual void terminate(EOT & _solution) {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explore the neighborhood with only one random solution
|
* Explore the neighborhood with only one random solution
|
||||||
* we supposed that the first neighbor is uniformly selected in the neighborhood
|
* we supposed that the first neighbor is uniformly selected in the neighborhood
|
||||||
* @param _solution
|
* @param _solution a solution
|
||||||
*/
|
*/
|
||||||
virtual void operator()(EOT & _solution) {
|
virtual void operator()(EOT & _solution) {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,8 @@ public:
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param _neighborhood the neighborhood
|
* @param _neighborhood the neighborhood
|
||||||
* @param _eval the evaluation function
|
* @param _eval the evaluation function
|
||||||
* @param _neighborComparator a neighbor comparator
|
|
||||||
* @param _solNeighborComparator a solution vs neighbor comparator
|
* @param _solNeighborComparator a solution vs neighbor comparator
|
||||||
* @param _nbStep maximum number of step to do
|
* @param _coolingSchedule the cooling schedule
|
||||||
*/
|
*/
|
||||||
moSAexplorer(Neighborhood& _neighborhood, moEval<Neighbor>& _eval, moSolNeighborComparator<Neighbor>& _solNeighborComparator, moCoolingSchedule<EOT>& _coolingSchedule) : moNeighborhoodExplorer<Neighbor>(_neighborhood, _eval), solNeighborComparator(_solNeighborComparator), coolingSchedule(_coolingSchedule) {
|
moSAexplorer(Neighborhood& _neighborhood, moEval<Neighbor>& _eval, moSolNeighborComparator<Neighbor>& _solNeighborComparator, moCoolingSchedule<EOT>& _coolingSchedule) : moNeighborhoodExplorer<Neighbor>(_neighborhood, _eval), solNeighborComparator(_solNeighborComparator), coolingSchedule(_coolingSchedule) {
|
||||||
isAccept = false;
|
isAccept = false;
|
||||||
|
|
@ -168,6 +167,10 @@ public:
|
||||||
return isAccept;
|
return isAccept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter
|
||||||
|
* @return the temperature
|
||||||
|
*/
|
||||||
double getTemperature(){
|
double getTemperature(){
|
||||||
return temperature;
|
return temperature;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,33 @@
|
||||||
|
/*
|
||||||
|
<moAspiration.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 _moAspiration_h
|
#ifndef _moAspiration_h
|
||||||
#define _moAspiration_h
|
#define _moAspiration_h
|
||||||
|
|
||||||
|
|
@ -12,7 +42,17 @@ class moAspiration : public eoBF<typename Neighbor::EOT &, Neighbor &, bool>
|
||||||
public:
|
public:
|
||||||
typedef typename Neighbor::EOT EOT;
|
typedef typename Neighbor::EOT EOT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Virtual Init
|
||||||
|
* @param _sol the current solution
|
||||||
|
*/
|
||||||
virtual void init(EOT & _sol) = 0;
|
virtual void init(EOT & _sol) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Virtual update
|
||||||
|
* @param _sol the current solution
|
||||||
|
* @param _neighbor the current neighbor
|
||||||
|
*/
|
||||||
virtual void update(EOT & _sol, Neighbor & _neighbor) = 0;
|
virtual void update(EOT & _sol, Neighbor & _neighbor) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,33 @@
|
||||||
|
/*
|
||||||
|
<moBestImprAspiration.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 _moBestImprAspiration_h
|
#ifndef _moBestImprAspiration_h
|
||||||
#define _moBestImprAspiration_h
|
#define _moBestImprAspiration_h
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue