Adding Evolution Strategies:
src/es/eoEsGlobalXover.h and src/es/eoEsLocalXover.h for crossover src/es/make_XXX_es.h for user-input test/t-eoEsAll.cpp to test However, an old bug appeared: className was not const in eoGenOp (and derived classes) so I had to change that throughtout the hierarchy
This commit is contained in:
parent
4a152dc172
commit
10064ad967
28 changed files with 471 additions and 180 deletions
|
|
@ -63,7 +63,7 @@ class eoGenOp : public eoOp<EOT>, public eoUF<eoPopulator<EOT> &, void>
|
||||||
*/
|
*/
|
||||||
virtual unsigned max_production(void) = 0;
|
virtual unsigned max_production(void) = 0;
|
||||||
|
|
||||||
virtual string className() = 0;
|
virtual string className() const = 0;
|
||||||
void operator()(eoPopulator<EOT>& _pop)
|
void operator()(eoPopulator<EOT>& _pop)
|
||||||
{
|
{
|
||||||
_pop.reserve(max_production());
|
_pop.reserve(max_production());
|
||||||
|
|
@ -93,7 +93,7 @@ class eoMonGenOp : public eoGenOp<EOT>
|
||||||
(*_it).invalidate(); // look how simple
|
(*_it).invalidate(); // look how simple
|
||||||
|
|
||||||
}
|
}
|
||||||
string className() {return op.className();}
|
virtual string className() const {return op.className();}
|
||||||
private :
|
private :
|
||||||
eoMonOp<EOT>& op;
|
eoMonOp<EOT>& op;
|
||||||
};
|
};
|
||||||
|
|
@ -120,7 +120,7 @@ class eoBinGenOp : public eoGenOp<EOT>
|
||||||
if (op(a, b))
|
if (op(a, b))
|
||||||
a.invalidate();
|
a.invalidate();
|
||||||
}
|
}
|
||||||
string className() {return op.className();}
|
virtual string className() const {return op.className();}
|
||||||
|
|
||||||
private :
|
private :
|
||||||
eoBinOp<EOT>& op;
|
eoBinOp<EOT>& op;
|
||||||
|
|
@ -141,7 +141,7 @@ class eoSelBinGenOp : public eoGenOp<EOT>
|
||||||
if (op(*_pop, sel(_pop.source())))
|
if (op(*_pop, sel(_pop.source())))
|
||||||
(*_pop).invalidate();
|
(*_pop).invalidate();
|
||||||
}
|
}
|
||||||
string className() {return op.className();}
|
virtual string className() const {return op.className();}
|
||||||
|
|
||||||
private :
|
private :
|
||||||
eoBinOp<EOT>& op;
|
eoBinOp<EOT>& op;
|
||||||
|
|
@ -170,7 +170,7 @@ class eoQuadGenOp : public eoGenOp<EOT>
|
||||||
b.invalidate();
|
b.invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string className() {return op.className();}
|
virtual string className() const {return op.className();}
|
||||||
|
|
||||||
private :
|
private :
|
||||||
eoQuadOp<EOT>& op;
|
eoQuadOp<EOT>& op;
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class eoGeneralBreeder: public eoBreed<EOT>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoGeneralBreeder"; }
|
virtual string className() const { return "eoGeneralBreeder"; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
eoSelectOne<EOT>& select;
|
eoSelectOne<EOT>& select;
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ class eoOpContainer : public eoGenOp<EOT>
|
||||||
max_to_produce = max(max_to_produce,ops.back()->max_production());
|
max_to_produce = max(max_to_produce,ops.back()->max_production());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual string className() = 0;
|
virtual string className() const = 0;
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
|
|
||||||
|
|
@ -122,7 +122,7 @@ class eoSequentialOp : public eoOpContainer<EOT>
|
||||||
while (!_pop.exhausted());
|
while (!_pop.exhausted());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual string className() {return "SequentialOp";}
|
virtual string className() const {return "SequentialOp";}
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ class eoProportionalOp : public eoOpContainer<EOT>
|
||||||
catch(eoPopulator<EOT>::OutOfIndividuals&)
|
catch(eoPopulator<EOT>::OutOfIndividuals&)
|
||||||
{}
|
{}
|
||||||
}
|
}
|
||||||
virtual string className() {return "ProportionalOp";}
|
virtual string className() const {return "ProportionalOp";}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ libes_a_SOURCES = make_algo_scalar_real.cpp make_checkpoint_real.cpp \
|
||||||
make_continue_real.cpp make_genotype_real.cpp \
|
make_continue_real.cpp make_genotype_real.cpp \
|
||||||
make_op_real.cpp make_pop_real.cpp make_run_real.cpp \
|
make_op_real.cpp make_pop_real.cpp make_run_real.cpp \
|
||||||
make_algo_scalar_es.cpp make_checkpoint_es.cpp \
|
make_algo_scalar_es.cpp make_checkpoint_es.cpp \
|
||||||
make_continue_es.cpp make_pop_es.cpp make_run_es.cpp
|
make_continue_es.cpp make_genotype_es.cpp \
|
||||||
|
make_op_es.cpp make_pop_es.cpp make_run_es.cpp
|
||||||
|
|
||||||
CPPFLAGS = -Wall
|
CPPFLAGS = -Wall
|
||||||
CXXFLAGS = -g
|
CXXFLAGS = -g
|
||||||
|
|
|
||||||
|
|
@ -27,13 +27,10 @@
|
||||||
#ifndef _eoEsChromInit_H
|
#ifndef _eoEsChromInit_H
|
||||||
#define _eoEsChromInit_H
|
#define _eoEsChromInit_H
|
||||||
|
|
||||||
#include <utils/eoRealBounds.h>
|
#include <es/eoRealInitBounded.h>
|
||||||
#include <es/eoEsSimple.h>
|
#include <es/eoEsSimple.h>
|
||||||
#include <es/eoEsStdev.h>
|
#include <es/eoEsStdev.h>
|
||||||
#include <es/eoEsFull.h>
|
#include <es/eoEsFull.h>
|
||||||
#include <utils/eoRNG.h>
|
|
||||||
|
|
||||||
#include <eoInit.h>
|
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI 3.1415926535897932384626433832795
|
#define M_PI 3.1415926535897932384626433832795
|
||||||
|
|
@ -44,90 +41,85 @@
|
||||||
|
|
||||||
Random Es-chromosome initializer (therefore derived from eoInit)
|
Random Es-chromosome initializer (therefore derived from eoInit)
|
||||||
|
|
||||||
This class can initialize three types of Es's:
|
This class can initialize four types of real-valued genotypes
|
||||||
|
thanks to tempate specialization of private method create
|
||||||
|
|
||||||
eoEsSimple
|
eoReal just an eoVector<double>
|
||||||
eoEsStdev
|
eoEsSimple + one self-adapting single sigma for all variables
|
||||||
eoEsFull
|
eoEsStdev a whole vector of self-adapting sigmas
|
||||||
|
eoEsFull a full self-adapting correlation matrix
|
||||||
|
|
||||||
@see eoEsSimple eoEsStdev eoEsFull eoInit
|
@see eoReal eoEsSimple eoEsStdev eoEsFull eoInit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
class eoEsChromInit : public eoInit<EOT>
|
class eoEsChromInit : public eoRealInitBounded<EOT>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
typedef typename EOT::Fitness FitT;
|
typedef typename EOT::Fitness FitT;
|
||||||
|
|
||||||
eoEsChromInit(eoRealVectorBounds& _bounds) : bounds(_bounds)
|
eoEsChromInit(eoRealVectorBounds& _bounds, double _sigma = 0.3) :
|
||||||
{}
|
eoRealInitBounded<EOT>(_bounds), sigma(_sigma) {}
|
||||||
|
|
||||||
void operator()(EOT& _eo)
|
void operator()(EOT& _eo)
|
||||||
{
|
{
|
||||||
create(_eo);
|
eoRealInitBounded<EOT>::operator()(_eo);
|
||||||
}
|
create_self_adapt(_eo);
|
||||||
|
_eo.invalidate(); // was MISSING!!!!
|
||||||
|
}
|
||||||
|
|
||||||
|
// accessor to sigma
|
||||||
|
double sigmaInit() {return sigma;}
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
|
||||||
eoEsSimple<FitT>& create(eoEsSimple<FitT>& result)
|
// No adaptive mutation at all
|
||||||
{
|
void create_self_adapt(eoReal<FitT>& result)// security check :-)
|
||||||
result.resize(bounds.size());
|
{
|
||||||
|
throw runtime_error("We should not be in create_self_adapt(eoReal)!");
|
||||||
|
}
|
||||||
|
|
||||||
bounds.uniform(result);
|
// Adaptive mutation through a unique sigma
|
||||||
|
void create_self_adapt(eoEsSimple<FitT>& result)
|
||||||
|
{
|
||||||
|
// sigma is scaled by the average range (if that means anything!)
|
||||||
|
result.stdev = sigma;
|
||||||
|
}
|
||||||
|
|
||||||
result.stdev = 0.3*bounds.averageRange(); // 0.3 should be read as a parameter
|
// Adaptive mutation through a vector of sigmas
|
||||||
|
void create_self_adapt(eoEsStdev<FitT>& result)
|
||||||
|
{
|
||||||
|
unsigned theSize = eoRealInitBounded<EOT>::size();
|
||||||
|
result.stdevs.resize(theSize);
|
||||||
|
for (unsigned i = 0; i < theSize; ++i)
|
||||||
|
{
|
||||||
|
// should we scale sigmas to the corresponding object variable range?
|
||||||
|
result.stdevs[i] = sigma;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
// Adaptive mutation through a whole correlation matrix
|
||||||
}
|
void create_self_adapt(eoEsFull<FitT>& result)
|
||||||
|
{
|
||||||
|
unsigned theSize = eoRealInitBounded<EOT>::size();
|
||||||
|
|
||||||
eoEsStdev<FitT> create(eoEsStdev<FitT>& result)
|
result.stdevs.resize(theSize);
|
||||||
{
|
for (unsigned i = 0; i < theSize; ++i)
|
||||||
unsigned chromSize = bounds.size();
|
{
|
||||||
result.resize(chromSize);
|
// should we scale sigmas to the corresponding object variable range?
|
||||||
result.stdevs.resize(chromSize);
|
result.stdevs[i] = sigma;
|
||||||
|
}
|
||||||
bounds.uniform(result);
|
|
||||||
for (unsigned i = 0; i < chromSize; ++i)
|
|
||||||
{
|
|
||||||
// uniformly in [0.2,0.4)
|
|
||||||
// scaled by the range of the object variable)
|
|
||||||
// Just a guess (anyone a better idea?)
|
|
||||||
result.stdevs[i] = bounds.range(i) * (0.2 + 0.2*eo::rng.uniform());
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
eoEsFull<FitT> create(eoEsFull<FitT>& result)
|
|
||||||
{
|
|
||||||
unsigned chromSize = bounds.size();
|
|
||||||
result.resize(chromSize);
|
|
||||||
result.stdevs.resize(chromSize);
|
|
||||||
|
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
for (i = 0; i < chromSize; ++i)
|
|
||||||
{
|
|
||||||
double length = bounds.maximum(i) - bounds.minimum(i);
|
|
||||||
result[i] = bounds.minimum(i) + rng.uniform(length);
|
|
||||||
|
|
||||||
// Just a guess at the stdevs (anyone a better idea?)
|
// nb of rotation angles: N*(N-1)/2 (in general!)
|
||||||
result.stdevs[i] = rng.uniform(length);
|
result.correlations.resize(theSize*(theSize - 1) / 2);
|
||||||
}
|
for (unsigned i = 0; i < result.correlations.size(); ++i)
|
||||||
|
{
|
||||||
// nb of rotation angles: N*(N-1)/2 (in general!)
|
// uniform in [-PI, PI)
|
||||||
result.correlations.resize(chromSize*(chromSize - 1) / 2);
|
result.correlations[i] = rng.uniform(2 * M_PI) - M_PI;
|
||||||
|
}
|
||||||
for (i = 0; i < result.correlations.size(); ++i)
|
}
|
||||||
{
|
|
||||||
// And another random guess for random initialization
|
|
||||||
result.correlations[i] = rng.uniform(2 * M_PI) - M_PI;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
double sigma; // initial value for sigmas
|
||||||
}
|
|
||||||
|
|
||||||
eoRealVectorBounds& bounds;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class eoEsFull : public eoVector<Fit, double>
|
||||||
|
|
||||||
eoEsFull(void) : eoVector<Fit, double>() {}
|
eoEsFull(void) : eoVector<Fit, double>() {}
|
||||||
|
|
||||||
std::string className(void) const { return "eoEsFull"; }
|
virtual std::string className(void) const { return "eoEsFull"; }
|
||||||
|
|
||||||
void printOn(std::ostream& os) const
|
void printOn(std::ostream& os) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
139
eo/src/es/eoEsGlobalXover.h
Normal file
139
eo/src/es/eoEsGlobalXover.h
Normal file
|
|
@ -0,0 +1,139 @@
|
||||||
|
/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// eoEsGlobalXover.h : ES global crossover
|
||||||
|
// (c) Marc Schoenauer 2001
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
Contact: marc.schoenauer@polytechnique.fr http://eeaax.cmap.polytchnique.fr/
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _eoEsGlobalXover_H
|
||||||
|
#define _eoEsGlobalXover_H
|
||||||
|
|
||||||
|
#include <utils/eoRNG.h>
|
||||||
|
|
||||||
|
#include <es/eoEsSimple.h>
|
||||||
|
#include <es/eoEsStdev.h>
|
||||||
|
#include <es/eoEsFull.h>
|
||||||
|
|
||||||
|
#include <eoGenOp.h>
|
||||||
|
// needs a selector - here random
|
||||||
|
#include <eoRandomSelect.h>
|
||||||
|
|
||||||
|
/** Gloabl crossover operator for ES genotypes.
|
||||||
|
* Uses some Atom crossovers to handle both the object variables
|
||||||
|
* and the mutation strategy parameters
|
||||||
|
*/
|
||||||
|
template<class EOT>
|
||||||
|
class eoEsGlobalXover: public eoGenOp<EOT>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef typename EOT::Fitness FitT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (Default) Constructor.
|
||||||
|
*/
|
||||||
|
eoEsGlobalXover(eoBinOp<double> & _crossObj, eoBinOp<double> & _crossMut) :
|
||||||
|
crossObj(_crossObj), crossMut(_crossMut) {}
|
||||||
|
|
||||||
|
/// The class name. Used to display statistics
|
||||||
|
virtual string className() const { return "eoEsGlobalXover"; }
|
||||||
|
|
||||||
|
/// The TOTAL number of offspring (here = nb of parents modified in place)
|
||||||
|
unsigned max_production(void) { return 1; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modifies one parents in the populator
|
||||||
|
* using 2 new parents for each component!
|
||||||
|
*
|
||||||
|
* @param _pop a POPULATOR (not a simple population)
|
||||||
|
*/
|
||||||
|
void apply(eoPopulator<EOT>& _plop)
|
||||||
|
{
|
||||||
|
// First, select as many parents as you will have offspring
|
||||||
|
EOT& parent = *_plop; // select the first parent
|
||||||
|
|
||||||
|
// first, the object variables
|
||||||
|
for (unsigned i=0; i<parent.size(); i++)
|
||||||
|
{
|
||||||
|
// get extra parents - use private selector
|
||||||
|
// _plop.source() is the eoPop<EOT> used by _plop to get parents
|
||||||
|
const EOT& realParent1 = sel(_plop.source());
|
||||||
|
const EOT& realParent2 = sel(_plop.source());
|
||||||
|
parent[i] = realParent1[i];
|
||||||
|
crossObj(parent[i], realParent2[i]); // apply eoBinOp
|
||||||
|
}
|
||||||
|
// then the self-adaptation parameters
|
||||||
|
cross_self_adapt(parent, _plop.source());
|
||||||
|
// dont' forget to invalidate
|
||||||
|
parent.invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// the method to cross slef-adaptation parameters: need to specialize
|
||||||
|
|
||||||
|
void cross_self_adapt(eoEsSimple<FitT> & _parent, const eoPop<eoEsSimple<FitT> >& _pop)
|
||||||
|
{
|
||||||
|
const EOT& realParent1 = sel(_pop);
|
||||||
|
const EOT& realParent2 = sel(_pop);
|
||||||
|
_parent.stdev = realParent1.stdev;
|
||||||
|
crossMut(_parent.stdev, realParent2.stdev); // apply eoBinOp
|
||||||
|
}
|
||||||
|
|
||||||
|
void cross_self_adapt(eoEsStdev<FitT> & _parent, const eoPop<eoEsStdev<FitT> >& _pop)
|
||||||
|
{
|
||||||
|
for (unsigned i=0; i<_parent.size(); i++)
|
||||||
|
{
|
||||||
|
const EOT& realParent1 = sel(_pop);
|
||||||
|
const EOT& realParent2 = sel(_pop);
|
||||||
|
_parent.stdevs[i] = realParent1.stdevs[i];
|
||||||
|
crossMut(_parent.stdevs[i], realParent2.stdevs[i]); // apply eoBinOp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cross_self_adapt(eoEsFull<FitT> & _parent, const eoPop<eoEsFull<FitT> >& _pop)
|
||||||
|
{
|
||||||
|
unsigned i;
|
||||||
|
// the StDev
|
||||||
|
for (i=0; i<_parent.size(); i++)
|
||||||
|
{
|
||||||
|
const EOT& realParent1 = sel(_pop);
|
||||||
|
const EOT& realParent2 = sel(_pop);
|
||||||
|
_parent.stdevs[i] = realParent1.stdevs[i];
|
||||||
|
crossMut(_parent.stdevs[i], realParent2.stdevs[i]); // apply eoBinOp
|
||||||
|
}
|
||||||
|
// the roataion angles
|
||||||
|
for (i=0; i<_parent.correlations.size(); i++)
|
||||||
|
{
|
||||||
|
const EOT& realParent1 = sel(_pop);
|
||||||
|
const EOT& realParent2 = sel(_pop);
|
||||||
|
_parent.correlations[i] = realParent1.correlations[i];
|
||||||
|
crossMut(_parent.correlations[i], realParent2.correlations[i]); // apply eoBinOp
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// the data
|
||||||
|
eoRandomSelect<EOT> sel;
|
||||||
|
eoBinOp<double> & crossObj;
|
||||||
|
eoBinOp<double> & crossMut;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
124
eo/src/es/eoEsLocalXover.h
Normal file
124
eo/src/es/eoEsLocalXover.h
Normal file
|
|
@ -0,0 +1,124 @@
|
||||||
|
/** -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// eoEsLocalXover.h : ES global crossover
|
||||||
|
// (c) Marc Schoenauer 2001
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
Contact: marc.schoenauer@polytechnique.fr http://eeaax.cmap.polytchnique.fr/
|
||||||
|
*/
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _eoEsLocalXover_H
|
||||||
|
#define _eoEsLocalXover_H
|
||||||
|
|
||||||
|
#include <utils/eoRNG.h>
|
||||||
|
|
||||||
|
#include <es/eoEsSimple.h>
|
||||||
|
#include <es/eoEsStdev.h>
|
||||||
|
#include <es/eoEsFull.h>
|
||||||
|
|
||||||
|
#include <eoGenOp.h>
|
||||||
|
// needs a selector - here random
|
||||||
|
#include <eoRandomSelect.h>
|
||||||
|
|
||||||
|
/** Local (i.e. std eoBinOp) crossover operator for ES genotypes.
|
||||||
|
* Uses some Atom crossovers to handle both the object variables
|
||||||
|
* and the mutation strategy parameters
|
||||||
|
* It is an eoGenOp and not an eoBinOp for consistency with the global version
|
||||||
|
*/
|
||||||
|
template<class EOT>
|
||||||
|
class eoEsLocalXover: public eoGenOp<EOT>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef typename EOT::Fitness FitT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (Default) Constructor.
|
||||||
|
*/
|
||||||
|
eoEsLocalXover(eoBinOp<double> & _crossObj, eoBinOp<double> & _crossMut) :
|
||||||
|
crossObj(_crossObj), crossMut(_crossMut) {}
|
||||||
|
|
||||||
|
/// The class name. Used to display statistics
|
||||||
|
virtual string className() const { return "eoEsLocalXover"; }
|
||||||
|
|
||||||
|
/// The TOTAL number of offspring (here = nb of parents modified in place)
|
||||||
|
unsigned max_production(void) { return 1; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* modifies one parents in the populator
|
||||||
|
* using a second parent
|
||||||
|
*
|
||||||
|
* @param _pop a POPULATOR (not a simple population)
|
||||||
|
*/
|
||||||
|
void apply(eoPopulator<EOT>& _plop)
|
||||||
|
{
|
||||||
|
// First, select as many parents as you will have offspring
|
||||||
|
EOT& parent1 = *_plop; // select the first parent
|
||||||
|
const EOT& parent2 = sel(_plop.source()); // and the second, randomly
|
||||||
|
|
||||||
|
// first, the object variables
|
||||||
|
for (unsigned i=0; i<parent1.size(); i++)
|
||||||
|
{
|
||||||
|
crossObj(parent1[i], parent2[i]); // apply eoBinOp
|
||||||
|
}
|
||||||
|
// then the self-adaptation parameters
|
||||||
|
cross_self_adapt(parent1, parent2);
|
||||||
|
// dont' forget to invalidate
|
||||||
|
parent1.invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// the method to cross slef-adaptation parameters: need to specialize
|
||||||
|
|
||||||
|
void cross_self_adapt(eoEsSimple<FitT> & _parent1, const eoEsSimple<FitT> & _parent2)
|
||||||
|
{
|
||||||
|
crossMut(_parent1.stdev, _parent2.stdev); // apply eoBinOp
|
||||||
|
}
|
||||||
|
|
||||||
|
void cross_self_adapt(eoEsStdev<FitT> & _parent1, const eoEsStdev<FitT> & _parent2)
|
||||||
|
{
|
||||||
|
for (unsigned i=0; i<_parent1.size(); i++)
|
||||||
|
{
|
||||||
|
crossMut(_parent1.stdevs[i], _parent2.stdevs[i]); // apply eoBinOp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cross_self_adapt(eoEsFull<FitT> & _parent1, const eoEsFull<FitT> & _parent2)
|
||||||
|
{
|
||||||
|
unsigned i;
|
||||||
|
// the StDev
|
||||||
|
for (i=0; i<_parent1.size(); i++)
|
||||||
|
{
|
||||||
|
crossMut(_parent1.stdevs[i], _parent2.stdevs[i]); // apply eoBinOp
|
||||||
|
}
|
||||||
|
// the roataion angles
|
||||||
|
for (i=0; i<_parent1.correlations.size(); i++)
|
||||||
|
{
|
||||||
|
crossMut(_parent1.correlations[i], _parent2.correlations[i]); // apply eoBinOp
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// the data
|
||||||
|
eoRandomSelect<EOT> sel;
|
||||||
|
eoBinOp<double> & crossObj;
|
||||||
|
eoBinOp<double> & crossMut;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -122,11 +122,11 @@ public:
|
||||||
|
|
||||||
virtual bool operator()( eoEsStdev<FitT>& _eo )
|
virtual bool operator()( eoEsStdev<FitT>& _eo )
|
||||||
{
|
{
|
||||||
double global = exp(TauGlb * rng.normal());
|
double global = TauGlb * rng.normal();
|
||||||
for (unsigned i = 0; i < _eo.size(); i++)
|
for (unsigned i = 0; i < _eo.size(); i++)
|
||||||
{
|
{
|
||||||
double stdev = _eo.stdevs[i];
|
double stdev = _eo.stdevs[i];
|
||||||
stdev *= global * exp(TauLcl * rng.normal());
|
stdev *= exp( global + TauLcl * rng.normal() );
|
||||||
|
|
||||||
if (stdev < stdev_eps)
|
if (stdev < stdev_eps)
|
||||||
stdev = stdev_eps;
|
stdev = stdev_eps;
|
||||||
|
|
@ -135,7 +135,7 @@ public:
|
||||||
_eo[i] += stdev * rng.normal();
|
_eo[i] += stdev * rng.normal();
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds.foldsInBounds(_eo);
|
bounds.foldsInBounds(_eo);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -158,12 +158,12 @@ public:
|
||||||
* First: mutate standard deviations (as above).
|
* First: mutate standard deviations (as above).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
double global = exp(TauGlb * rng.normal());
|
double global = TauGlb * rng.normal();
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < _eo.size(); i++)
|
for (i = 0; i < _eo.size(); i++)
|
||||||
{
|
{
|
||||||
double stdev = _eo.stdevs[i];
|
double stdev = _eo.stdevs[i];
|
||||||
stdev *= global * exp(TauLcl * rng.normal());
|
stdev *= exp( global + TauLcl*rng.normal() );
|
||||||
|
|
||||||
if (stdev < stdev_eps)
|
if (stdev < stdev_eps)
|
||||||
stdev = stdev_eps;
|
stdev = stdev_eps;
|
||||||
|
|
@ -229,7 +229,8 @@ public:
|
||||||
{
|
{
|
||||||
unsigned size = bounds.size();
|
unsigned size = bounds.size();
|
||||||
TauLcl = _init.TauLcl();
|
TauLcl = _init.TauLcl();
|
||||||
TauLcl /= sqrt((double) size);
|
TauLcl /= sqrt(2*(double) size);
|
||||||
|
cout << "Init<eoEsSimple>: tau local " << TauLcl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(eoEsStdev<FitT>, eoEsMutationInit& _init)
|
void init(eoEsStdev<FitT>, eoEsMutationInit& _init)
|
||||||
|
|
@ -242,12 +243,14 @@ public:
|
||||||
// renormalization
|
// renormalization
|
||||||
TauLcl /= sqrt( 2.0 * sqrt( (double)size ) );
|
TauLcl /= sqrt( 2.0 * sqrt( (double)size ) );
|
||||||
TauGlb /= sqrt( 2.0 * ( (double) size ) );
|
TauGlb /= sqrt( 2.0 * ( (double) size ) );
|
||||||
|
cout << "Init<eoStDev>: tau local " << TauLcl << " et global " << TauGlb << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(eoEsFull<FitT>, eoEsMutationInit& _init)
|
void init(eoEsFull<FitT>, eoEsMutationInit& _init)
|
||||||
{
|
{
|
||||||
init(eoEsStdev<FitT>(), _init);
|
init(eoEsStdev<FitT>(), _init);
|
||||||
TauBeta = _init.TauBeta();
|
TauBeta = _init.TauBeta();
|
||||||
|
cout << "Init<eoEsFull>: tau local " << TauLcl << " et global " << TauGlb << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the data
|
// the data
|
||||||
|
|
@ -264,14 +267,5 @@ public:
|
||||||
template <class EOT>
|
template <class EOT>
|
||||||
const double eoEsMutate<EOT>::stdev_eps = 1.0e-40;
|
const double eoEsMutate<EOT>::stdev_eps = 1.0e-40;
|
||||||
|
|
||||||
/*
|
|
||||||
* Correlated mutations in ESs, according to the following
|
|
||||||
* sources:
|
|
||||||
* H.-P. Schwefel: Internal Report of KFA Juelich, KFA-STE-IB-3/80
|
|
||||||
* p. 43, 1980
|
|
||||||
* G. Rudolph: Globale Optimierung mit parallelen Evolutions-
|
|
||||||
* strategien, Diploma Thesis, University of Dortmund, 1990
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,19 @@ class eoEsMutationInit
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
eoEsMutationInit(eoParameterLoader& _parser) : parser(_parser), TauLclParam(0), TauGlbParam(0), TauBetaParam(0) {}
|
eoEsMutationInit(eoParameterLoader& _parser,
|
||||||
|
std::string _section="ES mutation parameters" ) :
|
||||||
|
parser(_parser), repSection(_section),
|
||||||
|
TauLclParam(0), TauGlbParam(0), TauBetaParam(0) {}
|
||||||
|
|
||||||
|
// because we have virtual function - size
|
||||||
|
virtual ~eoEsMutationInit(){}
|
||||||
|
|
||||||
double TauLcl(void)
|
double TauLcl(void)
|
||||||
{
|
{
|
||||||
if (TauLclParam == 0)
|
if (TauLclParam == 0)
|
||||||
{
|
{
|
||||||
TauLclParam = &parser.createParam(1.0, TauLclName(), "Local Tau", TauLclShort(), section());
|
TauLclParam = &parser.createParam(1.0, TauLclName(), "Local Tau (before normalization)", TauLclShort(), section());
|
||||||
}
|
}
|
||||||
|
|
||||||
return TauLclParam->value();
|
return TauLclParam->value();
|
||||||
|
|
@ -63,7 +69,7 @@ class eoEsMutationInit
|
||||||
{
|
{
|
||||||
if (TauGlbParam == 0)
|
if (TauGlbParam == 0)
|
||||||
{
|
{
|
||||||
TauGlbParam = &parser.createParam(1.0, TauGlbName(), "Global Tau", TauGlbShort(), section());
|
TauGlbParam = &parser.createParam(1.0, TauGlbName(), "Global Tau (before normalization)", TauGlbShort(), section());
|
||||||
}
|
}
|
||||||
|
|
||||||
return TauGlbParam->value();
|
return TauGlbParam->value();
|
||||||
|
|
@ -82,7 +88,7 @@ class eoEsMutationInit
|
||||||
protected :
|
protected :
|
||||||
|
|
||||||
virtual std::string section(void)
|
virtual std::string section(void)
|
||||||
{ return "Parameters of ES mutation (before renormalization)"; }
|
{ return repSection; }
|
||||||
|
|
||||||
virtual std::string TauLclName(void) const { return "TauLcL"; }
|
virtual std::string TauLclName(void) const { return "TauLcL"; }
|
||||||
virtual char TauLclShort(void) const { return 'l'; }
|
virtual char TauLclShort(void) const { return 'l'; }
|
||||||
|
|
@ -95,11 +101,11 @@ class eoEsMutationInit
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
|
||||||
eoParameterLoader& parser;
|
eoParameterLoader& parser;
|
||||||
|
std::string repSection;
|
||||||
eoValueParam<double>* TauLclParam;
|
eoValueParam<double>* TauLclParam;
|
||||||
eoValueParam<double>* TauGlbParam;
|
eoValueParam<double>* TauGlbParam;
|
||||||
eoValueParam<double>* TauBetaParam;
|
eoValueParam<double>* TauBetaParam;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public :
|
||||||
|
|
||||||
eoEsSimple(void) : eoVector<Fit, double>() {}
|
eoEsSimple(void) : eoVector<Fit, double>() {}
|
||||||
|
|
||||||
std::string className(void) const { return "eoEsSimple"; }
|
virtual std::string className(void) const { return "eoEsSimple"; }
|
||||||
|
|
||||||
void printOn(std::ostream& os) const
|
void printOn(std::ostream& os) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class eoEsStdev : public eoVector<Fit, double>
|
||||||
|
|
||||||
eoEsStdev(void) : eoVector<Fit, double>() {}
|
eoEsStdev(void) : eoVector<Fit, double>() {}
|
||||||
|
|
||||||
std::string className(void) const { return "eoEsStdev"; }
|
virtual std::string className(void) const { return "eoEsStdev"; }
|
||||||
|
|
||||||
void printOn(std::ostream& os) const
|
void printOn(std::ostream& os) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ public :
|
||||||
eoQuadOp<vector<double> > & _stdDevXOver) :
|
eoQuadOp<vector<double> > & _stdDevXOver) :
|
||||||
objectXOver(_objectXOver), stdDevXOver(_stdDevXOver) {}
|
objectXOver(_objectXOver), stdDevXOver(_stdDevXOver) {}
|
||||||
|
|
||||||
std::string className(void) const { return "eoEsStdevXOver"; }
|
virtual std::string className(void) const { return "eoEsStdevXOver"; }
|
||||||
|
|
||||||
bool operator()(EOT & _eo1, EOT & _eo2)
|
bool operator()(EOT & _eo1, EOT & _eo2)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ template<class EOT> class eoGenericUniformMutation: public eoMonOp<EOT>
|
||||||
bounds(_bounds), epsilon(_epsilon), p_change(_p_change) {}
|
bounds(_bounds), epsilon(_epsilon), p_change(_p_change) {}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoGenericUniformMutation"; }
|
virtual string className() const { return "eoGenericUniformMutation"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do it!
|
* Do it!
|
||||||
|
|
@ -140,7 +140,7 @@ template<class EOT> class eoGenericDetUniformMutation:
|
||||||
bounds(_bounds), epsilon(_epsilon), no(_no) {}
|
bounds(_bounds), epsilon(_epsilon), no(_no) {}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoGenericDetUniformMutation"; }
|
virtual string className() const { return "eoGenericDetUniformMutation"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do it!
|
* Do it!
|
||||||
|
|
@ -208,7 +208,7 @@ template<class EOT> class eoGenericSegmentCrossover: public eoQuadOp<EOT>
|
||||||
bounds(_bounds), alpha(_alpha), range(1+2*_alpha) {}
|
bounds(_bounds), alpha(_alpha), range(1+2*_alpha) {}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoGenericSegmentCrossover"; }
|
virtual string className() const { return "eoGenericSegmentCrossover"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* segment crossover - modifies both parents
|
* segment crossover - modifies both parents
|
||||||
|
|
@ -307,7 +307,7 @@ template<class EOT> class eoGenericArithmeticCrossover:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoGenericArithmeticCrossover"; }
|
virtual string className() const { return "eoGenericArithmeticCrossover"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* arithmetical crossover - modifies both parents
|
* arithmetical crossover - modifies both parents
|
||||||
|
|
@ -383,7 +383,7 @@ template<class EOT> class eoGenericRealUxOver: public eoQuadOp<EOT>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoRealUxOver"; }
|
virtual string className() const { return "eoRealUxOver"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uniform crossover for real vectors
|
* Uniform crossover for real vectors
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ template<class EOT> class eoNormalMutation: public eoMonOp<EOT>
|
||||||
sigma(_sigma), bounds(_bounds), p_change(_p_change) {}
|
sigma(_sigma), bounds(_bounds), p_change(_p_change) {}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoNormalMutation"; }
|
virtual string className() const { return "eoNormalMutation"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do it!
|
* Do it!
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ template <class FitT> class eoReal: public eoVector<FitT, double>
|
||||||
eoVector<FitT, double>(size, value) {}
|
eoVector<FitT, double>(size, value) {}
|
||||||
|
|
||||||
/// My class name.
|
/// My class name.
|
||||||
string className() const
|
virtual string className() const
|
||||||
{
|
{
|
||||||
return "eoReal";
|
return "eoReal";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,21 +33,30 @@
|
||||||
#include <es/eoReal.h>
|
#include <es/eoReal.h>
|
||||||
#include <utils/eoRealBounds.h>
|
#include <utils/eoRealBounds.h>
|
||||||
|
|
||||||
template <class FitT>
|
/** Simple initialization for any EOT that derives from vector<double>
|
||||||
class eoRealInitBounded : public eoInit<eoReal<FitT> >
|
* uniformly in some bounds
|
||||||
|
*/
|
||||||
|
template <class EOT>
|
||||||
|
class eoRealInitBounded : public eoInit<EOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** Ctor - from eoRealVectorBounds */
|
/** Ctor - from eoRealVectorBounds */
|
||||||
eoRealInitBounded(eoRealVectorBounds & _bounds):bounds(_bounds) {}
|
eoRealInitBounded(eoRealVectorBounds & _bounds):bounds(_bounds)
|
||||||
|
{
|
||||||
|
if (!bounds.isBounded())
|
||||||
|
throw runtime_error("Needs bounded bounds to initialize a vector<double>");
|
||||||
|
}
|
||||||
|
|
||||||
/** simply passes the argument to the uniform method of the bounds */
|
/** simply passes the argument to the uniform method of the bounds */
|
||||||
virtual void operator()(eoReal<FitT>& _eo)
|
virtual void operator()(EOT & _eo)
|
||||||
{
|
{
|
||||||
bounds.uniform(_eo); // fills _eo with uniform values in bounds
|
bounds.uniform(_eo); // resizes, and fills uniformly in bounds
|
||||||
|
_eo.invalidate(); // was MISSING!!!!
|
||||||
}
|
}
|
||||||
|
|
||||||
/** accessor to the bounds */
|
/** accessor to the bounds */
|
||||||
const eoRealVectorBounds & theBounds() {return bounds;}
|
virtual eoRealVectorBounds & theBounds() {return bounds;}
|
||||||
|
virtual unsigned size(){return bounds.size();}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
eoRealVectorBounds & bounds;
|
eoRealVectorBounds & bounds;
|
||||||
|
|
@ -55,5 +64,5 @@ class eoRealInitBounded : public eoInit<eoReal<FitT> >
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//@}
|
//@}
|
||||||
#endif eoRealOp_h
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ template<class EOT> class eoUniformMutation: public eoMonOp<EOT>
|
||||||
p_change(_p_change) {}
|
p_change(_p_change) {}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoUniformMutation"; }
|
virtual string className() const { return "eoUniformMutation"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do it!
|
* Do it!
|
||||||
|
|
@ -191,7 +191,7 @@ template<class EOT> class eoDetUniformMutation: public eoMonOp<EOT>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoDetUniformMutation"; }
|
virtual string className() const { return "eoDetUniformMutation"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do it!
|
* Do it!
|
||||||
|
|
@ -273,7 +273,7 @@ template<class EOT> class eoSegmentCrossover: public eoQuadOp<EOT>
|
||||||
bounds(_bounds), alpha(_alpha), range(1+2*_alpha) {}
|
bounds(_bounds), alpha(_alpha), range(1+2*_alpha) {}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoSegmentCrossover"; }
|
virtual string className() const { return "eoSegmentCrossover"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* segment crossover - modifies both parents
|
* segment crossover - modifies both parents
|
||||||
|
|
@ -371,7 +371,7 @@ template<class EOT> class eoArithmeticCrossover: public eoQuadOp<EOT>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoArithmeticCrossover"; }
|
virtual string className() const { return "eoArithmeticCrossover"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* arithmetical crossover - modifies both parents
|
* arithmetical crossover - modifies both parents
|
||||||
|
|
@ -448,7 +448,7 @@ template<class EOT> class eoRealUxOver: public eoQuadOp<EOT>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The class name.
|
/// The class name.
|
||||||
string className() const { return "eoRealUxOver"; }
|
virtual string className() const { return "eoRealUxOver"; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uniform crossover for real vectors
|
* Uniform crossover for real vectors
|
||||||
|
|
|
||||||
|
|
@ -57,18 +57,31 @@
|
||||||
#include <es/eoEsStdev.h> // one sigmal per object variable
|
#include <es/eoEsStdev.h> // one sigmal per object variable
|
||||||
#include <es/eoEsFull.h> // full correlation matrix per indi
|
#include <es/eoEsFull.h> // full correlation matrix per indi
|
||||||
|
|
||||||
|
// include all similar declaration for eoReal - i.e. real-valued genotyes
|
||||||
|
// without self-adaptation
|
||||||
|
#include <es/make_real.h>
|
||||||
|
|
||||||
//Representation dependent - rewrite everything anew for each representation
|
//Representation dependent - rewrite everything anew for each representation
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|
||||||
/*
|
|
||||||
// the genotypes
|
// the genotypes
|
||||||
eoInit<eoEsSimple<double> > & make_genotype(eoParameterLoader& _parser, eoState& _state, double _d);
|
eoRealInitBounded<eoEsSimple<double> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoEsSimple<double> _eo);
|
||||||
eoInit<eoEsSimple<eoMinimizingFitness> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoMinimizingFitness _d);
|
eoRealInitBounded<eoEsSimple<eoMinimizingFitness> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoEsSimple<eoMinimizingFitness> _eo);
|
||||||
|
|
||||||
|
eoRealInitBounded<eoEsStdev<double> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoEsStdev<double> _eo);
|
||||||
|
eoRealInitBounded<eoEsStdev<eoMinimizingFitness> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoEsStdev<eoMinimizingFitness> _eo);
|
||||||
|
|
||||||
|
eoRealInitBounded<eoEsFull<double> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoEsFull<double> _eo);
|
||||||
|
eoRealInitBounded<eoEsFull<eoMinimizingFitness> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoEsFull<eoMinimizingFitness> _eo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// the operators
|
// the operators
|
||||||
eoGenOp<eoEsStdev<double> >& make_op(eoParameterLoader& _parser, eoState& _state, eoInit<eoEsStdev<double> >& _init);
|
eoGenOp<eoEsSimple<double> >& make_op(eoParameterLoader& _parser, eoState& _state, eoRealInitBounded<eoEsSimple<double> >& _init);
|
||||||
eoGenOp<eoEsStdev<eoMinimizingFitness> >& make_op(eoParameterLoader& _parser, eoState& _state, eoInit<eoEsStdev<eoMinimizingFitness> >& _init);
|
eoGenOp<eoEsSimple<eoMinimizingFitness> >& make_op(eoParameterLoader& _parser, eoState& _state, eoRealInitBounded<eoEsSimple<eoMinimizingFitness> >& _init);
|
||||||
*/
|
eoGenOp<eoEsStdev<double> >& make_op(eoParameterLoader& _parser, eoState& _state, eoRealInitBounded<eoEsStdev<double> >& _init);
|
||||||
|
eoGenOp<eoEsStdev<eoMinimizingFitness> >& make_op(eoParameterLoader& _parser, eoState& _state, eoRealInitBounded<eoEsStdev<eoMinimizingFitness> >& _init);
|
||||||
|
eoGenOp<eoEsFull<double> >& make_op(eoParameterLoader& _parser, eoState& _state, eoRealInitBounded<eoEsFull<double> >& _init);
|
||||||
|
eoGenOp<eoEsFull<eoMinimizingFitness> >& make_op(eoParameterLoader& _parser, eoState& _state, eoRealInitBounded<eoEsFull<eoMinimizingFitness> >& _init);
|
||||||
|
|
||||||
//Representation INdependent
|
//Representation INdependent
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,11 @@
|
||||||
|
|
||||||
/// The following function merely call the templatized do_* functions
|
/// The following function merely call the templatized do_* functions
|
||||||
|
|
||||||
eoInit<eoReal<double> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoReal<double> _eo)
|
eoEsChromInit<eoReal<double> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoReal<double> _eo)
|
||||||
{
|
{
|
||||||
return do_make_genotype(_parser, _state, _eo);
|
return do_make_genotype(_parser, _state, _eo);
|
||||||
}
|
}
|
||||||
eoInit<eoReal<eoMinimizingFitness> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoReal<eoMinimizingFitness> _eo)
|
eoEsChromInit<eoReal<eoMinimizingFitness> > & make_genotype(eoParameterLoader& _parser, eoState& _state, eoReal<eoMinimizingFitness> _eo)
|
||||||
{
|
{
|
||||||
return do_make_genotype(_parser, _state, _eo);
|
return do_make_genotype(_parser, _state, _eo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue