Removed eoEsBase and created an eoFixedLength
This commit is contained in:
parent
71b0dc1771
commit
152d42d41e
5 changed files with 20 additions and 20 deletions
|
|
@ -1,59 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// eoEsBase.h
|
||||
// (c) GeNeura Team, 2000 - EEAAX 1999 - Maarten Keijzer 2000
|
||||
/*
|
||||
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: todos@geneura.ugr.es, http://geneura.ugr.es
|
||||
Marc.Schoenauer@polytechnique.fr
|
||||
mak@dhi.dk
|
||||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _eoEsBase_h
|
||||
#define _eoEsBase_h
|
||||
|
||||
/**
|
||||
\ingroup EvolutionStrategies
|
||||
|
||||
Base class for evolution strategies, just derives from EO and vector and
|
||||
redirects the operator< to EO (fitness based comparison)
|
||||
*/
|
||||
|
||||
template <class FitT>
|
||||
class eoEsBase : public EO<FitT>, public std::vector<double>
|
||||
{
|
||||
public :
|
||||
|
||||
typedef double Type;
|
||||
|
||||
/// to avoid conflicts between EO::operator< and vector<double>::operator<
|
||||
bool operator<(const eoEsBase<FitT>& _eo) const
|
||||
{
|
||||
return EO<FitT>::operator<(_eo);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/// to avoid conflicts between EO::operator< and vector<double>::operator<
|
||||
template <class FitT>
|
||||
bool operator<(const eoEsBase<FitT>& _eo1, const eoEsBase<FitT>& _eo2)
|
||||
{
|
||||
return _eo1.operator<(_eo2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef _eoEsFull_h
|
||||
#define _eoEsFull_h
|
||||
|
||||
#include <es/eoEsBase.h>
|
||||
#include <eoFixedLength.h>
|
||||
|
||||
/**
|
||||
\ingroup EvolutionStrategies
|
||||
|
|
@ -37,11 +37,11 @@ rates and correlated mutations.
|
|||
*/
|
||||
|
||||
template <class Fit>
|
||||
class eoEsFull : public eoEsBase<Fit>
|
||||
class eoEsFull : public eoFixedLength<Fit, double>
|
||||
{
|
||||
public :
|
||||
|
||||
eoEsFull(void) : eoEsBase<Fit>() {}
|
||||
eoEsFull(void) : eoFixedLength<Fit, double>() {}
|
||||
|
||||
std::string className(void) const { return "eoEsFull"; }
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ public:
|
|||
keepInBounds(_eo);
|
||||
}
|
||||
|
||||
void keepInBounds(eoEsBase<FitT>& _eo) const
|
||||
void keepInBounds(eoFixedLength<FitT, double>& _eo) const
|
||||
{
|
||||
for (unsigned i = 0; i < _eo.size(); ++i)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#include <EO.h>
|
||||
#include <vector>
|
||||
|
||||
#include <es/eoEsBase.h>
|
||||
#include <eoFixedLength.h>
|
||||
|
||||
/**
|
||||
\ingroup EvolutionStrategies
|
||||
|
|
@ -44,11 +44,11 @@ see also eoEsStdev eoEsFull
|
|||
*/
|
||||
|
||||
template <class Fit>
|
||||
class eoEsSimple : public eoEsBase<Fit>
|
||||
class eoEsSimple : public eoFixedLength<Fit, double>
|
||||
{
|
||||
public :
|
||||
|
||||
eoEsSimple(void) : eoEsBase<Fit>() {}
|
||||
eoEsSimple(void) : eoFixedLength<Fit, double>() {}
|
||||
|
||||
std::string className(void) const { return "eoEsSimple"; }
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef _eoEsStdev_h
|
||||
#define _eoEsStdev_h
|
||||
|
||||
#include <es/eoEsBase.h>
|
||||
#include <eoFixedLength.h>
|
||||
|
||||
/**
|
||||
\ingroup EvolutionStrategies
|
||||
|
|
@ -37,11 +37,11 @@ deviations.
|
|||
*/
|
||||
|
||||
template <class Fit>
|
||||
class eoEsStdev : public eoEsBase<Fit>
|
||||
class eoEsStdev : public eoFixedLength<Fit, double>
|
||||
{
|
||||
public :
|
||||
|
||||
eoEsStdev(void) : eoEsBase<Fit>() {}
|
||||
eoEsStdev(void) : eoFixedLength<Fit, double>() {}
|
||||
|
||||
std::string className(void) const { return "eoEsStdev"; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue