Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.framework.operators
Class DoubleArrayCrossover

java.lang.Object
  extended by org.uncommons.watchmaker.framework.operators.AbstractCrossover<double[]>
      extended by org.uncommons.watchmaker.framework.operators.DoubleArrayCrossover
All Implemented Interfaces:
EvolutionaryOperator<double[]>

public class DoubleArrayCrossover
extends AbstractCrossover<double[]>

Cross-over with a configurable number of points (fixed or random) for arrays of primitive doubles.

Author:
Daniel Dyer

Constructor Summary
DoubleArrayCrossover()
          Default is single-point cross-over, applied to all parents.
DoubleArrayCrossover(int crossoverPoints)
          Cross-over with a fixed number of cross-over points.
DoubleArrayCrossover(int crossoverPoints, Probability crossoverProbability)
          Cross-over with a fixed number of cross-over points.
DoubleArrayCrossover(NumberGenerator<Integer> crossoverPointsVariable)
          Cross-over with a variable number of cross-over points.
DoubleArrayCrossover(NumberGenerator<Integer> crossoverPointsVariable, NumberGenerator<Probability> crossoverProbabilityVariable)
          Sets up a cross-over implementation that uses a variable number of cross-over points.
 
Method Summary
protected  List<double[]> mate(double[] parent1, double[] parent2, int numberOfCrossoverPoints, Random rng)
          Perform cross-over on a pair of parents to generate a pair of offspring.
 
Methods inherited from class org.uncommons.watchmaker.framework.operators.AbstractCrossover
apply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleArrayCrossover

public DoubleArrayCrossover()
Default is single-point cross-over, applied to all parents.


DoubleArrayCrossover

public DoubleArrayCrossover(int crossoverPoints)
Cross-over with a fixed number of cross-over points.

Parameters:
crossoverPoints - The constant number of cross-over points to use for all cross-over operations.

DoubleArrayCrossover

public DoubleArrayCrossover(int crossoverPoints,
                            Probability crossoverProbability)
Cross-over with a fixed number of cross-over points. Cross-over may or may not be applied to a given pair of parents depending on the crossoverProbability.

Parameters:
crossoverPoints - The constant number of cross-over points to use for all cross-over operations.
crossoverProbability - The probability that, once selected, a pair of parents will be subjected to cross-over rather than being copied, unchanged, into the output population.

DoubleArrayCrossover

public DoubleArrayCrossover(NumberGenerator<Integer> crossoverPointsVariable)
Cross-over with a variable number of cross-over points.

Parameters:
crossoverPointsVariable - A random variable that provides a number of cross-over points for each cross-over operation.

DoubleArrayCrossover

public DoubleArrayCrossover(NumberGenerator<Integer> crossoverPointsVariable,
                            NumberGenerator<Probability> crossoverProbabilityVariable)
Sets up a cross-over implementation that uses a variable number of cross-over points. Cross-over is applied to a proportion of selected parent pairs, with the remainder copied unchanged into the output population. The size of this evolved proportion is controlled by the crossoverProbabilityVariable parameter.

Parameters:
crossoverPointsVariable - A variable that provides a (possibly constant, possibly random) number of cross-over points for each cross-over operation.
crossoverProbabilityVariable - A variable that controls the probability that, once selected, a pair of parents will be subjected to cross-over rather than being copied, unchanged, into the output population.
Method Detail

mate

protected List<double[]> mate(double[] parent1,
                              double[] parent2,
                              int numberOfCrossoverPoints,
                              Random rng)
Perform cross-over on a pair of parents to generate a pair of offspring.

Specified by:
mate in class AbstractCrossover<double[]>
Parameters:
parent1 - One of two individuals that provides the source material for generating offspring.
parent2 - One of two individuals that provides the source material for generating offspring.
numberOfCrossoverPoints - The number of cross-overs performed on the two parents.
rng - A source of randomness used to determine the location of cross-over points.
Returns:
A list containing two evolved offspring.

Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)