GLCrossoverVectorKeepMatching< T > Class Template Reference

#include <GLCrossoverVectorKeepMatching.h>

Inheritance diagram for GLCrossoverVectorKeepMatching< T >:

GLBaseCrossover

List of all members.

Public Member Functions

 GLCrossoverVectorKeepMatching ()
virtual ~GLCrossoverVectorKeepMatching ()
virtual void makeOffsprings (const vector< GLBaseOrganism * > &parents, vector< GLBaseOrganism * > &children)


Detailed Description

template<class T>
class GLCrossoverVectorKeepMatching< T >

Crossover which is to be applied to vector-based organisms. Takes 2 organisms of type GLOrganismVector<T> to breed and do the following: 1) For the i: org1[i] == org2[i] do nothing. 2) Shuffle randomly j: org1[j] != org2[j] It is assumed, that both organisms consist of the same set of genes which are shuffled randomly.

Definition at line 13 of file GLCrossoverVectorKeepMatching.h.


Constructor & Destructor Documentation

template<class T >
GLCrossoverVectorKeepMatching< T >::GLCrossoverVectorKeepMatching (  )  [inline]

Simple constructor.

Definition at line 19 of file GLCrossoverVectorKeepMatching.h.

template<class T >
virtual GLCrossoverVectorKeepMatching< T >::~GLCrossoverVectorKeepMatching (  )  [inline, virtual]

Destructor, destroys everything.

Definition at line 24 of file GLCrossoverVectorKeepMatching.h.


Member Function Documentation

template<class T >
void GLCrossoverVectorKeepMatching< T >::makeOffsprings ( const vector< GLBaseOrganism * > &  parents,
vector< GLBaseOrganism * > &  children 
) [inline, virtual]

Creates an offspring from the vector of parents. Takes 2 vector-based organisms and creates children by keeping matching genes in their place and randomly shuffling others.

Parameters:
parents vector of parents.
children vector of new organisms obtained from parents. Previous content will not be preserved.

Implements GLBaseCrossover.

Definition at line 20 of file GLCrossoverVectorKeepMatching.cpp.


The documentation for this class was generated from the following files:

Generated on Sat Jun 13 13:58:08 2009 for GenLib by  doxygen 1.5.9