GLCrossoverTwoPoints Class Reference

#include <GLCrossoverTwoPoints.h>

Inheritance diagram for GLCrossoverTwoPoints:

GLBaseCrossover

List of all members.

Public Member Functions

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


Detailed Description

Class for two-point crossover -- swaps the section of organisms between 2 genes. Organisms should implement GLInterfaceSwapSection.

Definition at line 10 of file GLCrossoverTwoPoints.h.


Constructor & Destructor Documentation

GLCrossoverTwoPoints::GLCrossoverTwoPoints (  )  [inline]

Simple empty constructor.

Definition at line 16 of file GLCrossoverTwoPoints.h.

virtual GLCrossoverTwoPoints::~GLCrossoverTwoPoints (  )  [inline, virtual]

Destructor. Destroys everything.

Definition at line 20 of file GLCrossoverTwoPoints.h.


Member Function Documentation

void GLCrossoverTwoPoints::makeOffsprings ( const vector< GLBaseOrganism * > &  parents,
vector< GLBaseOrganism * > &  children 
) [virtual]

Creates an 2 offsprings from 2 parents by swapping sections bounded by randomly chosen 2 points.

Parameters:
parents vector of parents. Must contain only 2 elements each of them implementing GLInterfaceSwapSections.
children vector of new organisms obtained from parents. Previous content will not be preserved.

Implements GLBaseCrossover.

Definition at line 16 of file GLCrossoverTwoPoints.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