es.udc.gii.common.eaf.algorithm.operator.replace
Class ReplaceOperator

java.lang.Object
  extended by java.util.Observable
      extended by es.udc.gii.common.eaf.algorithm.operator.replace.ReplaceOperator
All Implemented Interfaces:
Operator, Configurable
Direct Known Subclasses:
ElitismOperator, ElitismReevaluateOperator, EvolutionaryStrategyReplaceOperator, MigrationOperator, NSGA2ReplaceOperator, ParetoFrontReplaceOperator, PopulationMemoryReplaceOperator

public abstract class ReplaceOperator
extends java.util.Observable
implements Operator

Author:
pilar

Constructor Summary
ReplaceOperator()
          Creates a new instance of ReplaceOperator
 
Method Summary
 void configure(org.apache.commons.configuration.Configuration conf)
           
 java.util.List<Individual> operate(EvolutionaryAlgorithm algorithm, java.util.List<Individual> individuals)
          Execute this operator over a group of individuals.
protected abstract  java.util.List<Individual> replace(EvolutionaryAlgorithm algorithm, java.util.List<Individual> toPopulation)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceOperator

public ReplaceOperator()
Creates a new instance of ReplaceOperator

Method Detail

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.

Specified by:
operate in interface 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.

replace

protected abstract java.util.List<Individual> replace(EvolutionaryAlgorithm algorithm,
                                                      java.util.List<Individual> toPopulation)

configure

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