eoVector is back (eoFixedLength and eoVariableLength are gone)
Also: introducing eoRndGenerators.h for eoRndGenerator derived classes: eoNormalGenerator eoUniformGenerator eoBooleanGenerator eoNegExpGenerator Note the suffix that are added to aid in determining what these classes do
This commit is contained in:
parent
e0ace0794f
commit
025eb736ee
19 changed files with 222 additions and 350 deletions
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef _eoEsFull_h
|
||||
#define _eoEsFull_h
|
||||
|
||||
#include <eoFixedLength.h>
|
||||
#include <eoVector.h>
|
||||
|
||||
/**
|
||||
\ingroup EvolutionStrategies
|
||||
|
|
@ -37,32 +37,32 @@ rates and correlated mutations.
|
|||
*/
|
||||
|
||||
template <class Fit>
|
||||
class eoEsFull : public eoFixedLength<Fit, double>
|
||||
class eoEsFull : public eoVector<Fit, double>
|
||||
{
|
||||
public :
|
||||
typedef double Type;
|
||||
|
||||
eoEsFull(void) : eoFixedLength<Fit, double>() {}
|
||||
|
||||
|
||||
eoEsFull(void) : eoVector<Fit, double>() {}
|
||||
|
||||
std::string className(void) const { return "eoEsFull"; }
|
||||
|
||||
void printOn(std::ostream& os) const
|
||||
{
|
||||
eoFixedLength<Fit,double>::printOn(os);
|
||||
eoVector<Fit,double>::printOn(os);
|
||||
|
||||
os << ' ';
|
||||
std::copy(stdevs.begin(), stdevs.end(), std::ostream_iterator<double>(os, " "));
|
||||
|
||||
|
||||
os << ' ';
|
||||
|
||||
std::copy(correlations.begin(), correlations.end(), std::ostream_iterator<double>(os, " "));
|
||||
|
||||
|
||||
os << ' ';
|
||||
}
|
||||
|
||||
void readFrom(istream& is)
|
||||
{
|
||||
eoFixedLength<Fit,double>::readFrom(is);
|
||||
eoVector<Fit,double>::readFrom(is);
|
||||
|
||||
stdevs.resize(size());
|
||||
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@
|
|||
#include <EO.h>
|
||||
#include <vector>
|
||||
|
||||
#include <eoFixedLength.h>
|
||||
#include <eoVector.h>
|
||||
|
||||
/**
|
||||
\ingroup EvolutionStrategies
|
||||
|
||||
One of the more simple evolution strategies, sporting just a single
|
||||
stdeviation for the entire chromosome. For more advanced versions
|
||||
stdeviation for the entire chromosome. For more advanced versions
|
||||
see also eoEsStdev eoEsFull
|
||||
|
||||
@see eoEsStdev eoEsFull
|
||||
|
|
@ -44,26 +44,26 @@ see also eoEsStdev eoEsFull
|
|||
*/
|
||||
|
||||
template <class Fit>
|
||||
class eoEsSimple : public eoFixedLength<Fit, double>
|
||||
class eoEsSimple : public eoVector<Fit, double>
|
||||
{
|
||||
public :
|
||||
|
||||
typedef double Type;
|
||||
|
||||
eoEsSimple(void) : eoFixedLength<Fit, double>() {}
|
||||
eoEsSimple(void) : eoVector<Fit, double>() {}
|
||||
|
||||
std::string className(void) const { return "eoEsSimple"; }
|
||||
|
||||
void printOn(std::ostream& os) const
|
||||
{
|
||||
eoFixedLength<Fit,double>::printOn(os);
|
||||
eoVector<Fit,double>::printOn(os);
|
||||
|
||||
os << ' ' << stdev << ' ';
|
||||
}
|
||||
|
||||
void readFrom(istream& is)
|
||||
{
|
||||
eoFixedLength<Fit,double>::readFrom(is);
|
||||
eoVector<Fit,double>::readFrom(is);
|
||||
|
||||
is >> stdev;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,39 +27,39 @@
|
|||
#ifndef _eoEsStdev_h
|
||||
#define _eoEsStdev_h
|
||||
|
||||
#include <eoFixedLength.h>
|
||||
#include <eoVector.h>
|
||||
|
||||
/**
|
||||
\ingroup EvolutionStrategies
|
||||
|
||||
Evolutionary strategie style representation, supporting co-evolving standard
|
||||
deviations.
|
||||
deviations.
|
||||
*/
|
||||
|
||||
template <class Fit>
|
||||
class eoEsStdev : public eoFixedLength<Fit, double>
|
||||
class eoEsStdev : public eoVector<Fit, double>
|
||||
{
|
||||
public :
|
||||
|
||||
|
||||
typedef double Type;
|
||||
|
||||
eoEsStdev(void) : eoFixedLength<Fit, double>() {}
|
||||
eoEsStdev(void) : eoVector<Fit, double>() {}
|
||||
|
||||
std::string className(void) const { return "eoEsStdev"; }
|
||||
|
||||
|
||||
void printOn(std::ostream& os) const
|
||||
{
|
||||
eoFixedLength<Fit,double>::printOn(os);
|
||||
|
||||
eoVector<Fit,double>::printOn(os);
|
||||
|
||||
os << ' ';
|
||||
std::copy(stdevs.begin(), stdevs.end(), std::ostream_iterator<double>(os, " "));
|
||||
|
||||
|
||||
os << ' ';
|
||||
}
|
||||
|
||||
void readFrom(istream& is)
|
||||
{
|
||||
eoFixedLength<Fit,double>::readFrom(is);
|
||||
eoVector<Fit,double>::readFrom(is);
|
||||
stdevs.resize(size());
|
||||
|
||||
unsigned i;
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@
|
|||
#include <iostream> // ostream, istream
|
||||
#include <string> // string
|
||||
|
||||
#include <eoFixedLength.h>
|
||||
#include <eoVector.h>
|
||||
|
||||
/** eoReal: implementation of simple real-valued chromosome.
|
||||
* based on eoFixedLength class
|
||||
* based on eoVector class
|
||||
*/
|
||||
template <class FitT> class eoReal: public eoFixedLength<FitT, double>
|
||||
template <class FitT> class eoReal: public eoVector<FitT, double>
|
||||
{
|
||||
public:
|
||||
|
||||
|
|
@ -42,15 +42,15 @@ template <class FitT> class eoReal: public eoFixedLength<FitT, double>
|
|||
* (Default) Constructor.
|
||||
* @param size Size of the vector
|
||||
*/
|
||||
eoReal(unsigned size = 0, double value = 0.0):
|
||||
eoFixedLength<FitT, double>(size, value) {}
|
||||
|
||||
eoReal(unsigned size = 0, double value = 0.0):
|
||||
eoVector<FitT, double>(size, value) {}
|
||||
|
||||
/// My class name.
|
||||
string className() const
|
||||
{
|
||||
return "eoReal";
|
||||
string className() const
|
||||
{
|
||||
return "eoReal";
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Reference in a new issue