EvolvingObjects
eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits > Class Template Reference

Implements fitness as std::vector, storing all values that might occur during fitness assembly. More...

#include <eoScalarFitnessAssembled.h>

Inheritance diagram for eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits >:
vector

List of all members.

Public Types

typedef std::vector< ScalarType > baseVector
typedef baseVector::size_type size_type

Public Member Functions

 eoScalarFitnessAssembled (size_type _n, const ScalarType &_val, const std::string &_descr="Unnamed variable")
 eoScalarFitnessAssembled (const eoScalarFitnessAssembled &other)
eoScalarFitnessAssembledoperator= (const eoScalarFitnessAssembled &other)
 eoScalarFitnessAssembled (const ScalarType &v)
eoScalarFitnessAssembledoperator= (const ScalarType &v)
void push_back (const ScalarType &_val)
 Overload push_back()
void push_back (const ScalarType &_val, const std::string &_descr)
 Overload push_back()
void resize (size_type _n, const ScalarType &_val=ScalarType(), const std::string &_descr="Unnamed variable")
 Overload resize()
void setDescription (size_type _idx, std::string _descr)
 Set description.
std::string getDescription (size_type _idx)
 Get description.
std::vector< std::string > getDescriptionVector ()
 Get vector with descriptions.
 operator ScalarType (void) const
void printAll (std::ostream &os) const
 Print term values and descriptions.
bool operator< (const eoScalarFitnessAssembled &other) const
 Comparison, using less by default.
bool operator< (ScalarType x) const
 Comparison with ScalarTypes. Explicit definition needed to compile with VS 8.0.
bool operator> (const eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits > &y) const
bool operator<= (const eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits > &y) const
bool operator>= (const eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits > &y) const

Public Attributes

bool feasible
 Feasibility boolean.
bool failed
 Failed boolean.
std::string msg
 Message.

Detailed Description

template<class ScalarType, class Compare, class FitnessTraits>
class eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits >

Implements fitness as std::vector, storing all values that might occur during fitness assembly.

Properties:

  • Wraps a scalar fitness values such as a double or int, with the option of maximizing (using less<ScalarType>) or minimizing (using greater<ScalarType>).
  • Stores all kinda different values met during fitness assembly, to be defined in eoEvalFunc.
  • It overrides operator<() to use the Compare template argument.
  • Suitable constructors and assignments and casts are defined to work with this quantity as if it were a ScalarType.
  • Global fitness value is stored as first element in the vector
Examples:
t-eoFitnessAssembled.cpp.

Definition at line 94 of file eoScalarFitnessAssembled.h.


Member Data Documentation

template<class ScalarType, class Compare, class FitnessTraits>
bool eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits >::feasible

Feasibility boolean.

Can be specified anywhere in fitness evaluation as an indicator if the individual is in some feasible range.

Definition at line 187 of file eoScalarFitnessAssembled.h.

template<class ScalarType, class Compare, class FitnessTraits>
bool eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits >::failed

Failed boolean.

Can be specified anywhere in fitness evaluation as an indicator if the evaluation of the individual failed

Definition at line 194 of file eoScalarFitnessAssembled.h.

template<class ScalarType, class Compare, class FitnessTraits>
std::string eoScalarFitnessAssembled< ScalarType, Compare, FitnessTraits >::msg

Message.

Can be specified anywhere in fitness evaluation. Typically used to store some sort of error messages, if evaluation of individual failed.

Definition at line 201 of file eoScalarFitnessAssembled.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends