grouping classes in documentation
This commit is contained in:
parent
44d1ab1bc2
commit
f478817c6e
73 changed files with 326 additions and 164 deletions
|
|
@ -33,6 +33,8 @@
|
||||||
|
|
||||||
/** eoInt: implementation of simple integer-valued chromosome.
|
/** eoInt: implementation of simple integer-valued chromosome.
|
||||||
* based on eoVector class
|
* based on eoVector class
|
||||||
|
*
|
||||||
|
* @ingroup Representations
|
||||||
*/
|
*/
|
||||||
template <class FitT> class eoInt: public eoVector<FitT, int>
|
template <class FitT> class eoInt: public eoVector<FitT, int>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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) )
|
* 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
|
* v(t) is an INT for any time step
|
||||||
* (ci given and Ri chosen at random in [0;1]).
|
* (ci given and Ri chosen at random in [0;1]).
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoIntegerVelocity:public eoVelocity < POT >
|
template < class POT > class eoIntegerVelocity:public eoVelocity < POT >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@
|
||||||
|
|
||||||
#include <eoOp.h>
|
#include <eoOp.h>
|
||||||
|
|
||||||
|
/** @addtogroup Utilities
|
||||||
|
|
||||||
/**
|
/**
|
||||||
One of the invalidator operators. Use this one as a 'hat' on an operator
|
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
|
that is defined to work on a generic datatype. This functor will then check
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@
|
||||||
* Nt is the total number of generations/event
|
* Nt is the total number of generations/event
|
||||||
* w(0) is the initial weight
|
* w(0) is the initial weight
|
||||||
* w(Nt) is the last inertia weight
|
* w(Nt) is the last inertia weight
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template <class WeightType, class StopCriteriaType> class eoLinearDecreasingWeightUp:public eoWeightUpdater<WeightType>
|
template <class WeightType, class StopCriteriaType> class eoLinearDecreasingWeightUp:public eoWeightUpdater<WeightType>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@
|
||||||
* truncate negative values to 0 -
|
* truncate negative values to 0 -
|
||||||
*
|
*
|
||||||
* to be used within an eoSelectFromWorth object
|
* to be used within an eoSelectFromWorth object
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoLinearFitScaling : public eoPerf2Worth<EOT> // false: do not cache fitness
|
class eoLinearFitScaling : public eoPerf2Worth<EOT> // false: do not cache fitness
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@
|
||||||
* One of the local best strategies for particle swarm optimization. Each particle has a fixed number of neighbours, ans
|
* One of the local best strategies for particle swarm optimization. Each particle has a fixed number of neighbours, ans
|
||||||
* the neighborhood is social.
|
* the neighborhood is social.
|
||||||
* The topology is never modified during the flight.
|
* The topology is never modified during the flight.
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoLinearTopology:public eoTopology <
|
template < class POT > class eoLinearTopology:public eoTopology <
|
||||||
POT >
|
POT >
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ eoMGGReplacement is an eoReplacement:
|
||||||
- select best N-1 of this merged population (detTournament only at the moment)
|
- select best N-1 of this merged population (detTournament only at the moment)
|
||||||
- put them back into parent population
|
- put them back into parent population
|
||||||
|
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,9 @@
|
||||||
* two populations into one (the second argument).
|
* two populations into one (the second argument).
|
||||||
* Note that the algorithms assume that the second argument denotes the
|
* Note that the algorithms assume that the second argument denotes the
|
||||||
* next generation.
|
* next generation.
|
||||||
|
*
|
||||||
|
* @ingroup Core
|
||||||
|
* @ingroup Replacors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<class Chrom> class eoMerge: public eoBF<const eoPop<Chrom>&, eoPop<Chrom>&, void>
|
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
|
Straightforward elitism class, specify the number of individuals to copy
|
||||||
into new geneneration or the rate w.r.t. pop size
|
into new geneneration or the rate w.r.t. pop size
|
||||||
|
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT> class eoElitism : public eoMerge<EOT>
|
template <class EOT> class eoElitism : public eoMerge<EOT>
|
||||||
{
|
{
|
||||||
|
|
@ -103,6 +108,7 @@ private :
|
||||||
|
|
||||||
/**
|
/**
|
||||||
No elite
|
No elite
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT> class eoNoElitism : public eoElitism<EOT>
|
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
|
Very elitist class, copies entire population into next gen
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT> class eoPlus : public eoMerge<EOT>
|
template <class EOT> class eoPlus : public eoMerge<EOT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ Replacement strategies that combine en eoMerge and an eoReduce.
|
||||||
/**
|
/**
|
||||||
eoMergeReduce: abstract replacement strategy that is just an application of
|
eoMergeReduce: abstract replacement strategy that is just an application of
|
||||||
an embedded merge, followed by an embedded reduce
|
an embedded merge, followed by an embedded reduce
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoMergeReduce : public eoReplacement<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
|
ES type of replacement strategy: first add parents to population, then truncate
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoPlusReplacement : public eoMergeReduce<EOT>
|
class eoPlusReplacement : public eoMergeReduce<EOT>
|
||||||
|
|
@ -82,6 +84,7 @@ class eoPlusReplacement : public eoMergeReduce<EOT>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
ES type of replacement strategy: ignore parents, truncate offspring
|
ES type of replacement strategy: ignore parents, truncate offspring
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoCommaReplacement : public eoMergeReduce<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,
|
EP type of replacement strategy: first add parents to population,
|
||||||
then truncate using EP tournament
|
then truncate using EP tournament
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoEPReplacement : public eoMergeReduce<EOT>
|
class eoEPReplacement : public eoMergeReduce<EOT>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@
|
||||||
/**
|
/**
|
||||||
* Abstract class for neighborboods. Used for particle swarm optimization
|
* Abstract class for neighborboods. Used for particle swarm optimization
|
||||||
* topology strategies. Can be social or physical.
|
* topology strategies. Can be social or physical.
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoNeighborhood
|
template < class POT > class eoNeighborhood
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,15 +38,15 @@
|
||||||
#include <eoPopulator.h>
|
#include <eoPopulator.h>
|
||||||
#include <utils/eoHowMany.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
|
* - an operator that MODIFIES only one parent from the populator
|
||||||
* (though it can use any number aside) and thus generates ONE offspring)
|
* (though it can use any number aside) and thus generates ONE offspring)
|
||||||
* - a local replacement between the parent and its offspring
|
* - a local replacement between the parent and its offspring
|
||||||
*
|
*
|
||||||
* Typically, Differential Evolution (Storn and Price 94) and Deb et al's
|
* Typically, Differential Evolution (Storn and Price 94) and Deb et al's
|
||||||
* G3 can be built on this
|
* G3 can be built on this
|
||||||
****************************************************************************
|
*
|
||||||
|
* @ingroup Combination
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoOneToOneBreeder: public eoBreed<EOT>
|
class eoOneToOneBreeder: public eoBreed<EOT>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include <eoPrintable.h>
|
#include <eoPrintable.h>
|
||||||
#include <eoFunctor.h>
|
#include <eoFunctor.h>
|
||||||
#include <utils/eoRNG.h>
|
#include <utils/eoRNG.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@defgroup Operators Evolutionary Operators
|
@defgroup Operators Evolutionary Operators
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@
|
||||||
* the differnet instances of eoOpContainer:
|
* the differnet instances of eoOpContainer:
|
||||||
* an ***absolute*** probability in the sequential version, and
|
* an ***absolute*** probability in the sequential version, and
|
||||||
* a ***relative*** weight in the proportional version
|
* a ***relative*** weight in the proportional version
|
||||||
|
*
|
||||||
|
* @ingroup Combination
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoOpContainer : public eoGenOp<EOT>
|
class eoOpContainer : public eoGenOp<EOT>
|
||||||
|
|
@ -83,6 +85,8 @@ class eoOpContainer : public eoGenOp<EOT>
|
||||||
* note the mark, rewind, unmark cycle
|
* note the mark, rewind, unmark cycle
|
||||||
* here operators are repeatedly applied on the same individual(s)
|
* here operators are repeatedly applied on the same individual(s)
|
||||||
* not all too elegant, but it sort of works...
|
* not all too elegant, but it sort of works...
|
||||||
|
*
|
||||||
|
* @ingroup Combination
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoSequentialOp : public eoOpContainer<EOT>
|
class eoSequentialOp : public eoOpContainer<EOT>
|
||||||
|
|
|
||||||
|
|
@ -20,21 +20,20 @@
|
||||||
|
|
||||||
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
|
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef _EOOPSELMASON_H
|
#ifndef _EOOPSELMASON_H
|
||||||
#define _EOOPSELMASON_H
|
#define _EOOPSELMASON_H
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
#include <eoProportionalOpSel.h>
|
|
||||||
#include <eoOpFactory.h> // for eoFactory and eoOpFactory
|
#include <eoOpFactory.h> // for eoFactory and eoOpFactory
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/** EO Mason, or builder, for operator selectors. A builder must allocate memory
|
/** 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>
|
template<class eoClass>
|
||||||
class eoOpSelMason: public eoFactory<eoOpSelector<eoClass> > {
|
class eoOpSelMason: public eoFactory<eoOpSelector<eoClass> > {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@
|
||||||
* p1 : [1|2,4,3|6,5] and p2 : [4|5,3,1|6,2] generate two children:
|
* 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
|
* 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
|
* 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>
|
template<class Chrom> class eoOrderXover: public eoQuadOp<Chrom>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,9 @@
|
||||||
/** @brief Base class to transform raw fitnesses into fitness for selection
|
/** @brief Base class to transform raw fitnesses into fitness for selection
|
||||||
|
|
||||||
@see eoSelectFromWorth
|
@see eoSelectFromWorth
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
|
@ingroup Utilities
|
||||||
*/
|
*/
|
||||||
template <class EOT, class WorthT = double>
|
template <class EOT, class WorthT = double>
|
||||||
class eoPerf2Worth : public eoUF<const eoPop<EOT>&, void>, public eoValueParam<std::vector<WorthT> >
|
class eoPerf2Worth : public eoUF<const eoPop<EOT>&, void>, public eoValueParam<std::vector<WorthT> >
|
||||||
|
|
@ -106,6 +109,8 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Perf2Worth with fitness cache
|
Perf2Worth with fitness cache
|
||||||
|
@ingroup Selectors
|
||||||
|
@ingroup Utilities
|
||||||
*/
|
*/
|
||||||
template <class EOT, class WorthT = typename EOT::Fitness>
|
template <class EOT, class WorthT = typename EOT::Fitness>
|
||||||
class eoPerf2WorthCached : public eoPerf2Worth<EOT, WorthT>
|
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>
|
template <class EOT>
|
||||||
class eoNoPerf2Worth : public eoPerf2Worth<EOT, typename EOT::Fitness>
|
class eoNoPerf2Worth : public eoPerf2Worth<EOT, typename EOT::Fitness>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
// -*- 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; -*-
|
||||||
|
|
||||||
// "eoFreqContinue.h"
|
|
||||||
|
|
||||||
// (c) OPAC Team, LIFL, Feb. 2006
|
// (c) OPAC Team, LIFL, Feb. 2006
|
||||||
|
|
||||||
/* This library is free software; you can redistribute it and/or
|
/* This library is free software; you can redistribute it and/or
|
||||||
|
|
@ -27,16 +25,25 @@
|
||||||
#include <eoContinue.h>
|
#include <eoContinue.h>
|
||||||
#include <eoPop.h>
|
#include <eoPop.h>
|
||||||
|
|
||||||
|
/** A continue that becomes true periodically.
|
||||||
|
*/
|
||||||
template <class EOT> class eoPeriodicContinue: public eoContinue <EOT> {
|
template <class EOT> class eoPeriodicContinue: public eoContinue <EOT> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/** Constructor. The period is given in parameter. */
|
/** 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
|
/** It returns 'true' only if the current number of generations modulo
|
||||||
the period doen't equal to zero. */
|
the period doen't equal to zero. */
|
||||||
bool operator () (const eoPop <EOT> & pop);
|
bool operator () (const eoPop <EOT> & pop)
|
||||||
|
{
|
||||||
|
return ((++ counter) % period) != 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
@ -45,19 +52,5 @@ private:
|
||||||
unsigned counter;
|
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
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
//Implementation of these objects
|
//Implementation of these objects
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
std::istream & operator >> ( std::istream& _is, eoPersistent& _o ) {
|
std::istream & operator >> ( std::istream& _is, eoPersistent& _o ) {
|
||||||
_o.readFrom(_is);
|
_o.readFrom(_is);
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,9 @@
|
||||||
* and eoInit derived object. in the ctor.
|
* and eoInit derived object. in the ctor.
|
||||||
* EOT must also have a copy ctor, since temporaries are created and then
|
* EOT must also have a copy ctor, since temporaries are created and then
|
||||||
* passed to the eoInit object
|
* passed to the eoInit object
|
||||||
|
*
|
||||||
|
* @ingroup Core
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoPop: public std::vector<EOT>, public eoObject, public eoPersistent
|
class eoPop: public std::vector<EOT>, public eoObject, public eoPersistent
|
||||||
{
|
{
|
||||||
|
|
@ -333,9 +334,6 @@ public:
|
||||||
for (unsigned i=0; i<size(); i++)
|
for (unsigned i=0; i<size(); i++)
|
||||||
this->operator[](i).invalidate();
|
this->operator[](i).invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@
|
||||||
*
|
*
|
||||||
* Basic parallelization (synchronous standard evolution engine):
|
* Basic parallelization (synchronous standard evolution engine):
|
||||||
* call the slaves and wait for the results
|
* call the slaves and wait for the results
|
||||||
|
*
|
||||||
|
* @ingroup Evaluation
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoPopEvalFunc : public eoBF<eoPop<EOT> & , eoPop<EOT> &, void>
|
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
|
/** eoPopLoopEval: an instance of eoPopEvalFunc that simply applies
|
||||||
* a private eoEvalFunc to all offspring
|
* a private eoEvalFunc to all offspring
|
||||||
|
*
|
||||||
|
* @ingroup Evaluation
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoPopLoopEval : public eoPopEvalFunc<EOT> {
|
class eoPopLoopEval : public eoPopEvalFunc<EOT> {
|
||||||
|
|
@ -79,6 +83,8 @@ private:
|
||||||
/** eoPopLoopEval: an instance of eoPopEvalFunc that simply applies
|
/** eoPopLoopEval: an instance of eoPopEvalFunc that simply applies
|
||||||
* a private eoEvalFunc to all offspring AND ALL PARENTS
|
* a private eoEvalFunc to all offspring AND ALL PARENTS
|
||||||
* as the fitness is supposed here to vary
|
* as the fitness is supposed here to vary
|
||||||
|
*
|
||||||
|
* @ingroup Evaluation
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoTimeVaryingLoopEval : public eoPopEvalFunc<EOT> {
|
class eoTimeVaryingLoopEval : public eoPopEvalFunc<EOT> {
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,11 @@
|
||||||
It is an eoPop but also behaves like an eoPop::iterator
|
It is an eoPop but also behaves like an eoPop::iterator
|
||||||
as far as operator* and operator++ are concerned
|
as far as operator* and operator++ are concerned
|
||||||
|
|
||||||
See eoGenOp and eoOpContainer
|
@see eoGenOp
|
||||||
|
@see eoOpContainer
|
||||||
|
|
||||||
|
@ingroup Core
|
||||||
|
@ingroup Utilities
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoPopulator
|
class eoPopulator
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,13 @@
|
||||||
// class eoSGAGenOp
|
// class eoSGAGenOp
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/** ***************************************************************************
|
/**
|
||||||
* eoPropGAGenOp (for Simple GA, but Proportional)
|
* eoPropGAGenOp (for Simple GA, but Proportional)
|
||||||
* choice between Crossover, mutation or cloining
|
* choice between Crossover, mutation or cloining
|
||||||
* with respect to given relatve weights
|
* with respect to given relatve weights
|
||||||
*****************************************************************************/
|
*
|
||||||
|
* @ingroup Combination
|
||||||
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoPropGAGenOp : public eoGenOp<EOT>
|
class eoPropGAGenOp : public eoGenOp<EOT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,15 +33,15 @@
|
||||||
#include <utils/selectors.h>
|
#include <utils/selectors.h>
|
||||||
#include <eoSelectOne.h>
|
#include <eoSelectOne.h>
|
||||||
#include <eoPop.h>
|
#include <eoPop.h>
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
/** eoProportionalSelect: select an individual proportional to her stored fitness
|
/** eoProportionalSelect: select an individual proportional to her stored fitness
|
||||||
value
|
value
|
||||||
|
|
||||||
Changed the algorithm to make use of a cumulative array of fitness scores,
|
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)
|
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>
|
template <class EOT> class eoProportionalSelect: public eoSelectOne<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@
|
||||||
* Update an inertia weight by assigning it an (uniform) random value.
|
* 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
|
* The weight is a basic feature to evaluate the velocity of a particle in
|
||||||
* swarm optimization.
|
* swarm optimization.
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
class eoRandomRealWeightUp:public eoWeightUpdater<double>
|
class eoRandomRealWeightUp:public eoWeightUpdater<double>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,12 +22,10 @@
|
||||||
Marc.Schoenauer@polytechnique.fr
|
Marc.Schoenauer@polytechnique.fr
|
||||||
mak@dhi.dk
|
mak@dhi.dk
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef eoRandomSelect_h
|
#ifndef eoRandomSelect_h
|
||||||
#define eoRandomSelect_h
|
#define eoRandomSelect_h
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
/** This file contains straightforward selectors:
|
/** This file contains straightforward selectors:
|
||||||
* eoRandomSelect returns an individual uniformly selected
|
* eoRandomSelect returns an individual uniformly selected
|
||||||
* eoBestSelect always return the best individual
|
* eoBestSelect always return the best individual
|
||||||
|
|
@ -37,10 +35,10 @@
|
||||||
#include <utils/eoRNG.h>
|
#include <utils/eoRNG.h>
|
||||||
#include <eoSelectOne.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>
|
template <class EOT> class eoRandomSelect: public eoSelectOne<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -52,11 +50,11 @@ template <class EOT> class eoRandomSelect: public eoSelectOne<EOT>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
/** eoBestSelect: a selection method that always return the best
|
/** 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>
|
template <class EOT> class eoBestSelect: public eoSelectOne<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -68,13 +66,11 @@ template <class EOT> class eoBestSelect: public eoSelectOne<EOT>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
/** eoNoSelect: returns all individual in order WITHOUT USING FITNESS!!!
|
/** eoNoSelect: returns all individual in order WITHOUT USING FITNESS!!!
|
||||||
* looping back to the beginning when exhasuted
|
* looping back to the beginning when exhasuted
|
||||||
*
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
template <class EOT> class eoNoSelect: public eoSelectOne<EOT>
|
template <class EOT> class eoNoSelect: public eoSelectOne<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@
|
||||||
* COmputes the ranked fitness: fitnesses range in [m,M]
|
* COmputes the ranked fitness: fitnesses range in [m,M]
|
||||||
* with m=2-pressure/popSize and M=pressure/popSize.
|
* with m=2-pressure/popSize and M=pressure/popSize.
|
||||||
* in between, the progression depstd::ends on exponent (linear if 1).
|
* in between, the progression depstd::ends on exponent (linear if 1).
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoRanking : public eoPerf2Worth<EOT> // false: do not cache fitness
|
class eoRanking : public eoPerf2Worth<EOT> // false: do not cache fitness
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,9 @@
|
||||||
* is an eoRouletteWorthSelect, i.e. a selector using a std::vector of worthes
|
* is an eoRouletteWorthSelect, i.e. a selector using a std::vector of worthes
|
||||||
* rather than the raw fitness (see eoSelectFromWorth.h)
|
* rather than the raw fitness (see eoSelectFromWorth.h)
|
||||||
* uses an internal eoRanking object which is an eoPerf2Worth<EOT, double>
|
* uses an internal eoRanking object which is an eoPerf2Worth<EOT, double>
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoRankingSelect: public eoRouletteWorthSelect<EOT, double>
|
class eoRankingSelect: public eoRouletteWorthSelect<EOT, double>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,25 +20,33 @@
|
||||||
|
|
||||||
Contact: thomas.legrand@lifl.fr
|
Contact: thomas.legrand@lifl.fr
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef EOREALBOUNDMODIFIER_H
|
#ifndef EOREALBOUNDMODIFIER_H
|
||||||
#define EOREALBOUNDMODIFIER_H
|
#define EOREALBOUNDMODIFIER_H
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
#include <eoFunctor.h>
|
#include <eoFunctor.h>
|
||||||
#include <utils/eoRealVectorBounds.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.
|
* Abstract class for eoRealVectorBounds modifier.
|
||||||
* Used to modify the bounds included into the eoRealVectorBounds object.
|
* Used to modify the bounds included into the eoRealVectorBounds object.
|
||||||
|
*
|
||||||
|
* @ingroup Bounds
|
||||||
*/
|
*/
|
||||||
class eoRealBoundModifier: public eoBF < eoRealBaseVectorBounds &,unsigned,void > {};
|
class eoRealBoundModifier: public eoBF < eoRealBaseVectorBounds &,unsigned,void > {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An eoRealBoundModifier that modify nothing !
|
* An eoRealBoundModifier that modify nothing !
|
||||||
|
* @ingroup Bounds
|
||||||
*/
|
*/
|
||||||
class eoDummyRealBoundModifier: public eoRealBoundModifier
|
class eoDummyRealBoundModifier: public eoRealBoundModifier
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
|
|
||||||
/** eoRealParticle: Implementation of a real-coded particle for
|
/** eoRealParticle: Implementation of a real-coded particle for
|
||||||
* particle swarm optimization. Positions, velocities and best positions are real-coded.
|
* particle swarm optimization. Positions, velocities and best positions are real-coded.
|
||||||
|
*
|
||||||
|
* @ingroup Real
|
||||||
*/
|
*/
|
||||||
template < class FitT> class eoRealParticle: public eoVectorParticle<FitT,double,double>
|
template < class FitT> class eoRealParticle: public eoVectorParticle<FitT,double,double>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,12 +40,15 @@
|
||||||
At the moment, limited to truncation - with 2 different methods,
|
At the moment, limited to truncation - with 2 different methods,
|
||||||
one that sorts the whole population, and one that repeatidely kills
|
one that sorts the whole population, and one that repeatidely kills
|
||||||
the worst. Ideally, we should be able to choose at run-time!!!
|
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>
|
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>
|
template <class EOT> class eoTruncate : public eoReduce<EOT>
|
||||||
{
|
{
|
||||||
void operator()(eoPop<EOT>& _newgen, unsigned _newsize)
|
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>
|
template <class EOT> class eoRandomReduce : public eoReduce<EOT>
|
||||||
{
|
{
|
||||||
void operator()(eoPop<EOT>& _newgen, unsigned _newsize)
|
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)
|
EP truncation method (some global stochastic tournament + sort)
|
||||||
Softer selective pressure than pure truncate
|
Softer selective pressure than pure truncate
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT> class eoEPReduce : public eoReduce<EOT>
|
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.
|
/** a truncate class that does not sort, but repeatidely kills the worse.
|
||||||
To be used in SSGA-like replacements (e.g. see eoSSGAWorseReplacement)
|
To be used in SSGA-like replacements (e.g. see eoSSGAWorseReplacement)
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoLinearTruncate : public eoReduce<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
|
/** a truncate class based on a repeated deterministic (reverse!) tournament
|
||||||
To be used in SSGA-like replacements (e.g. see eoSSGADetTournamentReplacement)
|
To be used in SSGA-like replacements (e.g. see eoSSGADetTournamentReplacement)
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoDetTournamentTruncate : public eoReduce<EOT>
|
class eoDetTournamentTruncate : public eoReduce<EOT>
|
||||||
|
|
@ -231,6 +239,7 @@ private:
|
||||||
|
|
||||||
/** a truncate class based on a repeated deterministic (reverse!) tournament
|
/** a truncate class based on a repeated deterministic (reverse!) tournament
|
||||||
To be used in SSGA-like replacements (e.g. see eoSSGAStochTournamentReplacement)
|
To be used in SSGA-like replacements (e.g. see eoSSGAStochTournamentReplacement)
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoStochTournamentTruncate : public eoReduce<EOT>
|
class eoStochTournamentTruncate : public eoReduce<EOT>
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,9 @@
|
||||||
#include <utils/eoHowMany.h>
|
#include <utils/eoHowMany.h>
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/** @addtogroup Replacors
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
eoReduceMerge: Replacement strategies that start by reducing the parents,
|
eoReduceMerge: Replacement strategies that start by reducing the parents,
|
||||||
|
|
@ -116,4 +119,5 @@ class eoSSGAStochTournamentReplacement : public eoReduceMerge<EOT>
|
||||||
eoPlus<EOT> plus;
|
eoPlus<EOT> plus;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @} */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@ eoReduceMergeReduce is an eoReplacement:
|
||||||
- merges reduced populations
|
- merges reduced populations
|
||||||
- reduces resulting merged pop if necessary
|
- reduces resulting merged pop if necessary
|
||||||
|
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoReduceMergeReduce : public eoReplacement<EOT>
|
class eoReduceMergeReduce : public eoReplacement<EOT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,10 @@
|
||||||
#include <eoFunctor.h> // eoReduce
|
#include <eoFunctor.h> // eoReduce
|
||||||
#include <utils/selectors.h>
|
#include <utils/selectors.h>
|
||||||
|
|
||||||
|
/** @addtogroup Replacors
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* eoReduceSplit: reduce the pop to the specified size
|
* eoReduceSplit: reduce the pop to the specified size
|
||||||
* AND eventually returns the eliminated guys
|
* AND eventually returns the eliminated guys
|
||||||
|
|
@ -320,4 +324,5 @@ private:
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/** @} */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -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
|
The eoMergeReduce, combination of eoMerge and eoReduce, can be found
|
||||||
in file eoMergeReduce.h
|
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>
|
template<class EOT>
|
||||||
class eoReplacement : public eoBF<eoPop<EOT>&, eoPop<EOT>&, void>
|
class eoReplacement : public eoBF<eoPop<EOT>&, eoPop<EOT>&, void>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
generational replacement == swap populations
|
generational replacement == swap populations
|
||||||
|
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoGenerationalReplacement : public eoReplacement<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
|
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.
|
of the old pop. Removes the worse individual from the new pop.
|
||||||
This could be changed by adding a selector there...
|
This could be changed by adding a selector there...
|
||||||
|
|
||||||
|
@ingroup Replacors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoWeakElitistReplacement : public eoReplacement<EOT>
|
class eoWeakElitistReplacement : public eoReplacement<EOT>
|
||||||
|
|
@ -123,6 +125,4 @@ private:
|
||||||
eoReplacement<EOT> & replace;
|
eoReplacement<EOT> & replace;
|
||||||
};
|
};
|
||||||
|
|
||||||
//@}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@
|
||||||
* The neighborhoods are built using a ring based on each particle's indice and
|
* 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
|
* do not change for all the time steps. Only the best particle in each neighborhood is
|
||||||
* potentially updated thanks to the "updateNeighborhood" method.
|
* potentially updated thanks to the "updateNeighborhood" method.
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoRingTopology:public eoTopology <POT>
|
template < class POT > class eoRingTopology:public eoTopology <POT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,15 @@
|
||||||
// class eoSGAGenOp
|
// class eoSGAGenOp
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/** ***************************************************************************
|
/**
|
||||||
* eoSGAGenOp (for Simple GA) mimicks the usual crossover with proba pCross +
|
* eoSGAGenOp (for Simple GA) mimicks the usual crossover with proba pCross +
|
||||||
* mutation with proba pMut inside an eoGeneralOp
|
* mutation with proba pMut inside an eoGeneralOp
|
||||||
* It does it exactly as class eoSGATransform, i.e. only accepts
|
* It does it exactly as class eoSGATransform, i.e. only accepts
|
||||||
* quadratic crossover and unary mutation
|
* quadratic crossover and unary mutation
|
||||||
* It was introduced for didactic reasons, but seems to be popular :-)
|
* It was introduced for didactic reasons, but seems to be popular :-)
|
||||||
*****************************************************************************/
|
*
|
||||||
|
* @ingroup Combination
|
||||||
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoSGAGenOp : public eoGenOp<EOT>
|
class eoSGAGenOp : public eoGenOp<EOT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@
|
||||||
* It does it exactly as class eoSGA, i.e. only accepts
|
* It does it exactly as class eoSGA, i.e. only accepts
|
||||||
* quadratic crossover and unary mutation
|
* quadratic crossover and unary mutation
|
||||||
* It is here mainly for tutorial reasons
|
* It is here mainly for tutorial reasons
|
||||||
|
*
|
||||||
|
* @ingroup Combination
|
||||||
*/
|
*/
|
||||||
template<class EOT> class eoSGATransform : public eoTransform<EOT>
|
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,
|
* i.e. the operators probabilities can be passed as an eoValueParam,
|
||||||
* and hence can be modified from outside
|
* and hence can be modified from outside
|
||||||
* It is here mainly for tutorial reasons
|
* It is here mainly for tutorial reasons
|
||||||
*****************************************************************************/
|
*
|
||||||
|
* @ingroup Combination
|
||||||
|
*/
|
||||||
template<class EOT> class eoDynSGATransform : public eoTransform<EOT>
|
template<class EOT> class eoDynSGATransform : public eoTransform<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,10 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <eoContinue.h>
|
#include <eoContinue.h>
|
||||||
|
|
||||||
|
/** @addtogroup Continuators
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
extern bool existSIGContinue;
|
extern bool existSIGContinue;
|
||||||
extern bool call_func;
|
extern bool call_func;
|
||||||
|
|
||||||
|
|
@ -84,6 +88,7 @@ private:
|
||||||
sighandler_t _fct;
|
sighandler_t _fct;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@
|
||||||
|
|
||||||
#include "eoFunctor.h"
|
#include "eoFunctor.h"
|
||||||
|
|
||||||
|
/** @addtogroup Utilities
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Generic set of classes that wrap an eoF, eoUF or eoBF so that they have the
|
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
|
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...
|
//! @todo: put automated wrappers here...
|
||||||
|
|
||||||
|
/** @} */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
/** @addtogroup Evaluation
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* eoScalarFitness<ScalarType, Compare = less<ScalarType> >:
|
* eoScalarFitness<ScalarType, Compare = less<ScalarType> >:
|
||||||
* Wraps a scalar fitness values such as a double or int, with the option of
|
* 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;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @} */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,11 @@
|
||||||
#define _eoSecondsElapsedContinue_h
|
#define _eoSecondsElapsedContinue_h
|
||||||
|
|
||||||
#include <eoContinue.h>
|
#include <eoContinue.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Timed continuator: continues until a number of seconds is used
|
Timed continuator: continues until a number of seconds is used
|
||||||
|
|
||||||
|
@ingroup Continuators
|
||||||
*/
|
*/
|
||||||
template< class EOT>
|
template< class EOT>
|
||||||
class eoSecondsElapsedContinue: public eoContinue<EOT>
|
class eoSecondsElapsedContinue: public eoContinue<EOT>
|
||||||
|
|
|
||||||
|
|
@ -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
|
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
|
the population, the second argument is an eoPopRange, a simple struct
|
||||||
that holds a begin and end iterator to the population
|
that holds a begin and end iterator to the population
|
||||||
|
|
||||||
|
@ingroup Core
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoSelect : public eoBF<const eoPop<EOT>&, eoPop<EOT>&, void>
|
class eoSelect : public eoBF<const eoPop<EOT>&, eoPop<EOT>&, void>
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,11 @@
|
||||||
|
|
||||||
/** EO Factory.An instance of the factory class to create selectors, that is,
|
/** EO Factory.An instance of the factory class to create selectors, that is,
|
||||||
eoSelect objects
|
eoSelect objects
|
||||||
@see eoSelect*/
|
|
||||||
|
@see eoSelect
|
||||||
|
@ingroup Selectors
|
||||||
|
@ingroup Utilities
|
||||||
|
*/
|
||||||
template< class EOT>
|
template< class EOT>
|
||||||
class eoSelectFactory: public eoFactory<eoSelect< EOT> > {
|
class eoSelectFactory: public eoFactory<eoSelect< EOT> > {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
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
|
selector (see selector.h) - but of course you can write the whole
|
||||||
thing ...
|
thing ...
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT, class WorthType = double>
|
template <class EOT, class WorthType = double>
|
||||||
class eoSelectFromWorth : public eoSelectOne<EOT>
|
class eoSelectFromWorth : public eoSelectOne<EOT>
|
||||||
|
|
@ -86,6 +88,8 @@ protected:
|
||||||
|
|
||||||
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
|
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
|
||||||
* using a ... determinisitic tournament, yes!
|
* using a ... determinisitic tournament, yes!
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT, class WorthT = double>
|
template <class EOT, class WorthT = double>
|
||||||
class eoDetTournamentWorthSelect : public eoSelectFromWorth<EOT, WorthT>
|
class eoDetTournamentWorthSelect : public eoSelectFromWorth<EOT, WorthT>
|
||||||
|
|
@ -123,6 +127,8 @@ private:
|
||||||
|
|
||||||
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
|
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
|
||||||
* using a ... stochastic tournament, yes!
|
* using a ... stochastic tournament, yes!
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT, class WorthT = double>
|
template <class EOT, class WorthT = double>
|
||||||
class eoStochTournamentWorthSelect : public eoSelectFromWorth<EOT, WorthT>
|
class eoStochTournamentWorthSelect : public eoSelectFromWorth<EOT, WorthT>
|
||||||
|
|
@ -162,6 +168,8 @@ private:
|
||||||
|
|
||||||
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
|
/** An instance of eoSelectPerf2Worth that does selection from the Worthes
|
||||||
* using a ... roulette wheel selection, yes!
|
* using a ... roulette wheel selection, yes!
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT, class WorthT = double>
|
template <class EOT, class WorthT = double>
|
||||||
class eoRouletteWorthSelect : public eoSelectFromWorth<EOT, WorthT>
|
class eoRouletteWorthSelect : public eoSelectFromWorth<EOT, WorthT>
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@
|
||||||
|
|
||||||
It will use an eoHowMnay to determine the number of guys to select,
|
It will use an eoHowMnay to determine the number of guys to select,
|
||||||
and push them to the back of the destination population.
|
and push them to the back of the destination population.
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoSelectMany : public eoSelect<EOT>
|
class eoSelectMany : public eoSelect<EOT>
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@
|
||||||
|
|
||||||
It will select a fixed number of individuals and pushes them to
|
It will select a fixed number of individuals and pushes them to
|
||||||
the back of the destination population.
|
the back of the destination population.
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoSelectNumber : public eoSelect<EOT>
|
class eoSelectNumber : public eoSelect<EOT>
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@
|
||||||
of eoSelectOne.
|
of eoSelectOne.
|
||||||
|
|
||||||
@see eoSelectMany, eoSelectRandom, eoDetTournament, eoStochTournament, eoProportional
|
@see eoSelectMany, eoSelectRandom, eoDetTournament, eoStochTournament, eoProportional
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1300)
|
#if defined(_MSC_VER) && (_MSC_VER < 1300)
|
||||||
template<class EOT, class WorthT = EOT::Fitness>
|
template<class EOT, class WorthT = EOT::Fitness>
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@
|
||||||
|
|
||||||
It will select floor(rate*pop.size()) individuals and pushes them to
|
It will select floor(rate*pop.size()) individuals and pushes them to
|
||||||
the back of the destination population.
|
the back of the destination population.
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoSelectPerc : public eoSelect<EOT>
|
class eoSelectPerc : public eoSelect<EOT>
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@ worse, or in random order.
|
||||||
|
|
||||||
It is the eoSelectOne equivalent of eoDetSelect - though eoDetSelect
|
It is the eoSelectOne equivalent of eoDetSelect - though eoDetSelect
|
||||||
always returns individuals from best to worst
|
always returns individuals from best to worst
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT> class eoSequentialSelect: public eoSelectOne<EOT>
|
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
|
As eoSequentialSelect, it is an eoSelectOne to be used within the
|
||||||
eoEaseyEA algo, but conceptually it should be a global eoSelect, as it
|
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)
|
selects a bunch of guys in one go (done in the setup function now)
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT> class eoEliteSequentialSelect: public eoSelectOne<EOT>
|
template <class EOT> class eoEliteSequentialSelect: public eoSelectOne<EOT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,10 @@
|
||||||
* Goldberg and Richardson's basic sharing
|
* Goldberg and Richardson's basic sharing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** A helper class for Sharing - to hold distances */
|
/** A helper class for Sharing - to hold distances
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
|
* */
|
||||||
class dMatrix : public std::vector<double>
|
class dMatrix : public std::vector<double>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -74,6 +77,7 @@
|
||||||
* Goldberg and Richardson's basic sharing
|
* Goldberg and Richardson's basic sharing
|
||||||
* see eoSharingSelect for how to use it
|
* see eoSharingSelect for how to use it
|
||||||
* and test/t-eoSharing.cpp for a sample use of both
|
* and test/t-eoSharing.cpp for a sample use of both
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoSharing : public eoPerf2Worth<EOT>
|
class eoSharing : public eoPerf2Worth<EOT>
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
* rather than the raw fitness (see eoSelectFromWorth.h)
|
* rather than the raw fitness (see eoSelectFromWorth.h)
|
||||||
* It uses an internal eoSharing object which is
|
* It uses an internal eoSharing object which is
|
||||||
* an eoPerf2Worth<EOT, double>
|
* an eoPerf2Worth<EOT, double>
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shift two components of a chromosome.
|
* Shift two components of a chromosome.
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template<class EOT> class eoShiftMutation: public eoMonOp<EOT>
|
template<class EOT> class eoShiftMutation: public eoMonOp<EOT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@
|
||||||
* Pi=1
|
* Pi=1
|
||||||
* else
|
* else
|
||||||
* Pi=0
|
* Pi=0
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoSigBinaryFlight:public eoBinaryFlight < POT >
|
template < class POT > class eoSigBinaryFlight:public eoBinaryFlight < POT >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@
|
||||||
* Derivated from eoNeighborhood. Just takes relationships into account.
|
* Derivated from eoNeighborhood. Just takes relationships into account.
|
||||||
* The neighborhood is defined as a list of indices corresponding to particles.
|
* The neighborhood is defined as a list of indices corresponding to particles.
|
||||||
* Also contains ONE particle considered as the best of the neighborhood.
|
* Also contains ONE particle considered as the best of the neighborhood.
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoSocialNeighborhood : public eoNeighborhood<POT>
|
template < class POT > class eoSocialNeighborhood : public eoNeighborhood<POT>
|
||||||
{
|
{
|
||||||
|
|
@ -122,13 +124,3 @@ protected:
|
||||||
|
|
||||||
#endif /* EOSOCIALNEIGHBORHOOD_H_ */
|
#endif /* EOSOCIALNEIGHBORHOOD_H_ */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@
|
||||||
/** Standard flight for particle swarm optimization. Derivated from abstract eoFlight,
|
/** Standard flight for particle swarm optimization. Derivated from abstract eoFlight,
|
||||||
* just adds the velocities to the current position of the particle
|
* just adds the velocities to the current position of the particle
|
||||||
* and invalidates its fitness
|
* and invalidates its fitness
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoStandardFlight:public eoFlight < POT >
|
template < class POT > class eoStandardFlight:public eoFlight < POT >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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) )
|
* 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
|
* 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.
|
* global. Otherwise, lbest is a "local best", i.e the best in a neighborhood.
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoStandardVelocity:public eoVelocity < POT >
|
template < class POT > class eoStandardVelocity:public eoVelocity < POT >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@
|
||||||
* Topology dedicated to "globest best" strategy for particle swarm optimization.
|
* Topology dedicated to "globest best" strategy for particle swarm optimization.
|
||||||
* All the particles of the swarm belong to the same and only social neighborhood.
|
* All the particles of the swarm belong to the same and only social neighborhood.
|
||||||
* The global best is stored and updated using the eoSocialNeighborhood.
|
* The global best is stored and updated using the eoSocialNeighborhood.
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoStarTopology:public eoTopology <POT>
|
template < class POT > class eoStarTopology:public eoTopology <POT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
/**
|
/**
|
||||||
A continuator: does a minimum number of generations, then
|
A continuator: does a minimum number of generations, then
|
||||||
stops whenever a given number of generations takes place without improvement
|
stops whenever a given number of generations takes place without improvement
|
||||||
|
|
||||||
|
@ingroup Continuators
|
||||||
*/
|
*/
|
||||||
template< class EOT>
|
template< class EOT>
|
||||||
class eoSteadyFitContinue: public eoContinue<EOT>
|
class eoSteadyFitContinue: public eoContinue<EOT>
|
||||||
|
|
|
||||||
|
|
@ -21,24 +21,21 @@
|
||||||
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
|
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
|
||||||
Marc.Schoenauer@polytechnique.fr
|
Marc.Schoenauer@polytechnique.fr
|
||||||
*/
|
*/
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifndef eoStochTournamentSelect_h
|
#ifndef eoStochTournamentSelect_h
|
||||||
#define eoStochTournamentSelect_h
|
#define eoStochTournamentSelect_h
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <numeric> // accumulate
|
#include <numeric> // accumulate
|
||||||
#include <eoSelectOne.h> // eoSelectOne
|
#include <eoSelectOne.h> // eoSelectOne
|
||||||
#include <utils/selectors.h> // stochastic_tournament
|
#include <utils/selectors.h> // stochastic_tournament
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
/** eoStochTournamentSelect: a selection method that selects ONE individual by
|
/** eoStochTournamentSelect: a selection method that selects ONE individual by
|
||||||
binary stochastic tournament
|
binary stochastic tournament
|
||||||
-MS- 24/10/99 */
|
-MS- 24/10/99
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
|
*/
|
||||||
template <class EOT> class eoStochTournamentSelect: public eoSelectOne<EOT>
|
template <class EOT> class eoStochTournamentSelect: public eoSelectOne<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -67,7 +64,5 @@ private:
|
||||||
double Trate;
|
double Trate;
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,12 @@
|
||||||
#include <utils/selectors.h>
|
#include <utils/selectors.h>
|
||||||
#include <eoPop.h>
|
#include <eoPop.h>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
/** eoStochasticUniversalSelect: select an individual proportional to her stored fitness
|
/** eoStochasticUniversalSelect: select an individual proportional to her stored fitness
|
||||||
value, but in contrast with eoStochasticUniversalSelect, get rid of most finite sampling effects
|
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.
|
by doing all selections in one go, using a single random number.
|
||||||
*/
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
|
*/
|
||||||
template <class EOT> class eoStochasticUniversalSelect: public eoSelectOne<EOT>
|
template <class EOT> class eoStochasticUniversalSelect: public eoSelectOne<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,10 @@ removes them from the first pop argument
|
||||||
eoDeterministicSaDReplacement
|
eoDeterministicSaDReplacement
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup Replacors
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/** eoSurviveAndDie
|
/** eoSurviveAndDie
|
||||||
A pure abstract class, to store the howmany's
|
A pure abstract class, to store the howmany's
|
||||||
*/
|
*/
|
||||||
|
|
@ -187,5 +191,7 @@ private :
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Termination condition until a running time is reached.
|
* Termination condition until a running time is reached.
|
||||||
|
*
|
||||||
|
* @ingroup Continuators
|
||||||
*/
|
*/
|
||||||
template < class EOT >
|
template < class EOT >
|
||||||
class eoTimeContinue: public eoContinue<EOT>
|
class eoTimeContinue: public eoContinue<EOT>
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@
|
||||||
* Defines the interface of a swarm topology. Can be static (usually the case for the social topologies)
|
* 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
|
* or dynamic. It's the same interface for both social and physical topologies. ("social" topology means
|
||||||
* social-neighborhood-based toplogy and so on ...)
|
* social-neighborhood-based toplogy and so on ...)
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
|
* @ingroup Core
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoTopology:public eoPop < POT >
|
template < class POT > class eoTopology:public eoPop < POT >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
eoTransform transforms a population by applying genetic operators on
|
eoTransform transforms a population by applying genetic operators on it.
|
||||||
it.
|
|
||||||
|
@ingroup Combination
|
||||||
|
@ingroup Core
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoTransform : public eoUF<eoPop<EOT>&, void>
|
class eoTransform : public eoUF<eoPop<EOT>&, void>
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@
|
||||||
* using eoSelectOne as it's mechanism.
|
* using eoSelectOne as it's mechanism.
|
||||||
* Therefore eoSelectMany needs an eoSelectOne in its ctor
|
* Therefore eoSelectMany needs an eoSelectOne in its ctor
|
||||||
* It will use an eoHowMnay to determine the number of guys to keep,
|
* It will use an eoHowMnay to determine the number of guys to keep,
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoTruncSelect : public eoSelect<EOT>
|
class eoTruncSelect : public eoSelect<EOT>
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@
|
||||||
|
|
||||||
However, the same result can be obtained by embedding an
|
However, the same result can be obtained by embedding an
|
||||||
eoTruncatedSelectOne into an eoSelectMany ...
|
eoTruncatedSelectOne into an eoSelectMany ...
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoTruncatedSelectMany : public eoSelect<EOT>
|
class eoTruncatedSelectMany : public eoSelect<EOT>
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
|
|
||||||
It will perform selection only from the top guys in the population.
|
It will perform selection only from the top guys in the population.
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoTruncatedSelectOne : public eoSelectOne<EOT>
|
class eoTruncatedSelectOne : public eoSelectOne<EOT>
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ mak@dhi.dk
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Especially designed for combinatorial problem such as the TSP.
|
* Especially designed for combinatorial problem such as the TSP.
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template<class EOT> class eoTwoOptMutation: public eoMonOp<EOT>
|
template<class EOT> class eoTwoOptMutation: public eoMonOp<EOT>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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) )
|
* 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.
|
* w is updated each time the velocity performer is called.
|
||||||
* (ci given and Ri chosen at random in [0;1]).
|
* (ci given and Ri chosen at random in [0;1]).
|
||||||
|
*
|
||||||
|
* @ingroup Core
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoVariableInertiaWeightedVelocity:public eoVelocity < POT >
|
template < class POT > class eoVariableInertiaWeightedVelocity:public eoVelocity < POT >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,10 @@ Basically, they exchange genes - we need some matching information to apply
|
||||||
atom crossover
|
atom crossover
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup Variators
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/** A helper class for choosing which genes to exchange */
|
/** A helper class for choosing which genes to exchange */
|
||||||
template <class Atom>
|
template <class Atom>
|
||||||
class eoAtomExchange : public eoBF<unsigned, Atom &, bool>
|
class eoAtomExchange : public eoBF<unsigned, Atom &, bool>
|
||||||
|
|
@ -344,6 +348,6 @@ private:
|
||||||
double rate;
|
double rate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@
|
||||||
Hence they are in file eoFlOr MonOp.h file (FixedLengthOrdered mutations)
|
Hence they are in file eoFlOr MonOp.h file (FixedLengthOrdered mutations)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* @addtogroup Variators
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/** Addition of a gene
|
/** Addition of a gene
|
||||||
Is inserted at a random position - so can be applied to both
|
Is inserted at a random position - so can be applied to both
|
||||||
|
|
@ -153,6 +156,6 @@ private:
|
||||||
eoGeneDelChooser<EOT> & chooser;
|
eoGeneDelChooser<EOT> & chooser;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@
|
||||||
/**
|
/**
|
||||||
* Abstract class for velocities calculation (particle swarm optimization).
|
* Abstract class for velocities calculation (particle swarm optimization).
|
||||||
* All the velocities must derivated from eoVelocity.
|
* All the velocities must derivated from eoVelocity.
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoVelocity:public eoBF < POT &,unsigned , void >
|
template < class POT > class eoVelocity:public eoBF < POT &,unsigned , void >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@
|
||||||
/**
|
/**
|
||||||
* Abstract class for (inertia) weight updater (particle swarm optimization).
|
* Abstract class for (inertia) weight updater (particle swarm optimization).
|
||||||
* Used inside classes extending eoVelocity.
|
* Used inside classes extending eoVelocity.
|
||||||
|
*
|
||||||
|
* @ingroup Core
|
||||||
*/
|
*/
|
||||||
template < class WeightType > class eoWeightUpdater: public eoUF < WeightType &, void > {};
|
template < class WeightType > class eoWeightUpdater: public eoUF < WeightType &, void > {};
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue