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
|
|
@ -4,7 +4,7 @@
|
|||
eoScalarFitness.h
|
||||
|
||||
(c) Maarten Keijzer (mkeijzer@mad.scientist.com) and GeNeura Team, 1999, 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
|
||||
|
|
@ -31,19 +31,16 @@
|
|||
|
||||
/**
|
||||
* eoScalarFitness<ScalarType, Compare = less<ScalarType> >:
|
||||
* Wraps a scalar fitness values such as a double or int, with the option of
|
||||
* Wraps a scalar fitness values such as a double or int, with the option of
|
||||
* maximizing (using less<ScalarType>) or minimizing (using greater<ScalarType>)
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
|
||||
* It overrides operator<() to use the Compare template argument
|
||||
*
|
||||
* Suitable constructors and assignments and casts are defined to work
|
||||
* Suitable constructors and assignments and casts are defined to work
|
||||
* with this quantity as if it were a ScalarType.
|
||||
*/
|
||||
template <class ScalarType, class Compare >
|
||||
class eoScalarFitness
|
||||
template <class ScalarType, class Compare >
|
||||
class eoScalarFitness
|
||||
{
|
||||
public :
|
||||
|
||||
|
|
@ -59,7 +56,7 @@ class eoScalarFitness
|
|||
operator ScalarType(void) const { return value; }
|
||||
|
||||
/// Comparison, using less by default
|
||||
bool operator<(const eoScalarFitness& other) const
|
||||
bool operator<(const eoScalarFitness& other) const
|
||||
{ return Compare()(value, other.value); }
|
||||
|
||||
// implementation of the other operators
|
||||
|
|
@ -77,9 +74,9 @@ class eoScalarFitness
|
|||
/**
|
||||
Typedefs for fitness comparison, Maximizing Fitness compares with less,
|
||||
and minimizing fitness compares with greater. This because we want ordinary
|
||||
fitness values (doubles) to be equivalent with Maximizing Fitness, and
|
||||
fitness values (doubles) to be equivalent with Maximizing Fitness, and
|
||||
comparing with less is the default behaviour.
|
||||
*/
|
||||
*/
|
||||
typedef eoScalarFitness<double, std::less<double> > eoMaximizingFitness;
|
||||
typedef eoScalarFitness<double, std::greater<double> > eoMinimizingFitness;
|
||||
|
||||
|
|
|
|||
Reference in a new issue