eoOrderXover< Chrom > Class Template Reference

apply orderXover on two chromosomes. More...

#include <eoOrderXover.h>

Inheritance diagram for eoOrderXover< Chrom >:

eoQuadOp< Chrom > eoOp< Chrom > eoBF< Chrom &, Chrom &, bool > eoFunctorBase

List of all members.

Public Member Functions

virtual std::string className () const
 The class name.
bool operator() (Chrom &_chrom1, Chrom &_chrom2)

Private Member Functions

void cross (Chrom &_chrom1, Chrom &_chrom2, Chrom &_child, char _direction, unsigned _cut1, unsigned _cut2)


Detailed Description

template<class Chrom>
class eoOrderXover< Chrom >

apply orderXover on two chromosomes.

Example: With 2 parents p1= [1,2,4,3,6,5], p2= [4,5,3,1,6,2] It applies a random cut between ("|") two indices. Example: the second element and the fourth: p1 : [1|2,4,3|6,5] and p2 : [4|5,3,1|6,2] generate two children: c1 = [2,4,3,6,5,1] 2,4,3 taken from p1 and 6,5,1 from p2 c2 = [5,3,1,6,2,4] 5,3,1 taken from p2 and 6,2,4 from p1

Definition at line 24 of file eoOrderXover.h.


Member Function Documentation

template<class Chrom>
bool eoOrderXover< Chrom >::operator() ( Chrom &  _chrom1,
Chrom &  _chrom2 
) [inline, virtual]

Returns:
true if the chromosome has changed
Parameters:
_chrom1 The first chromosome which will be crossed with chrom2.
_chrom2 The second chromosome which will be crossed with chrom1.

Implements eoBF< Chrom &, Chrom &, bool >.

Definition at line 35 of file eoOrderXover.h.

References eoOrderXover< Chrom >::cross().

template<class Chrom>
void eoOrderXover< Chrom >::cross ( Chrom &  _chrom1,
Chrom &  _chrom2,
Chrom &  _child,
char  _direction,
unsigned  _cut1,
unsigned  _cut2 
) [inline, private]

Parameters:
_chrom1 The first parent chromosome.
_chrom2 The second parent chromosome.
_child The result chromosome.
_direction The direction of the OrderXover (left: -1 or right: 1)

Definition at line 60 of file eoOrderXover.h.

Referenced by eoOrderXover< Chrom >::operator()().


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

Generated on Thu Jan 1 23:19:48 2009 for EvolvingObjects by  doxygen 1.5.5