EvolvingObjects
eoVector< FitT, GeneType > Class Template Reference

Base class for fixed length chromosomes. More...

#include <eoVector.h>

Inheritance diagram for eoVector< FitT, GeneType >:
EO< FitT > vector eoObject eoPersistent eoPrintable

List of all members.

Public Types

typedef GeneType AtomType
typedef std::vector< GeneType > ContainerType

Public Member Functions

 eoVector (unsigned _size=0, GeneType _value=GeneType())
 default constructor
template<class OtherFitnessType >
 eoVector (const eoVector< OtherFitnessType, GeneType > &_vec)
 copy ctor abstracting from the FitT
void value (const std::vector< GeneType > &_v)
bool operator< (const eoVector< FitT, GeneType > &_eo) const
 to avoid conflicts between EO::operator< and std::vector<GeneType>::operator<
virtual void printOn (std::ostream &os) const
 printing...
virtual void readFrom (std::istream &is)
 reading...

Detailed Description

template<class FitT, class GeneType>
class eoVector< FitT, GeneType >

Base class for fixed length chromosomes.

It just derives from EO and std::vector and redirects the smaller than operator to EO (fitness based comparison).

GeneType must have the following methods: void ctor (needed for the std::vector<>), copy ctor,

Examples:
t-eoSSGA.cpp, and t-eoVector.cpp.

Definition at line 53 of file eoVector.h.


Constructor & Destructor Documentation

template<class FitT, class GeneType>
eoVector< FitT, GeneType >::eoVector ( unsigned  _size = 0,
GeneType  _value = GeneType() 
) [inline]

default constructor

Parameters:
_sizeLength of vector (default is 0)
_valueInitial value of all elements (default is default value of type GeneType)

Definition at line 72 of file eoVector.h.


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