In file EO++.h:

template <class T, class fitnessT = float> class EO : public EOBase< fitnessT >

EO: Base class for the whole hierarchy T is the type it will be instantiated with; this type must have, at least, a copy ctor, assignment operators,

Inheritance:


Public Fields

typedef T EOType

Public Methods

virtual void deleteGene( unsigned _i )
Eliminates the gene at position _i; all the other genes will be shifted left
EO( const string& _ID = "" )
Can be used as default ctor; should be called from derived classes
EO( const EO& _eo )
Copy ctor
virtual void insertGene( unsigned _i, T _val )
Inserts a gene, moving the rest to the right
virtual unsigned length()
Returns the number of genes in the EO
const EO& operator= ( const EO& _eo )
Assignment operator
virtual void printSelf( ostream& _s )
Print itself: default implementation
virtual T readGene( unsigned _i )
Reads and returns a copy of the gene in position _i This implies that T must have a copy ctor
virtual void writeGene( unsigned _i, T _val )
Overwrites the gene placed in position _i with a new value
virtual ~EO()
Needed virtual dtor

Inherited from EOBase:

Public Classes

class InvalidFitness: public UException
InvalidFitness()
Constructor

Public Fields

typedef fitnessT EOFitT

Public Methods

virtual fitnessT fitness()
virtual void fitness( fitnessT _fitness )
const string& ID()
void ID( const string& _id )

Documentation

EO: Base class for the whole hierarchy T is the type it will be instantiated with; this type must have, at least, a copy ctor, assignment operators,
typedef T EOType

EO( const string& _ID = "" )
Can be used as default ctor; should be called from derived classes. Fitness should be at birth
Parameters:
_ID - An ID string, preferably unique

EO( const EO& _eo )
Copy ctor

const EO& operator= ( const EO& _eo )
Assignment operator

virtual ~EO()
Needed virtual dtor

virtual T readGene( unsigned _i )
Reads and returns a copy of the gene in position _i This implies that T must have a copy ctor
Parameters:
_i - index of the gene, which is the minimal unit. Must be an unsigned less than length()

virtual void writeGene( unsigned _i, T _val )
Overwrites the gene placed in position _i with a new value. This means that the assignment operator for T must be defined
Parameters:
_i - index
_val - the value that will overwite the element at _i

virtual void insertGene( unsigned _i, T _val )
Inserts a gene, moving the rest to the right. If _i = length(), it should insert it at the end. Obviously, changes length
Parameters:
_i - index
_val - new value

virtual void deleteGene( unsigned _i )
Eliminates the gene at position _i; all the other genes will be shifted left
Parameters:
_i - index

virtual unsigned length()
Returns the number of genes in the EO

virtual void printSelf( ostream& _s )
Print itself: default implementation. Declared virtual so that it can be reimplemented anywhere


Direct child classes:
EOString
EOBin
EOVector

alphabetic index hierarchy of classes


BinOp