edu.udo.cs.yale.operator.features.selection
Class SelectionCrossover

java.lang.Object
  extended by edu.udo.cs.yale.operator.features.selection.SelectionCrossover
All Implemented Interfaces:
PopulationOperator
Direct Known Subclasses:
UnbalancedCrossover

public class SelectionCrossover
extends java.lang.Object
implements PopulationOperator

Crossover operator for the used bitlists of example sets. An example set is selected with a given fixed propability and a mating partner is determined randomly. Crossover can be either one point, uniform or shuffled. Please note that shuffled crossover first uniformly determines the number of attributes which should be swapped. Therefore uniform and shuffle crossover are not equivalent.
Only useful if all example sets have the same (number of) attributes.

Version:
$Id: SelectionCrossover.java,v 1.1 2006/04/14 07:47:17 ingomierswa Exp $
Author:
Simon Fischer, Ingo Mierswa

Field Summary
static java.lang.String[] CROSSOVER_TYPES
           
static int ONE_POINT
           
private  double prob
           
private  java.util.Random random
           
static int SHUFFLE
           
private  int type
           
static int UNIFORM
           
 
Constructor Summary
SelectionCrossover(int type, double prob, java.util.Random random)
           
 
Method Summary
 void crossover(AttributeWeightedExampleSet es1, AttributeWeightedExampleSet es2)
           
 int getType()
           
 void operate(Population population)
          Modifies the population.
 boolean performOperation(int generation)
          The default implementation returns true for every generation.
private  void swapAttributes(AttributeWeightedExampleSet es1, AttributeWeightedExampleSet es2, boolean[] swap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CROSSOVER_TYPES

public static final java.lang.String[] CROSSOVER_TYPES

ONE_POINT

public static final int ONE_POINT
See Also:
Constant Field Values

UNIFORM

public static final int UNIFORM
See Also:
Constant Field Values

SHUFFLE

public static final int SHUFFLE
See Also:
Constant Field Values

type

private int type

prob

private double prob

random

private java.util.Random random
Constructor Detail

SelectionCrossover

public SelectionCrossover(int type,
                          double prob,
                          java.util.Random random)
Method Detail

performOperation

public boolean performOperation(int generation)
The default implementation returns true for every generation.

Specified by:
performOperation in interface PopulationOperator


getType

public int getType()

crossover

public void crossover(AttributeWeightedExampleSet es1,
                      AttributeWeightedExampleSet es2)

swapAttributes

private void swapAttributes(AttributeWeightedExampleSet es1,
                            AttributeWeightedExampleSet es2,
                            boolean[] swap)

operate

public void operate(Population population)
Description copied from interface: PopulationOperator
Modifies the population.

Specified by:
operate in interface PopulationOperator



Copyright © 2001-2006