es.udc.gii.common.eaf.algorithm.operator.selection
Class DeterministicTournamentSelection

java.lang.Object
  extended by es.udc.gii.common.eaf.algorithm.operator.selection.SelectionOperator
      extended by es.udc.gii.common.eaf.algorithm.operator.selection.DeterministicTournamentSelection
All Implemented Interfaces:
Operator, Configurable

public class DeterministicTournamentSelection
extends SelectionOperator

This class implements the deterministic tournament selection. The individuals of the population are arranged in groups and each individual in that group competes for reproduction. Only one individual wins in each group.

It is ensured that no individual competes with itself and it is ensured that all individuals get involved in at least one tournament (each individual is in at least one of the created groups).

Author:
Rafael Tedin Alvarez

Field Summary
private  int poolSize
          The pool size is the number of members that compete in each tournament.
 
Constructor Summary
DeterministicTournamentSelection()
          Creates a new instance of DeterministicTournamentSelection
DeterministicTournamentSelection(int poolSize)
          Creates a new instance of DeterministicTournamentSelection
 
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  Individual select(EvolutionaryAlgorithm algorithm, java.util.List<Individual> individuals)
           
 
Methods inherited from class es.udc.gii.common.eaf.algorithm.operator.selection.SelectionOperator
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

poolSize

private int poolSize
The pool size is the number of members that compete in each tournament.

Constructor Detail

DeterministicTournamentSelection

public DeterministicTournamentSelection()
Creates a new instance of DeterministicTournamentSelection


DeterministicTournamentSelection

public DeterministicTournamentSelection(int poolSize)
Creates a new instance of DeterministicTournamentSelection

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
Overrides:
operate in class SelectionOperator
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.

configure

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

select

protected Individual select(EvolutionaryAlgorithm algorithm,
                            java.util.List<Individual> individuals)
Specified by:
select in class SelectionOperator