GLInterfaceSwapSection Class Reference

#include <GLInterfaceSwapSection.h>

Inheritance diagram for GLInterfaceSwapSection:

GLOrganismVector< T >

List of all members.

Public Member Functions

virtual void swapSections (GLBaseOrganism *anotherOrganism, int leftPos, int rightPos)=0


Detailed Description

Interface for organisms which can swap sections between 2 genes.

Definition at line 7 of file GLInterfaceSwapSection.h.


Member Function Documentation

virtual void GLInterfaceSwapSection::swapSections ( GLBaseOrganism anotherOrganism,
int  leftPos,
int  rightPos 
) [pure virtual]

Swaps sections with another organism. After this method is called the current organism should have section of the anotherOrganism, while the latter will have the section of the caller. Therefore, all genes from the caller with numbers leftPos, rightPos - 1 inclusive will go to the anotherOrganism, while be replaced with the corresponding genes from anotherOrganism in caller. If rightPos == organism.getSize() the effect is equivalent to swapping tails. leftPos must be < rightPos.

Parameters:
anotherOrganism organism with which the section will be swapped.
leftPos the beginning of the section to be swapped (this gene will be swapped too).
rightPos the end of the section to be swapped (this gene will NOT be swapped).

Implemented in GLOrganismVector< T >.


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

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