#include <GLInterfaceSwapSection.h>
Public Member Functions | |
virtual void | swapSections (GLBaseOrganism *anotherOrganism, int leftPos, int rightPos)=0 |
Definition at line 7 of file GLInterfaceSwapSection.h.
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.
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 >.