From 4b45aadd5d036827af202a04239175f718c2f491 Mon Sep 17 00:00:00 2001 From: liefooga Date: Tue, 6 Feb 2007 16:35:01 +0000 Subject: [PATCH] documentation modifications git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@178 331e1502-861f-0410-8da2-ba01fb791d7f --- branches/paradiseo-moeo-1.0/src/moeoArchive.h | 30 +++++++++---------- .../src/moeoArchiveUpdater.h | 2 +- .../paradiseo-moeo-1.0/src/moeoCombinedLS.h | 26 +++++++++------- .../paradiseo-moeo-1.0/src/moeoComparator.h | 21 +++++++------ .../src/moeoDiversityAssignment.h | 2 +- branches/paradiseo-moeo-1.0/src/moeoEA.h | 2 +- ...FastNonDominatedSortingFitnessAssignment.h | 10 +++---- .../src/moeoFitnessAssignment.h | 8 ++--- .../src/moeoGenerationalReplacement.h | 2 +- .../paradiseo-moeo-1.0/src/moeoHybridLS.h | 10 +++---- .../src/moeoObjectiveVectorComparator.h | 2 +- .../src/moeoObjectiveVectorTraits.h | 2 +- .../src/moeoRandomSelectOne.h | 2 +- .../paradiseo-moeo-1.0/src/moeoReplacement.h | 2 +- .../paradiseo-moeo-1.0/src/moeoSelectOne.h | 2 +- .../src/moeoSelectOneFromPopAndArch.h | 26 ++++++++-------- 16 files changed, 76 insertions(+), 73 deletions(-) diff --git a/branches/paradiseo-moeo-1.0/src/moeoArchive.h b/branches/paradiseo-moeo-1.0/src/moeoArchive.h index e4747bec2..56ae8177f 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoArchive.h +++ b/branches/paradiseo-moeo-1.0/src/moeoArchive.h @@ -14,19 +14,20 @@ #define MOEOARCHIVE_H_ #include +#include /** - * An archive is a secondary population that stores non-dominated solutions + * An archive is a secondary population that stores non-dominated solutions. */ template < class MOEOT > class moeoArchive : public eoPop < MOEOT > { public: - using std::vector< MOEOT > :: size; - using std::vector< MOEOT > :: operator[]; - using std::vector< MOEOT > :: back; - using std::vector< MOEOT > :: pop_back; + using std::vector < MOEOT > :: size; + using std::vector < MOEOT > :: operator[]; + using std::vector < MOEOT > :: back; + using std::vector < MOEOT > :: pop_back; /** @@ -57,9 +58,9 @@ public: */ bool dominates (const ObjectiveVector & _objectiveVector) const { - for (unsigned i = 0; i < size(); i++) + for (unsigned i = 0; i /** - * This class allows to update the archive at each generation with newly found non-dominated solutions + * This class allows to update the archive at each generation with newly found non-dominated solutions. */ template < class EOT > class moeoArchiveUpdater : public eoUpdater diff --git a/branches/paradiseo-moeo-1.0/src/moeoCombinedLS.h b/branches/paradiseo-moeo-1.0/src/moeoCombinedLS.h index a19b4fd5f..fc844ad06 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoCombinedLS.h +++ b/branches/paradiseo-moeo-1.0/src/moeoCombinedLS.h @@ -19,27 +19,30 @@ /** * This class allows to embed a set of local searches that are sequentially applied, - * and so working and updating the same archive of non-dominated solutions + * and so working and updating the same archive of non-dominated solutions. */ template < class MOEOT > -class moeoCombinedLS : public moeoLS < MOEOT > { +class moeoCombinedLS : public moeoLS < MOEOT > +{ public: /** * Ctor * @param _eval the full evaluator of a solution - * @param _first_ls the first multi-objective local search to add + * @param _first_mols the first multi-objective local search to add */ - moeoCombinedLS(moeoEvalFunc < MOEOT > & _eval, moeoLS < MOEOT > & _first_ls) : eval (_eval) { - combinedLS.push_back (& _first_ls); + moeoCombinedLS(moeoEvalFunc < MOEOT > & _eval, moeoLS < MOEOT > & _first_mols) : eval (_eval) + { + combinedLS.push_back (& _first_mols); } /** * Adds a new local search to combine - * @param _ls the multi-objective local search to add + * @param _mols the multi-objective local search to add */ - void add(moeoLS < MOEOT > & _ls) { - combinedMOLS.push_back(& _ls); + void add(moeoLS < MOEOT > & _mols) + { + combinedMOLS.push_back(& _mols); } /** @@ -48,10 +51,11 @@ public: * @param _eo the solution * @param _arch the archive of non-dominated solutions */ - void operator () (const MOEOT & _eo, moeoArchive < MOEOT > & _arch) { - eval(const_cast < MOEOT & > (_eo)); + void operator () (const MOEOT & _moeo, moeoArchive < MOEOT > & _arch) + { + eval(const_cast < MOEOT & > (_moeo)); for (unsigned i=0; i operator()(_eo, _arch); + combinedLS[i] -> operator()(_moeo, _arch); } diff --git a/branches/paradiseo-moeo-1.0/src/moeoComparator.h b/branches/paradiseo-moeo-1.0/src/moeoComparator.h index 76fb709f7..d8f21d62a 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoComparator.h +++ b/branches/paradiseo-moeo-1.0/src/moeoComparator.h @@ -10,14 +10,13 @@ */ //----------------------------------------------------------------------------- -#ifndef MOEOPOPSORTER_H_ -#define MOEOPOPSORTER_H_ +#ifndef MOEOCOMPARATOR_H_ +#define MOEOCOMPARATOR_H_ #include -#include /** - * Functor allowing to compare two solutions + * Functor allowing to compare two solutions. */ template < class MOEOT > class moeoComparator : public eoBF < const MOEOT &, const MOEOT &, const bool > @@ -25,7 +24,7 @@ class moeoComparator : public eoBF < const MOEOT &, const MOEOT &, const bool > /** - * Functor allowing to compare two solutions according to their first objective value, then their second, and so on + * Functor allowing to compare two solutions according to their first objective value, then their second, and so on. */ template < class MOEOT > class moeoObjectiveComparator : public moeoComparator < MOEOT > @@ -44,7 +43,7 @@ public: /** - * Functor allowing to compare two solutions according to their fitness values + * Functor allowing to compare two solutions according to their fitness values. */ template < class MOEOT > class moeoFitnessComparator : public moeoComparator < MOEOT > @@ -63,7 +62,7 @@ public: /** - * Functor allowing to compare two solutions according to their diversity values + * Functor allowing to compare two solutions according to their diversity values. */ template < class MOEOT > class moeoDiversityComparator : public moeoComparator < MOEOT > @@ -82,7 +81,7 @@ public: /** - * Functor allowing to compare two solutions according to their fitness values, then according to their diversity values + * Functor allowing to compare two solutions according to their fitness values, then according to their diversity values. */ template < class MOEOT > class moeoFitnessThenDiversityComparator : public moeoComparator < MOEOT > @@ -108,7 +107,7 @@ public: /** - * Functor allowing to compare two solutions according to their diversity values, then according to their fitness values + * Functor allowing to compare two solutions according to their diversity values, then according to their fitness values. */ template < class MOEOT > class moeoDiversityThenFitnessComparator : public moeoComparator < MOEOT > @@ -134,7 +133,7 @@ public: /** - * Functor allowing to compare two solutions according to Pareto dominance relation => USEFULL ??? + * Functor allowing to compare two solutions according to Pareto dominance relation. => USEFULL ??? * template < class MOEOT > class moeoParetoDominanceComparator : public moeoComparator < MOEOT > @@ -179,4 +178,4 @@ public: }; */ -#endif /*MOEOPOPSORTER_H_*/ +#endif /*MOEOCOMPARATOR_H_*/ diff --git a/branches/paradiseo-moeo-1.0/src/moeoDiversityAssignment.h b/branches/paradiseo-moeo-1.0/src/moeoDiversityAssignment.h index 157d8feb0..52914ca80 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoDiversityAssignment.h +++ b/branches/paradiseo-moeo-1.0/src/moeoDiversityAssignment.h @@ -17,7 +17,7 @@ #include /** - * Functor that sets the diversity values of a whole population + * Functor that sets the diversity values of a whole population. */ template < class MOEOT > class moeoDiversityAssignment : public eoUF < eoPop < MOEOT > &, void > diff --git a/branches/paradiseo-moeo-1.0/src/moeoEA.h b/branches/paradiseo-moeo-1.0/src/moeoEA.h index 273d4d741..901dba540 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoEA.h +++ b/branches/paradiseo-moeo-1.0/src/moeoEA.h @@ -16,7 +16,7 @@ #include /** - * Abstract class for multi-objective evolutionary algorithms + * Abstract class for multi-objective evolutionary algorithms. */ template < class MOEOT > class moeoEA : public eoAlgo < MOEOT > {}; diff --git a/branches/paradiseo-moeo-1.0/src/moeoFastNonDominatedSortingFitnessAssignment.h b/branches/paradiseo-moeo-1.0/src/moeoFastNonDominatedSortingFitnessAssignment.h index 5e4585489..ae5603bef 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoFastNonDominatedSortingFitnessAssignment.h +++ b/branches/paradiseo-moeo-1.0/src/moeoFastNonDominatedSortingFitnessAssignment.h @@ -14,15 +14,15 @@ #define MOEOFASTNONDOMINATEDSORTINGFITNESSASSIGNMENT_H_ #include -#include #include +#include #include /** - * Fitness assignment sheme based on Pareto-dominance count proposed in - * N. Srinivas, K. Deb, "Multiobjective Optimization Using Nondominated Sorting in Genetic Algorithms", Evolutionary Computation vol. 2, no. 3, pp. 221-248 (1994) - * and in - * K. Deb, A. Pratap, S. Agarwal, T. Meyarivan, "A Fast and Elitist Multi-Objective Genetic Algorithm: NSGA-II", IEEE Transactions on Evolutionary Computation, vol. 6, no. 2 (2002). + * Fitness assignment sheme based on Pareto-dominance count proposed in: + * *N. Srinivas, K. Deb, "Multiobjective Optimization Using Nondominated Sorting in Genetic Algorithms", Evolutionary Computation vol. 2, no. 3, pp. 221-248 (1994)* + * and in: + * *K. Deb, A. Pratap, S. Agarwal, T. Meyarivan, "A Fast and Elitist Multi-Objective Genetic Algorithm: NSGA-II", IEEE Transactions on Evolutionary Computation, vol. 6, no. 2 (2002)*. * This strategy is, for instance, used in NSGA and NSGA-II. */ template < class MOEOT > diff --git a/branches/paradiseo-moeo-1.0/src/moeoFitnessAssignment.h b/branches/paradiseo-moeo-1.0/src/moeoFitnessAssignment.h index 99309276b..5c4e5c68b 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoFitnessAssignment.h +++ b/branches/paradiseo-moeo-1.0/src/moeoFitnessAssignment.h @@ -17,7 +17,7 @@ #include /** - * Functor that sets the fitness values of a whole population + * Functor that sets the fitness values of a whole population. */ template < class MOEOT > class moeoFitnessAssignment : public eoUF < eoPop < MOEOT > &, void > @@ -25,7 +25,7 @@ class moeoFitnessAssignment : public eoUF < eoPop < MOEOT > &, void > /** - * moeoScalarFitnessAssignment is a moeoFitnessAssignment for scalar strategies + * moeoScalarFitnessAssignment is a moeoFitnessAssignment for scalar strategies. */ template < class MOEOT > class moeoScalarFitnessAssignment : public moeoFitnessAssignment < MOEOT > @@ -33,7 +33,7 @@ class moeoScalarFitnessAssignment : public moeoFitnessAssignment < MOEOT > /** - * moeoCriterionBasedFitnessAssignment is a moeoFitnessAssignment for criterion-based strategies + * moeoCriterionBasedFitnessAssignment is a moeoFitnessAssignment for criterion-based strategies. */ template < class MOEOT > class moeoCriterionBasedFitnessAssignment : public moeoFitnessAssignment < MOEOT > @@ -41,7 +41,7 @@ class moeoCriterionBasedFitnessAssignment : public moeoFitnessAssignment < MOEOT /** - * moeoParetoBasedFitnessAssignment is a moeoFitnessAssignment for Pareto-based strategies + * moeoParetoBasedFitnessAssignment is a moeoFitnessAssignment for Pareto-based strategies. */ template < class MOEOT > class moeoParetoBasedFitnessAssignment : public moeoFitnessAssignment < MOEOT > diff --git a/branches/paradiseo-moeo-1.0/src/moeoGenerationalReplacement.h b/branches/paradiseo-moeo-1.0/src/moeoGenerationalReplacement.h index dc1a2e1d5..99e7b9024 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoGenerationalReplacement.h +++ b/branches/paradiseo-moeo-1.0/src/moeoGenerationalReplacement.h @@ -17,7 +17,7 @@ #include /** - * Generational replacement: only the new individuals are preserved + * Generational replacement: only the new individuals are preserved. */ template < class MOEOT > class moeoGenerationalReplacement : public moeoReplacement < MOEOT >, public eoGenerationalReplacement < MOEOT > {}; diff --git a/branches/paradiseo-moeo-1.0/src/moeoHybridLS.h b/branches/paradiseo-moeo-1.0/src/moeoHybridLS.h index f9ed01d36..c28fc3a8c 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoHybridLS.h +++ b/branches/paradiseo-moeo-1.0/src/moeoHybridLS.h @@ -33,10 +33,10 @@ public: * Ctor * @param _term stopping criteria * @param _select selector - * @param _ls a multi-objective local search + * @param _mols a multi-objective local search * @param _arch the archive */ - eoHybridLS (eoContinue < MOEOT > & _term, eoSelect < MOEOT > & _select, moeoLS < MOEOT > & _ls, moeoArchive < MOEOT > & _arch) : term(_term), select(_select), ls(_ls), arch(_arch) + eoHybridLS (eoContinue < MOEOT > & _term, eoSelect < MOEOT > & _select, moeoLS < MOEOT > & _mols, moeoArchive < MOEOT > & _arch) : term(_term), select(_select), mols(_mols), arch(_arch) {} /** @@ -50,9 +50,9 @@ public: eoPop < MOEOT > selectedSolutions; select(arch, selectedSolutions); // apply the local search to every selected solution - for (unsigned i=0; i & select; /** multi-objective local search */ - moeoLS < MOEOT > & ls; + moeoLS < MOEOT > & mols; /** archive */ moeoArchive < MOEOT > & arch; diff --git a/branches/paradiseo-moeo-1.0/src/moeoObjectiveVectorComparator.h b/branches/paradiseo-moeo-1.0/src/moeoObjectiveVectorComparator.h index aa9144f4d..5bdceb439 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoObjectiveVectorComparator.h +++ b/branches/paradiseo-moeo-1.0/src/moeoObjectiveVectorComparator.h @@ -26,7 +26,7 @@ class moeoObjectiveVectorComparator : public eoBF < const ObjectiveVector &, con /** - * This functor class allows to compare 2 objective vectors according to Pareto dominance + * This functor class allows to compare 2 objective vectors according to Pareto dominance. */ template < class ObjectiveVector > class moeoParetoObjectiveVectorComparator : public moeoObjectiveVectorComparator < ObjectiveVector > diff --git a/branches/paradiseo-moeo-1.0/src/moeoObjectiveVectorTraits.h b/branches/paradiseo-moeo-1.0/src/moeoObjectiveVectorTraits.h index f47e01fe4..a379e8eff 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoObjectiveVectorTraits.h +++ b/branches/paradiseo-moeo-1.0/src/moeoObjectiveVectorTraits.h @@ -18,7 +18,7 @@ #include /** - * A traits class for moeoObjectiveVector to specify the number of objectives and which ones have to be minimized or maximized + * A traits class for moeoObjectiveVector to specify the number of objectives and which ones have to be minimized or maximized. */ class moeoObjectiveVectorTraits { diff --git a/branches/paradiseo-moeo-1.0/src/moeoRandomSelectOne.h b/branches/paradiseo-moeo-1.0/src/moeoRandomSelectOne.h index 817a33b27..e7e636300 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoRandomSelectOne.h +++ b/branches/paradiseo-moeo-1.0/src/moeoRandomSelectOne.h @@ -17,7 +17,7 @@ #include /** - * Selection strategy that selects only one element randomly from a whole population + * Selection strategy that selects only one element randomly from a whole population. */ template < class MOEOT > class moeoRandomSelectOne : public moeoSelectOne < MOEOT >, public eoRandomSelect < MOEOT > {}; diff --git a/branches/paradiseo-moeo-1.0/src/moeoReplacement.h b/branches/paradiseo-moeo-1.0/src/moeoReplacement.h index 26efa7a27..aa0631754 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoReplacement.h +++ b/branches/paradiseo-moeo-1.0/src/moeoReplacement.h @@ -16,7 +16,7 @@ #include /** - * Replacement strategy for multi-objective optimization + * Replacement strategy for multi-objective optimization. */ template < class MOEOT > class moeoReplacement : public eoReplacement < MOEOT > {}; diff --git a/branches/paradiseo-moeo-1.0/src/moeoSelectOne.h b/branches/paradiseo-moeo-1.0/src/moeoSelectOne.h index 1f1f5689e..7f4129b99 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoSelectOne.h +++ b/branches/paradiseo-moeo-1.0/src/moeoSelectOne.h @@ -16,7 +16,7 @@ #include /** - * Selection strategy for multi-objective optimization that selects only one element from a whole population + * Selection strategy for multi-objective optimization that selects only one element from a whole population. */ template < class MOEOT > class moeoSelectOne : public eoSelectOne < MOEOT > {}; diff --git a/branches/paradiseo-moeo-1.0/src/moeoSelectOneFromPopAndArch.h b/branches/paradiseo-moeo-1.0/src/moeoSelectOneFromPopAndArch.h index 910c4b44d..aac1b0641 100644 --- a/branches/paradiseo-moeo-1.0/src/moeoSelectOneFromPopAndArch.h +++ b/branches/paradiseo-moeo-1.0/src/moeoSelectOneFromPopAndArch.h @@ -22,8 +22,8 @@ /** * Elitist selection process that consists in choosing individuals in the archive as well as in the current population. */ -template -class moeoSelectOneFromPopAndArch : public moeoSelectOne +template < class MOEOT > +class moeoSelectOneFromPopAndArch : public moeoSelectOne < MOEOT > { public: @@ -34,24 +34,25 @@ public: * @param _arch the archive * @param _ratioFromPop the ratio of selected individuals from the population */ - moeoSelectOneFromPopAndArch (moeoSelectOne & _popSelectOne, moeoSelectOne _archSelectOne, moeoArchive & _arch, double _ratioFromPop=0.5) + moeoSelectOneFromPopAndArch (moeoSelectOne < MOEOT > & _popSelectOne, moeoSelectOne < MOEOT > _archSelectOne, moeoArchive < MOEOT > & _arch, double _ratioFromPop=0.5) : popSelectOne(_popSelectOne), archSelectOne(_archSelectOne), arch(_arch), ratioFromPop(_ratioFromPop) {} /** - * Ctor - the archive's selection operator is a random selector + * Defaulr ctor - the archive's selection operator is a random selector * @param _popSelectOne the population's selection operator * @param _arch the archive * @param _ratioFromPop the ratio of selected individuals from the population */ - moeoSelectOneFromPopAndArch (moeoSelectOne & _popSelectOne, moeoArchive & _arch, double _ratioFromPop=0.5) + moeoSelectOneFromPopAndArch (moeoSelectOne < MOEOT > & _popSelectOne, moeoArchive < MOEOT > & _arch, double _ratioFromPop=0.5) : popSelectOne(_popSelectOne), archSelectOne(randomSelectOne), arch(_arch), ratioFromPop(_ratioFromPop) {} /** * The selection process */ - virtual const EOT & operator () (const eoPop & pop) { + virtual const MOEOT & operator () (const eoPop < MOEOT > & pop) + { if (arch.size() > 0) if (rng.flip(ratioFromPop)) return popSelectOne(pop); @@ -64,7 +65,8 @@ public: /** * Setups some population stats */ - virtual void setup (const eoPop & _pop) { + virtual void setup (const eoPop < MOEOT > & _pop) + { popSelectOne.setup(_pop); } @@ -72,15 +74,15 @@ public: private: /** The population's selection operator */ - moeoSelectOne & popSelectOne; + moeoSelectOne < MOEOT > & popSelectOne; /** The archive's selection operator */ - moeoSelectOne & archSelectOne; + moeoSelectOne < MOEOT > & archSelectOne; /** The archive */ - moeoArchive & arch; + moeoArchive < MOEOT > & arch; /** The ratio of selected individuals from the population*/ double ratioFromPop; - /** A random selection operator */ - moeoRandomSelectOne randomSelectOne; + /** A random selection operator (used as default for archSelectOne) */ + moeoRandomSelectOne< MOEOT > randomSelectOne; };