grouping classes in documentation

This commit is contained in:
Johann Dreo 2010-11-05 15:59:35 +01:00
commit f478817c6e
73 changed files with 326 additions and 164 deletions

View file

@ -33,6 +33,8 @@
/** eoInt: implementation of simple integer-valued chromosome.
* based on eoVector class
*
* @ingroup Representations
*/
template <class FitT> class eoInt: public eoVector<FitT, int>
{

View file

@ -40,6 +40,8 @@
* At step t: v(t+1)= c1 * v(t) + c2 * r2 * ( xbest(t)-x(t) ) + c3 * r3 * ( gbest(t) - x(t) )
* v(t) is an INT for any time step
* (ci given and Ri chosen at random in [0;1]).
*
* @ingroup Variators
*/
template < class POT > class eoIntegerVelocity:public eoVelocity < POT >
{

View file

@ -29,6 +29,8 @@
#include <eoOp.h>
/** @addtogroup Utilities
/**
One of the invalidator operators. Use this one as a 'hat' on an operator
that is defined to work on a generic datatype. This functor will then check

View file

@ -37,6 +37,8 @@
* Nt is the total number of generations/event
* w(0) is the initial weight
* w(Nt) is the last inertia weight
*
* @ingroup Variators
*/
template <class WeightType, class StopCriteriaType> class eoLinearDecreasingWeightUp:public eoWeightUpdater<WeightType>
{

View file

@ -38,6 +38,8 @@
* truncate negative values to 0 -
*
* to be used within an eoSelectFromWorth object
*
* @ingroup Selectors
*/
template <class EOT>
class eoLinearFitScaling : public eoPerf2Worth<EOT> // false: do not cache fitness

View file

@ -37,6 +37,8 @@
* One of the local best strategies for particle swarm optimization. Each particle has a fixed number of neighbours, ans
* the neighborhood is social.
* The topology is never modified during the flight.
*
* @ingroup Selectors
*/
template < class POT > class eoLinearTopology:public eoTopology <
POT >

View file

@ -44,6 +44,7 @@ eoMGGReplacement is an eoReplacement:
- select best N-1 of this merged population (detTournament only at the moment)
- put them back into parent population
@ingroup Replacors
*/
template <class EOT>

View file

@ -43,6 +43,9 @@
* two populations into one (the second argument).
* Note that the algorithms assume that the second argument denotes the
* next generation.
*
* @ingroup Core
* @ingroup Replacors
*/
template<class Chrom> class eoMerge: public eoBF<const eoPop<Chrom>&, eoPop<Chrom>&, void>
@ -51,6 +54,8 @@ template<class Chrom> class eoMerge: public eoBF<const eoPop<Chrom>&, eoPop<Chro
/**
Straightforward elitism class, specify the number of individuals to copy
into new geneneration or the rate w.r.t. pop size
@ingroup Replacors
*/
template <class EOT> class eoElitism : public eoMerge<EOT>
{
@ -103,6 +108,7 @@ private :
/**
No elite
@ingroup Replacors
*/
template <class EOT> class eoNoElitism : public eoElitism<EOT>
{
@ -112,6 +118,7 @@ template <class EOT> class eoNoElitism : public eoElitism<EOT>
/**
Very elitist class, copies entire population into next gen
@ingroup Replacors
*/
template <class EOT> class eoPlus : public eoMerge<EOT>
{

View file

@ -45,6 +45,7 @@ Replacement strategies that combine en eoMerge and an eoReduce.
/**
eoMergeReduce: abstract replacement strategy that is just an application of
an embedded merge, followed by an embedded reduce
@ingroup Replacors
*/
template <class EOT>
class eoMergeReduce : public eoReplacement<EOT>
@ -68,6 +69,7 @@ class eoMergeReduce : public eoReplacement<EOT>
/**
ES type of replacement strategy: first add parents to population, then truncate
@ingroup Replacors
*/
template <class EOT>
class eoPlusReplacement : public eoMergeReduce<EOT>
@ -82,6 +84,7 @@ class eoPlusReplacement : public eoMergeReduce<EOT>
/**
ES type of replacement strategy: ignore parents, truncate offspring
@ingroup Replacors
*/
template <class EOT>
class eoCommaReplacement : public eoMergeReduce<EOT>
@ -97,6 +100,7 @@ class eoCommaReplacement : public eoMergeReduce<EOT>
/**
EP type of replacement strategy: first add parents to population,
then truncate using EP tournament
@ingroup Replacors
*/
template <class EOT>
class eoEPReplacement : public eoMergeReduce<EOT>

View file

@ -29,6 +29,8 @@
/**
* Abstract class for neighborboods. Used for particle swarm optimization
* topology strategies. Can be social or physical.
*
* @ingroup Selectors
*/
template < class POT > class eoNeighborhood
{

View file

@ -38,15 +38,15 @@
#include <eoPopulator.h>
#include <utils/eoHowMany.h>
/*****************************************************************************
* eoOneToOneBreeder: transforms a population using
/** eoOneToOneBreeder: transforms a population using
* - an operator that MODIFIES only one parent from the populator
* (though it can use any number aside) and thus generates ONE offspring)
* - a local replacement between the parent and its offspring
*
* Typically, Differential Evolution (Storn and Price 94) and Deb et al's
* G3 can be built on this
****************************************************************************
*
* @ingroup Combination
*/
template<class EOT>
class eoOneToOneBreeder: public eoBreed<EOT>

View file

@ -29,6 +29,7 @@
#include <eoPrintable.h>
#include <eoFunctor.h>
#include <utils/eoRNG.h>
/**
@defgroup Operators Evolutionary Operators

View file

@ -37,6 +37,8 @@
* the differnet instances of eoOpContainer:
* an ***absolute*** probability in the sequential version, and
* a ***relative*** weight in the proportional version
*
* @ingroup Combination
*/
template <class EOT>
class eoOpContainer : public eoGenOp<EOT>
@ -83,6 +85,8 @@ class eoOpContainer : public eoGenOp<EOT>
* note the mark, rewind, unmark cycle
* here operators are repeatedly applied on the same individual(s)
* not all too elegant, but it sort of works...
*
* @ingroup Combination
*/
template <class EOT>
class eoSequentialOp : public eoOpContainer<EOT>

View file

@ -20,21 +20,20 @@
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
*/
//-----------------------------------------------------------------------------
#ifndef _EOOPSELMASON_H
#define _EOOPSELMASON_H
//-----------------------------------------------------------------------------
#include <eoProportionalOpSel.h>
#include <eoOpFactory.h> // for eoFactory and eoOpFactory
#include <map>
//-----------------------------------------------------------------------------
/** EO Mason, or builder, for operator selectors. A builder must allocate memory
to the objects it builds, and then deallocate it when it gets out of scope*/
to the objects it builds, and then deallocate it when it gets out of scope
@ingroup Utilities
*/
template<class eoClass>
class eoOpSelMason: public eoFactory<eoOpSelector<eoClass> > {

View file

@ -20,6 +20,8 @@
* p1 : [1|2,4,3|6,5] and p2 : [4|5,3,1|6,2] generate two children:
* c1 = [2,4,3,6,5,1] 2,4,3 taken from p1 and 6,5,1 from p2
* c2 = [5,3,1,6,2,4] 5,3,1 taken from p2 and 6,2,4 from p1
*
* @ingroup Variators
*/
template<class Chrom> class eoOrderXover: public eoQuadOp<Chrom>
{

View file

@ -38,6 +38,9 @@
/** @brief Base class to transform raw fitnesses into fitness for selection
@see eoSelectFromWorth
@ingroup Selectors
@ingroup Utilities
*/
template <class EOT, class WorthT = double>
class eoPerf2Worth : public eoUF<const eoPop<EOT>&, void>, public eoValueParam<std::vector<WorthT> >
@ -106,6 +109,8 @@ public:
/**
Perf2Worth with fitness cache
@ingroup Selectors
@ingroup Utilities
*/
template <class EOT, class WorthT = typename EOT::Fitness>
class eoPerf2WorthCached : public eoPerf2Worth<EOT, WorthT>
@ -225,7 +230,10 @@ public:
/** A dummy perf2worth, just in case you need it */
/** A dummy perf2worth, just in case you need it
@ingroup Selectors
@ingroup Utilities
*/
template <class EOT>
class eoNoPerf2Worth : public eoPerf2Worth<EOT, typename EOT::Fitness>
{

View file

@ -1,7 +1,5 @@
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
// "eoFreqContinue.h"
// (c) OPAC Team, LIFL, Feb. 2006
/* This library is free software; you can redistribute it and/or
@ -27,16 +25,25 @@
#include <eoContinue.h>
#include <eoPop.h>
/** A continue that becomes true periodically.
*/
template <class EOT> class eoPeriodicContinue: public eoContinue <EOT> {
public:
/** Constructor. The period is given in parameter. */
eoPeriodicContinue (unsigned __period, unsigned __init_counter = 0);
eoPeriodicContinue (unsigned __period, unsigned __init_counter = 0) :
period (__period), counter (__init_counter)
{}
/** It returns 'true' only if the current number of generations modulo
the period doen't equal to zero. */
bool operator () (const eoPop <EOT> & pop);
bool operator () (const eoPop <EOT> & pop)
{
return ((++ counter) % period) != 0 ;
}
private:
@ -45,19 +52,5 @@ private:
unsigned counter;
};
template <class EOT>
eoPeriodicContinue <EOT> :: eoPeriodicContinue (unsigned __period, unsigned __init_counter
) : period (__period),
counter (__init_counter) {
}
template <class EOT>
bool eoPeriodicContinue <EOT> :: operator () (const eoPop <EOT> & __pop) {
return ((++ counter) % period) != 0 ;
}
#endif

View file

@ -7,7 +7,6 @@
//Implementation of these objects
//-----------------------------------------------------------------------------
std::istream & operator >> ( std::istream& _is, eoPersistent& _o ) {
_o.readFrom(_is);

View file

@ -48,8 +48,9 @@
* and eoInit derived object. in the ctor.
* EOT must also have a copy ctor, since temporaries are created and then
* passed to the eoInit object
*
* @ingroup Core
*/
template<class EOT>
class eoPop: public std::vector<EOT>, public eoObject, public eoPersistent
{
@ -333,9 +334,6 @@ public:
for (unsigned i=0; i<size(); i++)
this->operator[](i).invalidate();
}
protected:
};
#endif

View file

@ -44,6 +44,8 @@
*
* Basic parallelization (synchronous standard evolution engine):
* call the slaves and wait for the results
*
* @ingroup Evaluation
*/
template<class EOT>
class eoPopEvalFunc : public eoBF<eoPop<EOT> & , eoPop<EOT> &, void>
@ -55,6 +57,8 @@ class eoPopEvalFunc : public eoBF<eoPop<EOT> & , eoPop<EOT> &, void>
/** eoPopLoopEval: an instance of eoPopEvalFunc that simply applies
* a private eoEvalFunc to all offspring
*
* @ingroup Evaluation
*/
template<class EOT>
class eoPopLoopEval : public eoPopEvalFunc<EOT> {
@ -79,6 +83,8 @@ private:
/** eoPopLoopEval: an instance of eoPopEvalFunc that simply applies
* a private eoEvalFunc to all offspring AND ALL PARENTS
* as the fitness is supposed here to vary
*
* @ingroup Evaluation
*/
template<class EOT>
class eoTimeVaryingLoopEval : public eoPopEvalFunc<EOT> {

View file

@ -33,7 +33,11 @@
It is an eoPop but also behaves like an eoPop::iterator
as far as operator* and operator++ are concerned
See eoGenOp and eoOpContainer
@see eoGenOp
@see eoOpContainer
@ingroup Core
@ingroup Utilities
*/
template <class EOT>
class eoPopulator

View file

@ -33,11 +33,13 @@
// class eoSGAGenOp
///////////////////////////////////////////////////////////////////////////////
/** ***************************************************************************
/**
* eoPropGAGenOp (for Simple GA, but Proportional)
* choice between Crossover, mutation or cloining
* with respect to given relatve weights
*****************************************************************************/
*
* @ingroup Combination
*/
template<class EOT>
class eoPropGAGenOp : public eoGenOp<EOT>
{

View file

@ -33,15 +33,15 @@
#include <utils/selectors.h>
#include <eoSelectOne.h>
#include <eoPop.h>
//-----------------------------------------------------------------------------
/** eoProportionalSelect: select an individual proportional to her stored fitness
value
Changed the algorithm to make use of a cumulative array of fitness scores,
This changes the algorithm from O(n) per call to O(log n) per call. (MK)
*/
//-----------------------------------------------------------------------------
@ingroup Selectors
*/
template <class EOT> class eoProportionalSelect: public eoSelectOne<EOT>
{
public:

View file

@ -34,6 +34,8 @@
* Update an inertia weight by assigning it an (uniform) random value.
* The weight is a basic feature to evaluate the velocity of a particle in
* swarm optimization.
*
* @ingroup Variators
*/
class eoRandomRealWeightUp:public eoWeightUpdater<double>
{

View file

@ -22,12 +22,10 @@
Marc.Schoenauer@polytechnique.fr
mak@dhi.dk
*/
//-----------------------------------------------------------------------------
#ifndef eoRandomSelect_h
#define eoRandomSelect_h
//-----------------------------------------------------------------------------
/** This file contains straightforward selectors:
* eoRandomSelect returns an individual uniformly selected
* eoBestSelect always return the best individual
@ -37,10 +35,10 @@
#include <utils/eoRNG.h>
#include <eoSelectOne.h>
//-----------------------------------------------------------------------------
/** eoRandomSelect: a selection method that selects ONE individual randomly */
//-----------------------------------------------------------------------------
/** eoRandomSelect: a selection method that selects ONE individual randomly
*
* @ingroup Selectors
*/
template <class EOT> class eoRandomSelect: public eoSelectOne<EOT>
{
public:
@ -52,11 +50,11 @@ template <class EOT> class eoRandomSelect: public eoSelectOne<EOT>
}
};
//-----------------------------------------------------------------------------
/** eoBestSelect: a selection method that always return the best
* (mainly for testing purposes) */
//-----------------------------------------------------------------------------
* (mainly for testing purposes)
*
* @ingroup Selectors
*/
template <class EOT> class eoBestSelect: public eoSelectOne<EOT>
{
public:
@ -68,13 +66,11 @@ template <class EOT> class eoBestSelect: public eoSelectOne<EOT>
}
};
//-----------------------------------------------------------------------------
/** eoNoSelect: returns all individual in order WITHOUT USING FITNESS!!!
* looping back to the beginning when exhasuted
*
* @ingroup Selectors
*/
//-----------------------------------------------------------------------------
template <class EOT> class eoNoSelect: public eoSelectOne<EOT>
{
public:

View file

@ -33,6 +33,8 @@
* COmputes the ranked fitness: fitnesses range in [m,M]
* with m=2-pressure/popSize and M=pressure/popSize.
* in between, the progression depstd::ends on exponent (linear if 1).
*
* @ingroup Selectors
*/
template <class EOT>
class eoRanking : public eoPerf2Worth<EOT> // false: do not cache fitness

View file

@ -35,8 +35,9 @@
* is an eoRouletteWorthSelect, i.e. a selector using a std::vector of worthes
* rather than the raw fitness (see eoSelectFromWorth.h)
* uses an internal eoRanking object which is an eoPerf2Worth<EOT, double>
*
* @ingroup Selectors
*/
template <class EOT>
class eoRankingSelect: public eoRouletteWorthSelect<EOT, double>
{

View file

@ -20,25 +20,33 @@
Contact: thomas.legrand@lifl.fr
*/
//-----------------------------------------------------------------------------
#ifndef EOREALBOUNDMODIFIER_H
#define EOREALBOUNDMODIFIER_H
//-----------------------------------------------------------------------------
#include <eoFunctor.h>
#include <utils/eoRealVectorBounds.h>
//-----------------------------------------------------------------------------
/** @defgroup Bounds Bounds management
*
* Bounds are a set of utilities that permits to manage ranges of existence
* for variables. For example to restrain vectors or parameters to a given domain.
*
* @ingroup Utilities
*/
/**
* Abstract class for eoRealVectorBounds modifier.
* Used to modify the bounds included into the eoRealVectorBounds object.
*
* @ingroup Bounds
*/
class eoRealBoundModifier: public eoBF < eoRealBaseVectorBounds &,unsigned,void > {};
/**
* An eoRealBoundModifier that modify nothing !
* @ingroup Bounds
*/
class eoDummyRealBoundModifier: public eoRealBoundModifier
{

View file

@ -31,6 +31,8 @@
/** eoRealParticle: Implementation of a real-coded particle for
* particle swarm optimization. Positions, velocities and best positions are real-coded.
*
* @ingroup Real
*/
template < class FitT> class eoRealParticle: public eoVectorParticle<FitT,double,double>

View file

@ -40,12 +40,15 @@
At the moment, limited to truncation - with 2 different methods,
one that sorts the whole population, and one that repeatidely kills
the worst. Ideally, we should be able to choose at run-time!!!
*/
@ingroup Replacors
*/
template<class EOT> class eoReduce: public eoBF<eoPop<EOT>&, unsigned, void>
{};
/** truncation method using sort */
/** truncation method using sort
@ingroup Replacors
*/
template <class EOT> class eoTruncate : public eoReduce<EOT>
{
void operator()(eoPop<EOT>& _newgen, unsigned _newsize)
@ -60,7 +63,9 @@ template <class EOT> class eoTruncate : public eoReduce<EOT>
}
};
/** random truncation */
/** random truncation
@ingroup Replacors
* */
template <class EOT> class eoRandomReduce : public eoReduce<EOT>
{
void operator()(eoPop<EOT>& _newgen, unsigned _newsize)
@ -79,6 +84,7 @@ template <class EOT> class eoRandomReduce : public eoReduce<EOT>
/**
EP truncation method (some global stochastic tournament + sort)
Softer selective pressure than pure truncate
@ingroup Replacors
*/
template <class EOT> class eoEPReduce : public eoReduce<EOT>
{
@ -162,6 +168,7 @@ private:
/** a truncate class that does not sort, but repeatidely kills the worse.
To be used in SSGA-like replacements (e.g. see eoSSGAWorseReplacement)
@ingroup Replacors
*/
template <class EOT>
class eoLinearTruncate : public eoReduce<EOT>
@ -183,6 +190,7 @@ class eoLinearTruncate : public eoReduce<EOT>
/** a truncate class based on a repeated deterministic (reverse!) tournament
To be used in SSGA-like replacements (e.g. see eoSSGADetTournamentReplacement)
@ingroup Replacors
*/
template <class EOT>
class eoDetTournamentTruncate : public eoReduce<EOT>
@ -231,6 +239,7 @@ private:
/** a truncate class based on a repeated deterministic (reverse!) tournament
To be used in SSGA-like replacements (e.g. see eoSSGAStochTournamentReplacement)
@ingroup Replacors
*/
template <class EOT>
class eoStochTournamentTruncate : public eoReduce<EOT>

View file

@ -37,6 +37,9 @@
#include <utils/eoHowMany.h>
//-----------------------------------------------------------------------------
/** @addtogroup Replacors
* @{
*/
/**
eoReduceMerge: Replacement strategies that start by reducing the parents,
@ -116,4 +119,5 @@ class eoSSGAStochTournamentReplacement : public eoReduceMerge<EOT>
eoPlus<EOT> plus;
};
/** @} */
#endif

View file

@ -43,8 +43,8 @@ eoReduceMergeReduce is an eoReplacement:
- merges reduced populations
- reduces resulting merged pop if necessary
@ingroup Replacors
*/
template <class EOT>
class eoReduceMergeReduce : public eoReplacement<EOT>
{

View file

@ -35,6 +35,10 @@
#include <eoFunctor.h> // eoReduce
#include <utils/selectors.h>
/** @addtogroup Replacors
* @{
*/
/**
* eoReduceSplit: reduce the pop to the specified size
* AND eventually returns the eliminated guys
@ -320,4 +324,5 @@ private:
//-----------------------------------------------------------------------------
/** @} */
#endif

View file

@ -37,12 +37,6 @@
//-----------------------------------------------------------------------------
/**
eoReplacement: the base class for all replacement functors.
NOTE: 2 eoPop as arguments
the resulting population should be in the first argument (replace
parents by offspring)! The second argument can contain any rubbish
---
The eoMergeReduce, combination of eoMerge and eoReduce, can be found
in file eoMergeReduce.h
@ -69,16 +63,22 @@ MS 12/12/2000
*/
/** The base class for all replacement functors.
//@{
NOTE: two eoPop as arguments
the resulting population should be in the first argument (replace
parents by offspring)! The second argument can contain any rubbish
///
@ingroup Replacors
*/
template<class EOT>
class eoReplacement : public eoBF<eoPop<EOT>&, eoPop<EOT>&, void>
{};
/**
generational replacement == swap populations
@ingroup Replacors
*/
template <class EOT>
class eoGenerationalReplacement : public eoReplacement<EOT>
@ -97,6 +97,8 @@ Copies in the new pop the best individual from the old pop,
AFTER normal replacement, if the best of the new pop is worse than the best
of the old pop. Removes the worse individual from the new pop.
This could be changed by adding a selector there...
@ingroup Replacors
*/
template <class EOT>
class eoWeakElitistReplacement : public eoReplacement<EOT>
@ -123,6 +125,4 @@ private:
eoReplacement<EOT> & replace;
};
//@}
#endif

View file

@ -39,6 +39,8 @@
* The neighborhoods are built using a ring based on each particle's indice and
* do not change for all the time steps. Only the best particle in each neighborhood is
* potentially updated thanks to the "updateNeighborhood" method.
*
* @ingroup Selectors
*/
template < class POT > class eoRingTopology:public eoTopology <POT>
{

View file

@ -33,14 +33,16 @@
// class eoSGAGenOp
///////////////////////////////////////////////////////////////////////////////
/** ***************************************************************************
/**
* eoSGAGenOp (for Simple GA) mimicks the usual crossover with proba pCross +
* mutation with proba pMut inside an eoGeneralOp
* It does it exactly as class eoSGATransform, i.e. only accepts
* quadratic crossover and unary mutation
* It was introduced for didactic reasons, but seems to be popular :-)
*****************************************************************************/
template<class EOT>
*
* @ingroup Combination
*/
template<class EOT>
class eoSGAGenOp : public eoGenOp<EOT>
{
public:

View file

@ -41,6 +41,8 @@
* It does it exactly as class eoSGA, i.e. only accepts
* quadratic crossover and unary mutation
* It is here mainly for tutorial reasons
*
* @ingroup Combination
*/
template<class EOT> class eoSGATransform : public eoTransform<EOT>
{
@ -94,7 +96,9 @@ template<class EOT> class eoSGATransform : public eoTransform<EOT>
* i.e. the operators probabilities can be passed as an eoValueParam,
* and hence can be modified from outside
* It is here mainly for tutorial reasons
*****************************************************************************/
*
* @ingroup Combination
*/
template<class EOT> class eoDynSGATransform : public eoTransform<EOT>
{
public:

View file

@ -35,6 +35,10 @@
#include <signal.h>
#include <eoContinue.h>
/** @addtogroup Continuators
* @{
*/
extern bool existSIGContinue;
extern bool call_func;
@ -84,6 +88,7 @@ private:
sighandler_t _fct;
};
/** @} */
#endif

View file

@ -29,6 +29,10 @@
#include "eoFunctor.h"
/** @addtogroup Utilities
* @{
*/
/**
Generic set of classes that wrap an eoF, eoUF or eoBF so that they have the
copy semantics the STL functions usually require (i.e. they can be passed
@ -115,4 +119,6 @@ class eoSTLBF : public std::binary_function<A1, A2, R>
//! @todo: put automated wrappers here...
/** @} */
#endif

View file

@ -29,6 +29,10 @@
#include <functional>
#include <iostream>
/** @addtogroup Evaluation
* @{
*/
/**
* eoScalarFitness<ScalarType, Compare = less<ScalarType> >:
* Wraps a scalar fitness values such as a double or int, with the option of
@ -107,4 +111,5 @@ std::istream& operator>>(std::istream& is, eoScalarFitness<F, Cmp>& f)
return is;
}
/** @} */
#endif

View file

@ -26,8 +26,11 @@
#define _eoSecondsElapsedContinue_h
#include <eoContinue.h>
/**
Timed continuator: continues until a number of seconds is used
@ingroup Continuators
*/
template< class EOT>
class eoSecondsElapsedContinue: public eoContinue<EOT>

View file

@ -35,6 +35,9 @@ eoSelect selects a number of individuals from the first argument and
puts it in the second. To emphasize that it should not try to enlarge
the population, the second argument is an eoPopRange, a simple struct
that holds a begin and end iterator to the population
@ingroup Core
@ingroup Selectors
*/
template<class EOT>
class eoSelect : public eoBF<const eoPop<EOT>&, eoPop<EOT>&, void>

View file

@ -1,8 +1,8 @@
// eoSelectFactory.h
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
//-----------------------------------------------------------------------------
// EOFactory.h
// EOFactory.h
// (c) GeNeura Team, 1998
/*
This library is free software; you can redistribute it and/or
@ -25,65 +25,69 @@
#ifndef _EOSELECTFACTORY_H
#define _EOSELECTFACTORY_H
#include <eoFactory.h>
#include <eoRandomSelect.h>
#include <eoTournament.h>
#include <eoFactory.h>
#include <eoRandomSelect.h>
#include <eoTournament.h>
//-----------------------------------------------------------------------------
/** EO Factory.An instance of the factory class to create selectors, that is,
eoSelect objects
@see eoSelect*/
template< class EOT>
class eoSelectFactory: public eoFactory<eoSelect< EOT> > {
public:
/// @name ctors and dtors
//{@
/// constructor
eoSelectFactory( ) {}
/// destructor
virtual ~eoSelectFactory() {}
//@}
/** Another factory methods: creates an object from an std::istream, reading from
it whatever is needed to create the object. Usually, the format for the std::istream will be\\
objectType parameter1 parameter2 ... parametern\\
*/
virtual eoSelect<EOT>* make(std::istream& _is) {
eoSelect<EOT> * selectPtr;
std::string objectTypeStr;
_is >> objectTypeStr;
// All selectors have a rate, the proportion of the original population
float rate;
_is >> rate;
if ( objectTypeStr == "eoTournament") {
// another parameter is necessary
unsigned tSize;
_is >> tSize;
selectPtr = new eoTournament<EOT>( rate, tSize );
} else {
if ( objectTypeStr == "eoRandomSelect" ) {
selectPtr = new eoRandomSelect<EOT>( rate );
} else {
throw std::runtime_error( "Incorrect selector type" );
}
}
return selectPtr;
}
///@name eoObject methods
//@{
void printOn( std::ostream& _os ) const {};
void readFrom( std::istream& _is ){};
/** className is inherited */
//@}
};
/** EO Factory.An instance of the factory class to create selectors, that is,
eoSelect objects
@see eoSelect
@ingroup Selectors
@ingroup Utilities
*/
template< class EOT>
class eoSelectFactory: public eoFactory<eoSelect< EOT> > {
public:
/// @name ctors and dtors
//{@
/// constructor
eoSelectFactory( ) {}
/// destructor
virtual ~eoSelectFactory() {}
//@}
/** Another factory methods: creates an object from an std::istream, reading from
it whatever is needed to create the object. Usually, the format for the std::istream will be\\
objectType parameter1 parameter2 ... parametern\\
*/
virtual eoSelect<EOT>* make(std::istream& _is) {
eoSelect<EOT> * selectPtr;
std::string objectTypeStr;
_is >> objectTypeStr;
// All selectors have a rate, the proportion of the original population
float rate;
_is >> rate;
if ( objectTypeStr == "eoTournament") {
// another parameter is necessary
unsigned tSize;
_is >> tSize;
selectPtr = new eoTournament<EOT>( rate, tSize );
} else {
if ( objectTypeStr == "eoRandomSelect" ) {
selectPtr = new eoRandomSelect<EOT>( rate );
} else {
throw std::runtime_error( "Incorrect selector type" );
}
}
return selectPtr;
}
///@name eoObject methods
//@{
void printOn( std::ostream& _os ) const {};
void readFrom( std::istream& _is ){};
/** className is inherited */
//@}
};
#endif

View file

@ -46,6 +46,8 @@ techniques where it is a std::pair of doubles ...
It has to have a < operator it you want to call an existing
selector (see selector.h) - but of course you can write the whole
thing ...
@ingroup Selectors
*/
template <class EOT, class WorthType = double>
class eoSelectFromWorth : public eoSelectOne<EOT>
@ -86,6 +88,8 @@ protected:
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
* using a ... determinisitic tournament, yes!
@ingroup Selectors
*/
template <class EOT, class WorthT = double>
class eoDetTournamentWorthSelect : public eoSelectFromWorth<EOT, WorthT>
@ -123,6 +127,8 @@ private:
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
* using a ... stochastic tournament, yes!
@ingroup Selectors
*/
template <class EOT, class WorthT = double>
class eoStochTournamentWorthSelect : public eoSelectFromWorth<EOT, WorthT>
@ -162,6 +168,8 @@ private:
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
* using a ... roulette wheel selection, yes!
@ingroup Selectors
*/
template <class EOT, class WorthT = double>
class eoRouletteWorthSelect : public eoSelectFromWorth<EOT, WorthT>

View file

@ -40,6 +40,8 @@
It will use an eoHowMnay to determine the number of guys to select,
and push them to the back of the destination population.
@ingroup Selectors
*/
template<class EOT>
class eoSelectMany : public eoSelect<EOT>

View file

@ -37,6 +37,8 @@
It will select a fixed number of individuals and pushes them to
the back of the destination population.
@ingroup Selectors
*/
template<class EOT>
class eoSelectNumber : public eoSelect<EOT>

View file

@ -36,6 +36,8 @@
of eoSelectOne.
@see eoSelectMany, eoSelectRandom, eoDetTournament, eoStochTournament, eoProportional
@ingroup Selectors
*/
#if defined(_MSC_VER) && (_MSC_VER < 1300)
template<class EOT, class WorthT = EOT::Fitness>

View file

@ -37,6 +37,8 @@
It will select floor(rate*pop.size()) individuals and pushes them to
the back of the destination population.
@ingroup Selectors
*/
template<class EOT>
class eoSelectPerc : public eoSelect<EOT>

View file

@ -48,6 +48,8 @@ worse, or in random order.
It is the eoSelectOne equivalent of eoDetSelect - though eoDetSelect
always returns individuals from best to worst
@ingroup Selectors
*/
template <class EOT> class eoSequentialSelect: public eoSelectOne<EOT>
{
@ -93,6 +95,8 @@ for G3 evolution engine, see Deb, Anad and Joshi, CEC 2002
As eoSequentialSelect, it is an eoSelectOne to be used within the
eoEaseyEA algo, but conceptually it should be a global eoSelect, as it
selects a bunch of guys in one go (done in the setup function now)
@ingroup Selectors
*/
template <class EOT> class eoEliteSequentialSelect: public eoSelectOne<EOT>
{

View file

@ -33,8 +33,11 @@
* Goldberg and Richardson's basic sharing
*/
/** A helper class for Sharing - to hold distances */
class dMatrix : public std::vector<double>
/** A helper class for Sharing - to hold distances
*
* @ingroup Selectors
* */
class dMatrix : public std::vector<double>
{
public:
// Ctor : sets size
@ -74,6 +77,7 @@
* Goldberg and Richardson's basic sharing
* see eoSharingSelect for how to use it
* and test/t-eoSharing.cpp for a sample use of both
* @ingroup Selectors
*/
template <class EOT>
class eoSharing : public eoPerf2Worth<EOT>

View file

@ -37,6 +37,7 @@
* rather than the raw fitness (see eoSelectFromWorth.h)
* It uses an internal eoSharing object which is
* an eoPerf2Worth<EOT, double>
* @ingroup Selectors
*/
template <class EOT>

View file

@ -34,6 +34,8 @@
/**
* Shift two components of a chromosome.
*
* @ingroup Variators
*/
template<class EOT> class eoShiftMutation: public eoMonOp<EOT>
{

View file

@ -39,6 +39,8 @@
* Pi=1
* else
* Pi=0
*
* @ingroup Variators
*/
template < class POT > class eoSigBinaryFlight:public eoBinaryFlight < POT >
{

View file

@ -33,6 +33,8 @@
* Derivated from eoNeighborhood. Just takes relationships into account.
* The neighborhood is defined as a list of indices corresponding to particles.
* Also contains ONE particle considered as the best of the neighborhood.
*
* @ingroup Selectors
*/
template < class POT > class eoSocialNeighborhood : public eoNeighborhood<POT>
{
@ -122,13 +124,3 @@ protected:
#endif /* EOSOCIALNEIGHBORHOOD_H_ */

View file

@ -34,6 +34,8 @@
/** Standard flight for particle swarm optimization. Derivated from abstract eoFlight,
* just adds the velocities to the current position of the particle
* and invalidates its fitness
*
* @ingroup Variators
*/
template < class POT > class eoStandardFlight:public eoFlight < POT >
{

View file

@ -40,6 +40,8 @@
* At step t: v(t+1)= w * v(t) + c1 * r1 * ( xbest(t)-x(t) ) + c2 * r2 * ( lbest(t) - x(t) )
* lbest depends on the topology evolved, when using eoStarTopology, lbest corresponds to the
* global. Otherwise, lbest is a "local best", i.e the best in a neighborhood.
*
* @ingroup Variators
*/
template < class POT > class eoStandardVelocity:public eoVelocity < POT >
{

View file

@ -36,6 +36,8 @@
* Topology dedicated to "globest best" strategy for particle swarm optimization.
* All the particles of the swarm belong to the same and only social neighborhood.
* The global best is stored and updated using the eoSocialNeighborhood.
*
* @ingroup Selectors
*/
template < class POT > class eoStarTopology:public eoTopology <POT>
{

View file

@ -31,6 +31,8 @@
/**
A continuator: does a minimum number of generations, then
stops whenever a given number of generations takes place without improvement
@ingroup Continuators
*/
template< class EOT>
class eoSteadyFitContinue: public eoContinue<EOT>

View file

@ -21,24 +21,21 @@
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
Marc.Schoenauer@polytechnique.fr
*/
//-----------------------------------------------------------------------------
#ifndef eoStochTournamentSelect_h
#define eoStochTournamentSelect_h
//-----------------------------------------------------------------------------
#include <functional>
#include <numeric> // accumulate
#include <eoSelectOne.h> // eoSelectOne
#include <utils/selectors.h> // stochastic_tournament
//-----------------------------------------------------------------------------
/** eoStochTournamentSelect: a selection method that selects ONE individual by
binary stochastic tournament
-MS- 24/10/99 */
//-----------------------------------------------------------------------------
-MS- 24/10/99
@ingroup Selectors
*/
template <class EOT> class eoStochTournamentSelect: public eoSelectOne<EOT>
{
public:
@ -67,7 +64,5 @@ private:
double Trate;
};
//-----------------------------------------------------------------------------
#endif

View file

@ -34,13 +34,12 @@
#include <utils/selectors.h>
#include <eoPop.h>
//-----------------------------------------------------------------------------
/** eoStochasticUniversalSelect: select an individual proportional to her stored fitness
value, but in contrast with eoStochasticUniversalSelect, get rid of most finite sampling effects
by doing all selections in one go, using a single random number.
*/
//-----------------------------------------------------------------------------
@ingroup Selectors
*/
template <class EOT> class eoStochasticUniversalSelect: public eoSelectOne<EOT>
{
public:

View file

@ -46,6 +46,10 @@ removes them from the first pop argument
eoDeterministicSaDReplacement
*/
/** @addtogroup Replacors
* @{
*/
/** eoSurviveAndDie
A pure abstract class, to store the howmany's
*/
@ -187,5 +191,7 @@ private :
};
/** @} */
#endif

View file

@ -32,6 +32,8 @@
/**
* Termination condition until a running time is reached.
*
* @ingroup Continuators
*/
template < class EOT >
class eoTimeContinue: public eoContinue<EOT>

View file

@ -35,6 +35,9 @@
* Defines the interface of a swarm topology. Can be static (usually the case for the social topologies)
* or dynamic. It's the same interface for both social and physical topologies. ("social" topology means
* social-neighborhood-based toplogy and so on ...)
*
* @ingroup Selectors
* @ingroup Core
*/
template < class POT > class eoTopology:public eoPop < POT >
{

View file

@ -31,8 +31,10 @@
//-----------------------------------------------------------------------------
/**
eoTransform transforms a population by applying genetic operators on
it.
eoTransform transforms a population by applying genetic operators on it.
@ingroup Combination
@ingroup Core
*/
template<class EOT>
class eoTransform : public eoUF<eoPop<EOT>&, void>

View file

@ -38,6 +38,8 @@
* using eoSelectOne as it's mechanism.
* Therefore eoSelectMany needs an eoSelectOne in its ctor
* It will use an eoHowMnay to determine the number of guys to keep,
*
* @ingroup Selectors
*/
template<class EOT>
class eoTruncSelect : public eoSelect<EOT>

View file

@ -48,6 +48,8 @@
However, the same result can be obtained by embedding an
eoTruncatedSelectOne into an eoSelectMany ...
@ingroup Selectors
*/
template<class EOT>
class eoTruncatedSelectMany : public eoSelect<EOT>

View file

@ -40,6 +40,7 @@
It will perform selection only from the top guys in the population.
@ingroup Selectors
*/
template<class EOT>
class eoTruncatedSelectOne : public eoSelectOne<EOT>

View file

@ -32,6 +32,8 @@ mak@dhi.dk
/**
* Especially designed for combinatorial problem such as the TSP.
*
* @ingroup Variators
*/
template<class EOT> class eoTwoOptMutation: public eoMonOp<EOT>
{

View file

@ -39,6 +39,9 @@
* At step t: v(t+1)= w*v(t) + c1*r1* ( xbest(t)-x(t) ) + c2*r2* ( gbest(t) - x(t) )
* w is updated each time the velocity performer is called.
* (ci given and Ri chosen at random in [0;1]).
*
* @ingroup Core
* @ingroup Variators
*/
template < class POT > class eoVariableInertiaWeightedVelocity:public eoVelocity < POT >
{

View file

@ -36,6 +36,10 @@ Basically, they exchange genes - we need some matching information to apply
atom crossover
*/
/** @addtogroup Variators
* @{
*/
/** A helper class for choosing which genes to exchange */
template <class Atom>
class eoAtomExchange : public eoBF<unsigned, Atom &, bool>
@ -344,6 +348,6 @@ private:
double rate;
};
/** @} */
#endif

View file

@ -39,6 +39,9 @@
Hence they are in file eoFlOr MonOp.h file (FixedLengthOrdered mutations)
*/
/* @addtogroup Variators
* @{
*/
/** Addition of a gene
Is inserted at a random position - so can be applied to both
@ -153,6 +156,6 @@ private:
eoGeneDelChooser<EOT> & chooser;
};
/** @} */
#endif

View file

@ -35,6 +35,8 @@
/**
* Abstract class for velocities calculation (particle swarm optimization).
* All the velocities must derivated from eoVelocity.
*
* @ingroup Variators
*/
template < class POT > class eoVelocity:public eoBF < POT &,unsigned , void >
{

View file

@ -32,6 +32,8 @@
/**
* Abstract class for (inertia) weight updater (particle swarm optimization).
* Used inside classes extending eoVelocity.
*
* @ingroup Core
*/
template < class WeightType > class eoWeightUpdater: public eoUF < WeightType &, void > {};