Changes in docs and added stuff to eoEvalSteadyFitness to reset after using it

This commit is contained in:
jmerelo 2004-08-10 17:19:46 +00:00
commit 669f41a315
7 changed files with 33 additions and 20 deletions

View file

@ -38,8 +38,13 @@
#include <eoMergeReduce.h> #include <eoMergeReduce.h>
#include <eoReplacement.h> #include <eoReplacement.h>
/** eoEasyEA:
An easy-to-use evolutionary algorithm; you can use any chromosome,
template <class EOT> class eoIslandsEasyEA ;
template <class EOT> class eoDistEvalEasyEA ;
/** An easy-to-use evolutionary algorithm; you can use any chromosome,
and any selection transformation, merging and evaluation and any selection transformation, merging and evaluation
algorithms; you can even change in runtime parameters of those algorithms; you can even change in runtime parameters of those
sub-algorithms sub-algorithms
@ -55,13 +60,7 @@ Change (MS, July 3. 2001):
Note: it looks ugly only because we wanted to authorize many different Note: it looks ugly only because we wanted to authorize many different
constructors. Please only look at the operator() and there shall be light constructors. Please only look at the operator() and there shall be light
*/ */
template<class EOT> class eoEasyEA: public eoAlgo<EOT> {
template <class EOT> class eoIslandsEasyEA ;
template <class EOT> class eoDistEvalEasyEA ;
template<class EOT> class eoEasyEA: public eoAlgo<EOT>
{
public: public:
/** Ctor taking a breed and merge */ /** Ctor taking a breed and merge */

View file

@ -40,6 +40,7 @@ thanks to the friend class eoPopulator
@version 0.0 @version 0.0
*/ */
//@{
/** The base class for General Operators /** The base class for General Operators
Subclass this operator is you want to define an operator that falls Subclass this operator is you want to define an operator that falls
@ -220,3 +221,4 @@ class eoQuadGenOp : public eoGenOp<EOT>
#endif #endif
//@}

View file

@ -18,7 +18,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact: todos@geneura.ugr.es, http://geneura.ugr.es Contact: todos@geneura.ugr.es, http://geneura.ugr.es
CVS Info: $Date: 2003-02-27 19:25:56 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/eoOp.h,v 1.28 2003-02-27 19:25:56 okoenig Exp $ $Author: okoenig $ CVS Info: $Date: 2004-08-10 17:19:46 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/eoOp.h,v 1.29 2004-08-10 17:19:46 jmerelo Exp $ $Author: jmerelo $
*/ */
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -54,6 +54,7 @@ how to build them from a description in a file.
@see eoGenOp.h eoOpFactory @see eoGenOp.h eoOpFactory
*/ */
//@{
/** Abstract data types for EO operators. /** Abstract data types for EO operators.
Genetic operators act on chromosomes, changing them. Genetic operators act on chromosomes, changing them.
@ -166,3 +167,4 @@ private:
#endif #endif
//@}

View file

@ -30,7 +30,7 @@
#include <eoOp.h> #include <eoOp.h>
#include <utils/eoRNG.h> #include <utils/eoRNG.h>
/** /**
\defgroup PropCombined operators \defgroup PropCombinedOperators
Combination of same-type Genetic Operators - Proportional choice Combination of same-type Genetic Operators - Proportional choice
*/ */

View file

@ -68,6 +68,11 @@ MS 12/12/2000
eoWeakElitistReplacement a wrapper to add elitism eoWeakElitistReplacement a wrapper to add elitism
*/ */
//@{
///
template<class EOT> template<class EOT>
class eoReplacement : public eoBF<eoPop<EOT>&, eoPop<EOT>&, void> class eoReplacement : public eoBF<eoPop<EOT>&, eoPop<EOT>&, void>
{}; {};
@ -118,4 +123,6 @@ private:
eoReplacement<EOT> & replace; eoReplacement<EOT> & replace;
}; };
//@}
#endif #endif

View file

@ -37,12 +37,11 @@
#include <utils/eoRNG.h> #include <utils/eoRNG.h>
#include <eoTransform.h> #include <eoTransform.h>
/** *************************************************************************** /** eoSGATransform: transforms a population using genetic operators.
* eoSGATransform: transforms a population using genetic operators.
* 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
*****************************************************************************/ */
template<class EOT> class eoSGATransform : public eoTransform<EOT> template<class EOT> class eoSGATransform : public eoTransform<EOT>
{ {
public: public:
@ -90,8 +89,7 @@ template<class EOT> class eoSGATransform : public eoTransform<EOT>
double mutationProba; double mutationProba;
}; };
/** *************************************************************************** /** eoDynSGATransform: transforms a population using genetic operators.
* eoDynSGATransform: transforms a population using genetic operators.
* It is the Dynamic version of the above eoSGATransform * It is the Dynamic version of the above eoSGATransform
* 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

View file

@ -84,10 +84,15 @@ public:
virtual void totalGenerations( unsigned long _mg, unsigned long _sg ) { virtual void totalGenerations( unsigned long _mg, unsigned long _sg ) {
repMinGenerations = _mg; repMinGenerations = _mg;
repSteadyGenerations = _sg; repSteadyGenerations = _sg;
thisGeneration = 0; reset();
steadyState = false;
}; };
/// Resets the state after it's been reached
virtual void reset () {
steadyState=false;
thisGeneration = 0;
}
/** accessors*/ /** accessors*/
virtual unsigned long minGenerations( ) virtual unsigned long minGenerations( )
{ return repMinGenerations; }; { return repMinGenerations; };