grouping classes in documentation
This commit is contained in:
parent
284b048dcc
commit
8e70cbea01
39 changed files with 140 additions and 23 deletions
|
|
@ -31,6 +31,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Applies a unary function to a std::vector of things.
|
Applies a unary function to a std::vector of things.
|
||||||
|
|
||||||
|
@ingroup Utilities
|
||||||
*/
|
*/
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
void apply(eoUF<EOT&, void>& _proc, std::vector<EOT>& _pop)
|
void apply(eoUF<EOT&, void>& _proc, std::vector<EOT>& _pop)
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@
|
||||||
/** Abstract class for binary flight of particle swarms. Positions are updated but are expected to be binary.
|
/** Abstract class for binary flight of particle swarms. Positions are updated but are expected to be binary.
|
||||||
* A function must be used to decide, according to continuous velocities, of the
|
* A function must be used to decide, according to continuous velocities, of the
|
||||||
* new positions (0,1 ... ?)
|
* new positions (0,1 ... ?)
|
||||||
|
*
|
||||||
|
* @ingroup Core
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoBinaryFlight:public eoFlight < POT >{};
|
template < class POT > class eoBinaryFlight:public eoFlight < POT >{};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
|
|
||||||
/** eoBitParticle: Implementation of a bit-coded particle (swarm optimization).
|
/** eoBitParticle: Implementation of a bit-coded particle (swarm optimization).
|
||||||
* Positions and best positions are 0 or 1 but the velocity is a vector of double.
|
* Positions and best positions are 0 or 1 but the velocity is a vector of double.
|
||||||
|
*
|
||||||
|
* @ingroup Bitstring
|
||||||
*/
|
*/
|
||||||
template < class FitT> class eoBitParticle: public eoVectorParticle<FitT,bool,double>
|
template < class FitT> class eoBitParticle: public eoVectorParticle<FitT,bool,double>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@
|
||||||
* within the eoGenOp framework
|
* within the eoGenOp framework
|
||||||
* eoMonCloneOp will probably be useful as the copy operator
|
* eoMonCloneOp will probably be useful as the copy operator
|
||||||
* eoBinCloneOp will certainly never been used - but let's be complete :-)
|
* eoBinCloneOp will certainly never been used - but let's be complete :-)
|
||||||
|
*
|
||||||
|
* @addtogroup Core
|
||||||
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -76,4 +79,5 @@ virtual bool operator()(EOT& , EOT& ) {return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
/** @} */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,9 @@
|
||||||
and allow to easily handle more than 2 continuators
|
and allow to easily handle more than 2 continuators
|
||||||
|
|
||||||
02/2003 Ramón Casero Cañas - added the removeLast() method
|
02/2003 Ramón Casero Cañas - added the removeLast() method
|
||||||
*/
|
|
||||||
|
|
||||||
|
@ingroup Combination
|
||||||
|
*/
|
||||||
template< class EOT>
|
template< class EOT>
|
||||||
class eoCombinedContinue: public eoContinue<EOT> {
|
class eoCombinedContinue: public eoContinue<EOT> {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@
|
||||||
* At step t: v(t+1)= K * ( w*v(t) + c1*r1* (xbest(t)-x(t)) + c2*r2* (gbest(t) - x(t)))
|
* At step t: v(t+1)= K * ( 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 and K is fixed
|
* w is updated each time the velocity performer is called and K is fixed
|
||||||
* (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 eoConstrictedVariableWeightVelocity:public eoVelocity < POT >
|
template < class POT > class eoConstrictedVariableWeightVelocity:public eoVelocity < POT >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@
|
||||||
* C is fixed for all the particles and all the generations.
|
* C is fixed for all the particles and all the generations.
|
||||||
* Default C = 2 * k / abs(2 - P - sqrt (P*(P-4)))
|
* Default C = 2 * k / abs(2 - P - sqrt (P*(P-4)))
|
||||||
* (ci and C given;P=c1*r1 + c2*r2 ; Ri chosen at random * in [0;1])
|
* (ci and C given;P=c1*r1 + c2*r2 ; Ri chosen at random * in [0;1])
|
||||||
|
*
|
||||||
|
* @ingroup Variators
|
||||||
*/
|
*/
|
||||||
template < class POT > class eoConstrictedVelocity:public eoVelocity < POT >
|
template < class POT > class eoConstrictedVelocity:public eoVelocity < POT >
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,20 @@
|
||||||
#include <eoPop.h>
|
#include <eoPop.h>
|
||||||
#include <eoPersistent.h>
|
#include <eoPersistent.h>
|
||||||
|
|
||||||
|
/** @defgroup Continuators Stopping criteria
|
||||||
|
*
|
||||||
|
* A stopping criterion is called a "continue". This is a functor that is called at each generation end
|
||||||
|
* and that return true if one should stop the search.
|
||||||
|
*
|
||||||
|
* @ingroup Utilities
|
||||||
|
*/
|
||||||
|
|
||||||
/** Termination condition for the genetic algorithm
|
/** Termination condition for the genetic algorithm
|
||||||
* Takes the population as input, returns true for continue,
|
* Takes the population as input, returns true for continue,
|
||||||
* false for termination
|
* false for termination
|
||||||
|
*
|
||||||
|
* @ingroup Continuators
|
||||||
|
* @ingroup Core
|
||||||
*/
|
*/
|
||||||
template< class EOT>
|
template< class EOT>
|
||||||
class eoContinue : public eoUF<const eoPop<EOT>&, bool>, public eoPersistent
|
class eoContinue : public eoUF<const eoPop<EOT>&, bool>, public eoPersistent
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@
|
||||||
use this class instead of it.
|
use this class instead of it.
|
||||||
|
|
||||||
It is derived from eoValueParam so you can add it to a monitor.
|
It is derived from eoValueParam so you can add it to a monitor.
|
||||||
|
|
||||||
|
@ingroup Utilities
|
||||||
*/
|
*/
|
||||||
template <class Procedure>
|
template <class Procedure>
|
||||||
class eoProcedureCounter : public Procedure, public eoValueParam<unsigned long>
|
class eoProcedureCounter : public Procedure, public eoValueParam<unsigned long>
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,11 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <eoContinue.h>
|
#include <eoContinue.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Continuators
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
extern bool arret_demande, existCtrlCContinue;
|
extern bool arret_demande, existCtrlCContinue;
|
||||||
|
|
||||||
extern void signal_handler( int sig );
|
extern void signal_handler( int sig );
|
||||||
|
|
@ -78,5 +83,5 @@ public:
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
/** @} */
|
||||||
|
|
||||||
// of MSVC comment-out
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
/** eoDetSelect selects many individuals determinisctically
|
/** eoDetSelect selects many individuals determinisctically
|
||||||
|
*
|
||||||
|
* @ingroup Selectors
|
||||||
*/
|
*/
|
||||||
template<class EOT>
|
template<class EOT>
|
||||||
class eoDetSelect : public eoSelect<EOT>
|
class eoDetSelect : public eoSelect<EOT>
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,12 @@
|
||||||
#include <utils/eoLogger.h>
|
#include <utils/eoLogger.h>
|
||||||
#include <utils/selectors.h>
|
#include <utils/selectors.h>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
/** eoDetTournamentSelect: a selection method that selects ONE individual by
|
/** eoDetTournamentSelect: a selection method that selects ONE individual by
|
||||||
deterministic tournament
|
deterministic tournament
|
||||||
-MS- 24/10/99 */
|
-MS- 24/10/99
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
@ingroup Selectors
|
||||||
|
*/
|
||||||
template <class EOT> class eoDetTournamentSelect: public eoSelectOne<EOT>
|
template <class EOT> class eoDetTournamentSelect: public eoSelectOne<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@
|
||||||
*
|
*
|
||||||
* It takes one distribution and updates it according to one population
|
* It takes one distribution and updates it according to one population
|
||||||
*
|
*
|
||||||
|
* @ingroup Core
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoDistribUpdater :
|
class eoDistribUpdater :
|
||||||
public eoBF<eoDistribution<EOT> &, eoPop<EOT> &, void>
|
public eoBF<eoDistribution<EOT> &, eoPop<EOT> &, void>
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@
|
||||||
*
|
*
|
||||||
* The instances will probably be eoValueParam of some kind
|
* The instances will probably be eoValueParam of some kind
|
||||||
* see eoPBILDistrib.h
|
* see eoPBILDistrib.h
|
||||||
|
*
|
||||||
|
* @ingroup Core
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,11 @@ Authors:
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <utility> // for std::pair
|
#include <utility> // for std::pair
|
||||||
|
|
||||||
//! A fitness class that permits to compare feasible and unfeasible individuals. It guaranties that a feasible individual will always be better than an unfeasible one.
|
/** @addtogroup Evaluation
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
//! A fitness class that permits to compare feasible and unfeasible individuals and guaranties that a feasible individual will always be better than an unfeasible one.
|
||||||
/**
|
/**
|
||||||
* Use this class as fitness if you have some kind of individuals
|
* Use this class as fitness if you have some kind of individuals
|
||||||
* that must be always considered as better than others while having the same fitness type.
|
* that must be always considered as better than others while having the same fitness type.
|
||||||
|
|
@ -232,5 +236,6 @@ typedef eoDualFitness<double, std::greater<double> > eoMinimizingDualFitness;
|
||||||
template< class EOT>
|
template< class EOT>
|
||||||
bool eoIsFeasible ( const EOT & sol ) { return sol.fitness().is_feasible(); }
|
bool eoIsFeasible ( const EOT & sol ) { return sol.fitness().is_feasible(); }
|
||||||
|
|
||||||
|
/** @} */
|
||||||
#endif // _eoDualFitness_h_
|
#endif // _eoDualFitness_h_
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Continues until a number of evaluations has been made
|
* Continues until a number of evaluations has been made
|
||||||
|
*
|
||||||
|
* @ingroup Continuators
|
||||||
*/
|
*/
|
||||||
template< class EOT>
|
template< class EOT>
|
||||||
class eoEvalContinue: public eoContinue<EOT>
|
class eoEvalContinue: public eoContinue<EOT>
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ The class first call the evaluation function, then check the number of
|
||||||
times it has been called. If the maximum number of evaluation has been
|
times it has been called. If the maximum number of evaluation has been
|
||||||
reached, it throw an eoMaxEvalException. You can catch this exception
|
reached, it throw an eoMaxEvalException. You can catch this exception
|
||||||
from your main function, so as to stop everything properly.
|
from your main function, so as to stop everything properly.
|
||||||
|
|
||||||
|
@ingroup Evaluation
|
||||||
*/
|
*/
|
||||||
template < typename EOT >
|
template < typename EOT >
|
||||||
class eoEvalCounterThrowException : public eoEvalFuncCounter< EOT >
|
class eoEvalCounterThrowException : public eoEvalFuncCounter< EOT >
|
||||||
|
|
|
||||||
|
|
@ -27,17 +27,23 @@
|
||||||
|
|
||||||
#include <eoFunctor.h>
|
#include <eoFunctor.h>
|
||||||
|
|
||||||
|
/** @defgroup Evaluation Evaluation
|
||||||
|
* @ingroup Operators
|
||||||
|
*/
|
||||||
|
|
||||||
/** Evaluate: takes one EO and sets its "fitness" property
|
/** Evaluate: takes one EO and sets its "fitness" property
|
||||||
* returning this fitness also. That is why EOT is passed by
|
returning this fitness also. That is why EOT is passed by
|
||||||
* non-const reference: it must be altered within evaluate.\\
|
non-const reference: it must be altered within evaluate.\\
|
||||||
|
|
||||||
The requirements on the types with which this class is to be
|
The requirements on the types with which this class is to be
|
||||||
instantiated with are null, or else, they depend on the particular
|
instantiated with are null, or else, they depend on the particular
|
||||||
class it's going to be applied to; EO does not impose any requirement
|
class it's going to be applied to; EO does not impose any requirement
|
||||||
on it. If you subclass this abstract class, and use it to evaluate an
|
on it. If you subclass this abstract class, and use it to evaluate an
|
||||||
EO, the requirements on this EO will depend on the evaluator.
|
EO, the requirements on this EO will depend on the evaluator.
|
||||||
*/
|
|
||||||
|
|
||||||
|
@ingroup Evaluation
|
||||||
|
@ingroup Core
|
||||||
|
*/
|
||||||
template<class EOT> class eoEvalFunc : public eoUF<EOT&, void>
|
template<class EOT> class eoEvalFunc : public eoUF<EOT&, void>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,9 @@
|
||||||
#include <utils/eoParam.h>
|
#include <utils/eoParam.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Counts the number of evaluations actually performed, thus checks first
|
Counts the number of evaluations actually performed.
|
||||||
if it has to evaluate.. etc.
|
|
||||||
|
@ingroup Evaluation
|
||||||
*/
|
*/
|
||||||
template<class EOT> class eoEvalFuncCounter : public eoEvalFunc<EOT>, public eoValueParam<unsigned long>
|
template<class EOT> class eoEvalFuncCounter : public eoEvalFunc<EOT>, public eoValueParam<unsigned long>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,13 @@
|
||||||
#include <eoEvalFunc.h>
|
#include <eoEvalFunc.h>
|
||||||
#include <utils/eoParam.h>
|
#include <utils/eoParam.h>
|
||||||
|
|
||||||
|
/** @addtogroup Evaluation
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** The exception raised by eoEvalFuncCounterBounder
|
||||||
|
* when the maximum number of allowed evaluations is reached.
|
||||||
|
*/
|
||||||
class eoEvalFuncCounterBounderException : public std::exception
|
class eoEvalFuncCounterBounderException : public std::exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -20,9 +27,12 @@ private:
|
||||||
unsigned long _threshold;
|
unsigned long _threshold;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/** Counts the number of evaluations actually performed and throw an eoEvalFuncCounterBounderException
|
||||||
Counts the number of evaluations actually performed, thus checks first
|
* when the maximum number of allowed evaluations is reached.
|
||||||
if it has to evaluate.. etc.
|
*
|
||||||
|
* This eval counter permits to stop a search during a generation, without waiting for a continue to be
|
||||||
|
* checked at the end of the loop. Useful if you have 10 individuals and 10 generations,
|
||||||
|
* but want to stop after 95 evaluations.
|
||||||
*/
|
*/
|
||||||
template < typename EOT >
|
template < typename EOT >
|
||||||
class eoEvalFuncCounterBounder : public eoEvalFuncCounter< EOT >
|
class eoEvalFuncCounterBounder : public eoEvalFuncCounter< EOT >
|
||||||
|
|
@ -53,4 +63,5 @@ private :
|
||||||
unsigned long _threshold;
|
unsigned long _threshold;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @} */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue