Crossover Class Reference

Performs crossover on individual pairs. More...

#include <Crossover.hpp>

List of all members.

Public Member Functions

 Crossover (int iTries=5)
bool crossover (Individual &ind1, Individual &ind2)


Detailed Description

Performs crossover on individual pairs.

Author:
Stephen E. Baker
Date:
2006-2007
Version:
1.0


Constructor & Destructor Documentation

Crossover::Crossover ( int  iTries = 5  ) 

Creates a new object capable of performing crossover

Parameters:
[in] iTries The number of attempted swaps which may come back as invalid before the crossover is aborted


Member Function Documentation

bool Crossover::crossover ( Individual ind1,
Individual ind2 
)

Swaps a subtree in ind1 with a subtree in ind2 where the parent grammar symbol is the same (and thus the swap is valid). If the swap is invalid (ie. violates depth restrictions on either individual, another random swap is made.

Returns:
  • true - the crossover was performed successfully
  • false - the try limit was exceeded without a valid crossover


The documentation for this class was generated from the following files:
Generated on Mon Jan 15 01:21:04 2007 for Creatively Named Grammar Guided Genetic Programming System by  doxygen 1.4.7