From c4b0699f5385506b04256143eb7db10b559ce880 Mon Sep 17 00:00:00 2001 From: jhumeau Date: Wed, 12 May 2010 16:06:23 +0000 Subject: [PATCH] =?UTF-8?q?D=C3=A9but=20du=20nettoyage=20et=20verif=20de?= =?UTF-8?q?=20la=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1811 331e1502-861f-0410-8da2-ba01fb791d7f --- trunk/paradiseo-mo/src/algo/moDummyLS.h | 4 ++-- trunk/paradiseo-mo/src/algo/moFirstImprHC.h | 8 ++++---- trunk/paradiseo-mo/src/algo/moLocalSearch.h | 9 ++++++--- .../src/algo/moMetropolisHasting.h | 8 ++++---- trunk/paradiseo-mo/src/algo/moNeutralHC.h | 8 ++++---- trunk/paradiseo-mo/src/algo/moRandomBestHC.h | 8 ++++---- .../src/algo/moRandomNeutralWalk.h | 8 ++++---- trunk/paradiseo-mo/src/algo/moRandomSearch.h | 7 ++++--- trunk/paradiseo-mo/src/algo/moRandomWalk.h | 6 +++--- trunk/paradiseo-mo/src/algo/moSA.h | 3 +++ trunk/paradiseo-mo/src/algo/moSimpleHC.h | 4 ++-- trunk/paradiseo-mo/src/algo/moTS.h | 3 +++ .../src/comparator/moComparator.h | 20 +++++++------------ .../moAverageFitnessNeighborStat.h | 2 +- .../src/continuator/moCombinedContinuator.h | 1 + .../src/continuator/moCounterMonitorSaver.h | 4 +--- .../src/continuator/moFitContinuator.h | 1 + .../src/continuator/moFitnessStat.h | 6 ++---- .../src/continuator/moFullEvalContinuator.h | 4 ++-- .../src/continuator/moIterContinuator.h | 2 ++ .../src/continuator/moMaxNeighborStat.h | 1 + .../src/continuator/moMinNeighborStat.h | 1 + .../src/continuator/moNbInfNeighborStat.h | 3 +-- .../src/continuator/moNbSupNeighborStat.h | 5 ++--- .../src/continuator/moNeighborBestStat.h | 1 + 25 files changed, 66 insertions(+), 61 deletions(-) diff --git a/trunk/paradiseo-mo/src/algo/moDummyLS.h b/trunk/paradiseo-mo/src/algo/moDummyLS.h index 09846110b..4d45f79f2 100644 --- a/trunk/paradiseo-mo/src/algo/moDummyLS.h +++ b/trunk/paradiseo-mo/src/algo/moDummyLS.h @@ -34,11 +34,11 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * Dummy Local Search: * * To do nothing, only the full evaluation of the solution if necessary ;-) - ********************************************************/ +*/ template class moDummyLS: public moLocalSearch { diff --git a/trunk/paradiseo-mo/src/algo/moFirstImprHC.h b/trunk/paradiseo-mo/src/algo/moFirstImprHC.h index a4e51a5d3..d41a82ebb 100644 --- a/trunk/paradiseo-mo/src/algo/moFirstImprHC.h +++ b/trunk/paradiseo-mo/src/algo/moFirstImprHC.h @@ -36,7 +36,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * First improvement HC: * Hill-Climber local search * @@ -45,7 +45,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr * 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 moFirstImprHC: public moLocalSearch { @@ -54,7 +54,7 @@ public: typedef moNeighborhood Neighborhood ; /** - * Simple constructor for a hill-climber + * Basic constructor for a hill-climber * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function @@ -77,7 +77,7 @@ public: {} /** - * Simple constructor for a hill-climber + * General constructor for a hill-climber * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function diff --git a/trunk/paradiseo-mo/src/algo/moLocalSearch.h b/trunk/paradiseo-mo/src/algo/moLocalSearch.h index c74cf6943..16c7199d2 100644 --- a/trunk/paradiseo-mo/src/algo/moLocalSearch.h +++ b/trunk/paradiseo-mo/src/algo/moLocalSearch.h @@ -53,7 +53,10 @@ public: typedef typename Neighbor::EOT EOT ; /** - * Constructor of a moLocalSearch needs a NeighborhooExplorer and a Continuator + * 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 & _cont, eoEvalFunc& _fullEval) : searchExplorer(_searchExpl), cont(&_cont), fullEval(_fullEval) { } ; @@ -99,8 +102,8 @@ public: }; /** - * external continuator object - * @return the external continuator + * Set an external continuator + * @param _cont the external continuator */ void setContinuator(moContinuator & _cont) { cont = &_cont ; diff --git a/trunk/paradiseo-mo/src/algo/moMetropolisHasting.h b/trunk/paradiseo-mo/src/algo/moMetropolisHasting.h index 5309a69b9..94278627f 100644 --- a/trunk/paradiseo-mo/src/algo/moMetropolisHasting.h +++ b/trunk/paradiseo-mo/src/algo/moMetropolisHasting.h @@ -36,7 +36,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * Metropolis-Hasting local search * Only the symetric case is considered when Q(x,y) = Q(y,x) * Fitness must be > 0 @@ -48,7 +48,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr * 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 moMetropolisHasting: public moLocalSearch { @@ -57,7 +57,7 @@ public: typedef moNeighborhood Neighborhood ; /** - * Simple constructor of the Metropolis-Hasting + * Basic constructor of the Metropolis-Hasting * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function @@ -82,7 +82,7 @@ public: {} /** - * Simple constructor of the Metropolis-Hasting + * General constructor of the Metropolis-Hasting * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function diff --git a/trunk/paradiseo-mo/src/algo/moNeutralHC.h b/trunk/paradiseo-mo/src/algo/moNeutralHC.h index 134cba5e3..24673e5aa 100644 --- a/trunk/paradiseo-mo/src/algo/moNeutralHC.h +++ b/trunk/paradiseo-mo/src/algo/moNeutralHC.h @@ -36,7 +36,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * Hill-Climber local search * * At each iteration, @@ -44,7 +44,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr * 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 moNeutralHC: public moLocalSearch { @@ -53,7 +53,7 @@ public: typedef moNeighborhood Neighborhood ; /** - * Simple constructor for a hill-climber + * Basic constructor for a hill-climber * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function @@ -78,7 +78,7 @@ public: {} /** - * Simple constructor for a hill-climber + * General constructor for a hill-climber * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function diff --git a/trunk/paradiseo-mo/src/algo/moRandomBestHC.h b/trunk/paradiseo-mo/src/algo/moRandomBestHC.h index 14fb1f0e2..3ed82c985 100644 --- a/trunk/paradiseo-mo/src/algo/moRandomBestHC.h +++ b/trunk/paradiseo-mo/src/algo/moRandomBestHC.h @@ -36,7 +36,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * Random Best HC: * Hill-Climber local search * @@ -45,7 +45,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr * 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 moRandomBestHC: public moLocalSearch { @@ -54,7 +54,7 @@ public: typedef moNeighborhood Neighborhood ; /** - * Simple constructor for a hill-climber + * Basic constructor for a hill-climber * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function @@ -77,7 +77,7 @@ public: {} /** - * Simple constructor for a hill-climber + * General constructor for a hill-climber * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function diff --git a/trunk/paradiseo-mo/src/algo/moRandomNeutralWalk.h b/trunk/paradiseo-mo/src/algo/moRandomNeutralWalk.h index 308f8d925..bb3eae6eb 100644 --- a/trunk/paradiseo-mo/src/algo/moRandomNeutralWalk.h +++ b/trunk/paradiseo-mo/src/algo/moRandomNeutralWalk.h @@ -36,14 +36,14 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * 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 moRandomNeutralWalk: public moLocalSearch { @@ -52,7 +52,7 @@ public: typedef moNeighborhood Neighborhood ; /** - * Simple constructor for a random walk + * Basic constructor for a random walk * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function @@ -77,7 +77,7 @@ public: {} /** - * Simple constructor for a random walk + * General constructor for a random walk * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function diff --git a/trunk/paradiseo-mo/src/algo/moRandomSearch.h b/trunk/paradiseo-mo/src/algo/moRandomSearch.h index 53e7b0730..849797751 100644 --- a/trunk/paradiseo-mo/src/algo/moRandomSearch.h +++ b/trunk/paradiseo-mo/src/algo/moRandomSearch.h @@ -36,14 +36,14 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * Random Search: * Pure random search local search * * At each iteration, * one random solution is selected and replace the current solution * the algorithm stops when the number of solution is reached - ********************************************************/ + */ template class moRandomSearch: public moLocalSearch { @@ -62,10 +62,11 @@ public: {} /** - * Simple constructor for a random search + * General constructor for a random search * @param _init the solution initializer, to explore at random the search space * @param _fullEval the full evaluation function * @param _nbSolMax number of solutions + * @param _cont external continuator */ moRandomSearch(eoInit & _init, eoEvalFunc& _fullEval, unsigned _nbSolMax, moContinuator& _cont): moLocalSearch(explorer, _cont, _fullEval), diff --git a/trunk/paradiseo-mo/src/algo/moRandomWalk.h b/trunk/paradiseo-mo/src/algo/moRandomWalk.h index e1b93c699..ade72ac02 100644 --- a/trunk/paradiseo-mo/src/algo/moRandomWalk.h +++ b/trunk/paradiseo-mo/src/algo/moRandomWalk.h @@ -36,14 +36,14 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * Random Walk: * Random walk local search * * At each iteration, * one random neighbor is selected and replace the current solution * the algorithm stops when the number of steps is reached - ********************************************************/ + */ template class moRandomWalk: public moLocalSearch { @@ -64,7 +64,7 @@ public: {} /** - * Simple constructor for a random walk + * General constructor for a random walk * @param _neighborhood the neighborhood * @param _fullEval the full evaluation function * @param _eval neighbor's evaluation function diff --git a/trunk/paradiseo-mo/src/algo/moSA.h b/trunk/paradiseo-mo/src/algo/moSA.h index f05232ed7..9193361a4 100644 --- a/trunk/paradiseo-mo/src/algo/moSA.h +++ b/trunk/paradiseo-mo/src/algo/moSA.h @@ -38,6 +38,9 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include +/** + * Simulated Annealing + */ template class moSA: public moLocalSearch { diff --git a/trunk/paradiseo-mo/src/algo/moSimpleHC.h b/trunk/paradiseo-mo/src/algo/moSimpleHC.h index 5e1feae57..6eee394b1 100644 --- a/trunk/paradiseo-mo/src/algo/moSimpleHC.h +++ b/trunk/paradiseo-mo/src/algo/moSimpleHC.h @@ -36,7 +36,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include -/******************************************************** +/** * Simple HC: * Hill-Climber local search * @@ -45,7 +45,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr * 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 moSimpleHC: public moLocalSearch { diff --git a/trunk/paradiseo-mo/src/algo/moTS.h b/trunk/paradiseo-mo/src/algo/moTS.h index 6d78dfe4d..389ae6b6f 100644 --- a/trunk/paradiseo-mo/src/algo/moTS.h +++ b/trunk/paradiseo-mo/src/algo/moTS.h @@ -43,6 +43,9 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include +/** + * Tabu Search + */ template class moTS: public moLocalSearch { diff --git a/trunk/paradiseo-mo/src/comparator/moComparator.h b/trunk/paradiseo-mo/src/comparator/moComparator.h index ad040d2ff..09cd9aeba 100644 --- a/trunk/paradiseo-mo/src/comparator/moComparator.h +++ b/trunk/paradiseo-mo/src/comparator/moComparator.h @@ -38,18 +38,6 @@ #include #include -// moComparator => comparer deux solutions -// idée : -// - eoComparator -// - moComparator qui hérite de eoComparator ? -// - moeoComparator qui hérite de eoComparator -// idée J : -// - eoComparator : eoBF -// - eoSolComparator : eoComparator ? -// - moNeighborCompartor : : eoComparator -// -// une instantiation possible !! - /** * Comparator of two types @@ -58,7 +46,13 @@ template< class T1, class T2 > class moComparator : public eoBF { public: - virtual bool equals(const T1&, const T2&) = 0; + + /** + * @param _ref1 a reference on a variable of type T1 + * @param _ref2 a reference on a variable of type T2 + * @return true if _ref1 and _ref2 are equals + */ + virtual bool equals(const T1& _ref1, const T2& _ref2) = 0; }; diff --git a/trunk/paradiseo-mo/src/continuator/moAverageFitnessNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moAverageFitnessNeighborStat.h index c3de8e6f3..2e678ecd4 100644 --- a/trunk/paradiseo-mo/src/continuator/moAverageFitnessNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moAverageFitnessNeighborStat.h @@ -39,7 +39,7 @@ #include /** - * From moNeighborhoodStat, to compute the average and the standard deviation of fitness in the neighborhood + * From moNeighborhoodStat, to compute the average of fitness in the neighborhood */ template< class Neighbor > class moAverageFitnessNeighborStat : public moStat diff --git a/trunk/paradiseo-mo/src/continuator/moCombinedContinuator.h b/trunk/paradiseo-mo/src/continuator/moCombinedContinuator.h index cd25cda48..7001a0e66 100644 --- a/trunk/paradiseo-mo/src/continuator/moCombinedContinuator.h +++ b/trunk/paradiseo-mo/src/continuator/moCombinedContinuator.h @@ -33,6 +33,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include #include + /** * Combined several continuators * Continue until one of the continuators is false diff --git a/trunk/paradiseo-mo/src/continuator/moCounterMonitorSaver.h b/trunk/paradiseo-mo/src/continuator/moCounterMonitorSaver.h index b6434969b..70e2a1c90 100644 --- a/trunk/paradiseo-mo/src/continuator/moCounterMonitorSaver.h +++ b/trunk/paradiseo-mo/src/continuator/moCounterMonitorSaver.h @@ -39,9 +39,7 @@ #include /** - * The actual class that will be used as base for all statistics - * that need to be calculated over the solution - * It is a moStatBase AND an eoValueParam so it can be used in Monitors. + * Class calling monitors with a given frequency */ class moCounterMonitorSaver : public eoUpdater { public : diff --git a/trunk/paradiseo-mo/src/continuator/moFitContinuator.h b/trunk/paradiseo-mo/src/continuator/moFitContinuator.h index eca43f8f9..05787bcf8 100644 --- a/trunk/paradiseo-mo/src/continuator/moFitContinuator.h +++ b/trunk/paradiseo-mo/src/continuator/moFitContinuator.h @@ -32,6 +32,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include + /** * Continue until a maximum fitness is reached */ diff --git a/trunk/paradiseo-mo/src/continuator/moFitnessStat.h b/trunk/paradiseo-mo/src/continuator/moFitnessStat.h index 6d8227d02..3aa0ec8f1 100644 --- a/trunk/paradiseo-mo/src/continuator/moFitnessStat.h +++ b/trunk/paradiseo-mo/src/continuator/moFitnessStat.h @@ -38,10 +38,8 @@ #include /** - * The actual class that will be used as base for all statistics - * that need to be calculated over the solution - * It is a moStatBase AND an eoValueParam so it can be used in Monitors. -*/ + * Stat given the fitness of the current solution + */ template class moFitnessStat : public moStat { diff --git a/trunk/paradiseo-mo/src/continuator/moFullEvalContinuator.h b/trunk/paradiseo-mo/src/continuator/moFullEvalContinuator.h index 6a9951d68..bf063833d 100644 --- a/trunk/paradiseo-mo/src/continuator/moFullEvalContinuator.h +++ b/trunk/paradiseo-mo/src/continuator/moFullEvalContinuator.h @@ -57,8 +57,8 @@ public: /** * Test if continue - *@param _solution a solution - *@return true if number of evaluations < maxFullEval + * @param _solution a solution + * @return true if number of evaluations < maxFullEval */ virtual bool operator()(EOT & _solution) { return (eval.value() - nbEval_start < maxFullEval); diff --git a/trunk/paradiseo-mo/src/continuator/moIterContinuator.h b/trunk/paradiseo-mo/src/continuator/moIterContinuator.h index 7eb90ec78..1d222c843 100644 --- a/trunk/paradiseo-mo/src/continuator/moIterContinuator.h +++ b/trunk/paradiseo-mo/src/continuator/moIterContinuator.h @@ -32,6 +32,7 @@ Contact: paradiseo-help@lists.gforge.inria.fr #include #include + /** * Continue until a maximum fixed number of iterations is reached */ @@ -43,6 +44,7 @@ public: /** * @param _maxIter number maximum of iterations + * @param _verbose true/false : verbose mode on/off */ moIterContinuator(unsigned int _maxIter, bool _verbose=true): maxIter(_maxIter), verbose(_verbose){} diff --git a/trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h index b6e5b27bd..051b01f53 100644 --- a/trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moMaxNeighborStat.h @@ -38,6 +38,7 @@ #include #include #include + /** * From moNeighborhoodStat, to compute the max fitness in the neighborhood */ diff --git a/trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h index f91360714..538b521ad 100644 --- a/trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moMinNeighborStat.h @@ -38,6 +38,7 @@ #include #include #include + /** * From moNeighborhoodStat, to compute the min fitness in the neighborhood */ diff --git a/trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h index 9910bbd99..a1280369b 100644 --- a/trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moNbInfNeighborStat.h @@ -38,11 +38,10 @@ #include #include #include + /** - * * From moNeighborhoodStat, to compute the number of solutions in the neighborhood * with (strictly) lower fitness than the current solution - * */ template< class Neighbor > class moNbInfNeighborStat : public moStat diff --git a/trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h b/trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h index b5f62a0f1..db49fca06 100644 --- a/trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h +++ b/trunk/paradiseo-mo/src/continuator/moNbSupNeighborStat.h @@ -38,12 +38,11 @@ #include #include #include + /** - * * From moNeighborhoodStat, to compute the number of solutions in the neighborhood * with higher fitness than the current solution - * -*/ + */ template< class Neighbor > class moNbSupNeighborStat : public moStat { diff --git a/trunk/paradiseo-mo/src/continuator/moNeighborBestStat.h b/trunk/paradiseo-mo/src/continuator/moNeighborBestStat.h index 51bcfc54c..0b4a4ab96 100644 --- a/trunk/paradiseo-mo/src/continuator/moNeighborBestStat.h +++ b/trunk/paradiseo-mo/src/continuator/moNeighborBestStat.h @@ -77,6 +77,7 @@ public : * * @param _neighborhood a neighborhood * @param _eval an evaluation function + * @param _k number of neighbors visited (default all) */ moNeighborBestStat(Neighborhood& _neighborhood, moEval& _eval, unsigned _k = 0): moStat(Fitness(), "best"),