org.jgap.impl
Class AveragingCrossoverOperator

java.lang.Object
  extended byorg.jgap.impl.AveragingCrossoverOperator
All Implemented Interfaces:
GeneticOperator, java.io.Serializable

public class AveragingCrossoverOperator
extends java.lang.Object
implements GeneticOperator

The averaging crossover operator randomly selects two Chromosomes from the population and "mates" them by randomly picking a gene and then swapping that gene and all subsequent genes between the two Chromosomes. The two modified Chromosomes are then added to the list of candidate Chromosomes. This operation is performed half as many times as there are Chromosomes in the population. Additionally, the loci of crossing over are cached for each index, i.e., after randomizing the loci for each index once, they don't change again

Since:
2.0
Author:
Klaus Meffert
See Also:
Serialized Form

Constructor Summary
AveragingCrossoverOperator()
          Using the same random generator for randomizing the loci for crossing over as for selecting the genes to be crossed over
AveragingCrossoverOperator(IUniversalRateCalculator a_crossoverRateCalculator)
          Constructs a new instance of this CrossoverOperator with a specified crossover rate calculator, which results in dynamic crossover being turned on.
AveragingCrossoverOperator(RandomGenerator generatorForAveraging)
          Using a different random generator for randomizing the loci for crossing over than for selecting the genes to be crossed over
 
Method Summary
 void operate(Population a_population, java.util.List a_candidateChromosomes)
          Crossover that acts as a perturbed mean of two individuals.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AveragingCrossoverOperator

public AveragingCrossoverOperator()
Using the same random generator for randomizing the loci for crossing over as for selecting the genes to be crossed over

Since:
2.0

AveragingCrossoverOperator

public AveragingCrossoverOperator(RandomGenerator generatorForAveraging)
Using a different random generator for randomizing the loci for crossing over than for selecting the genes to be crossed over

Parameters:
generatorForAveraging - RandomGenerator
Since:
2.0

AveragingCrossoverOperator

public AveragingCrossoverOperator(IUniversalRateCalculator a_crossoverRateCalculator)
Constructs a new instance of this CrossoverOperator with a specified crossover rate calculator, which results in dynamic crossover being turned on.

Parameters:
a_crossoverRateCalculator - calculator for dynamic crossover rate computation
Since:
2.0
Method Detail

operate

public void operate(Population a_population,
                    java.util.List a_candidateChromosomes)
Crossover that acts as a perturbed mean of two individuals. x_i = p*x1_i + (1-p)*x2_i p - uniform random value over [0,1]. Averaging over line means p is same for every i, averaging over space if different p is chosen for each i.

Specified by:
operate in interface GeneticOperator
Parameters:
a_population - Chromosome[]
a_candidateChromosomes - List
Since:
2.0
See Also:
for general description. also see feature request 708774