es.udc.gii.common.eaf.algorithm.operator.reproduction.crossover
Class CrossOverOperator

java.lang.Object
  extended by es.udc.gii.common.eaf.algorithm.operator.reproduction.ReproductionOperator
      extended by es.udc.gii.common.eaf.algorithm.operator.reproduction.crossover.CrossOverOperator
All Implemented Interfaces:
Operator, Configurable
Direct Known Subclasses:
BLXCrossOver, FlatCrossOver, Order1CrossOver, RandomCrossOver, SBXCrossOver

public abstract class CrossOverOperator
extends ReproductionOperator


Field Summary
private  double probability
           
 
Constructor Summary
CrossOverOperator()
           
CrossOverOperator(int probability)
           
 
Method Summary
 void configure(org.apache.commons.configuration.Configuration conf)
           
protected abstract  java.util.List<Individual> crossOver(EvolutionaryAlgorithm ea, java.util.List<Individual> individuals)
           
protected  int[] getCrossPoints(boolean initEnd, int nPoints, int max)
           
 double getProbability()
           
 java.util.List<Individual> operate(EvolutionaryAlgorithm algorithm, java.util.List<Individual> individuals)
          Execute this operator over a group of individuals.
 void setProbability(int probability)
           
 java.lang.String toString()
           
 
Methods inherited from class es.udc.gii.common.eaf.algorithm.operator.reproduction.ReproductionOperator
checkBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

probability

private double probability
Constructor Detail

CrossOverOperator

public CrossOverOperator()

CrossOverOperator

public CrossOverOperator(int probability)
Method Detail

configure

public void configure(org.apache.commons.configuration.Configuration conf)
Specified by:
configure in interface Configurable
Overrides:
configure in class ReproductionOperator

operate

public java.util.List<Individual> operate(EvolutionaryAlgorithm algorithm,
                                          java.util.List<Individual> individuals)
                                   throws OperatorException
Description copied from interface: Operator
Execute this operator over a group of individuals. This method will be invoked by the current algorithm during its execution. It will be applied on a list of individuals and will return a list of modified individuals.

This method will recive two parameters. The current algorithm, to visit it if it is necessary, for example, to get some parameter of the current execution. And a list of individuals on wich we will apply this operator.

Parameters:
algorithm - the current algorithm, to visit when it is necessary.
individuals - list of individuals on wich we will apply the operator.
Returns:
the result of apply this operator to a individuals' lisr.
Throws:
OperatorException - when occurs some type of error during the execution of this operator.

crossOver

protected abstract java.util.List<Individual> crossOver(EvolutionaryAlgorithm ea,
                                                        java.util.List<Individual> individuals)

getCrossPoints

protected int[] getCrossPoints(boolean initEnd,
                               int nPoints,
                               int max)

getProbability

public double getProbability()

setProbability

public void setProbability(int probability)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object