es.udc.gii.common.eaf.algorithm.operator.reproduction.crossover
Class CrossOverOperator
java.lang.Object
es.udc.gii.common.eaf.algorithm.operator.reproduction.ReproductionOperator
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
This abstract class represents a crossover operator.
The behavior of a crossover operator is to crossover two selected individuals from the population.
The classes that extend this operator will implement the method
#crossOver(EvolutionaryAlgorithm algorithm, List individuals)
. This method receives
a list of individuals and return the children generated by the operator. This method is executed from the method
operate(EvolutionaryAlgorithm algorithm, List individuals)
for each pair of the individuals
of the list.
- Since:
- 1.0
- Author:
- Grupo Integrado de IngenierĂa (www.gii.udc.es)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
probability
private double probability
CrossOverOperator
public CrossOverOperator()
CrossOverOperator
public CrossOverOperator(int probability)
configure
public void configure(org.apache.commons.configuration.Configuration conf)
- Description copied from interface:
Configurable
- Configures the specific element that implements this method.
- Specified by:
configure
in interface Configurable
- Overrides:
configure
in class ReproductionOperator
- Parameters:
conf
- a Configuration object.- See Also:
Configuration
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