MOEA Framework 2.12
API Specification

org.moeaframework.core.operator
Class TournamentSelection

java.lang.Object
  extended by org.moeaframework.core.operator.TournamentSelection
All Implemented Interfaces:
Selection

public class TournamentSelection
extends Object
implements Selection

Deterministic tournament selection operator. The tournament size specifies the number of candidate solutions selected randomly from a population. The winner of a tournament is the best solution in the pool. Unlike probabilistic tournament selection, the best solution is always returned in deterministic tournament selection. If two or more solutions are the best in the pool, one solution is randomly selected with equal probability as the tournament winner.

Binary tournament selection exhibits the same selection pressure as linear ranking but without the computational overhead required for ranking. Larger tournament sizes result in greedier selection. Solutions are selected with replacement.


Constructor Summary
TournamentSelection()
          Constructs a binary tournament selection operator using Pareto dominance.
TournamentSelection(DominanceComparator comparator)
          Constructs a binary tournament selection operator using the specified dominance comparator.
TournamentSelection(int size)
          Constructs a tournament selection operator of the specified size using Pareto dominance.
TournamentSelection(int size, DominanceComparator comparator)
          Constructs a tournament selection operator of the specified size and using the specified dominance comparator.
 
Method Summary
static Solution binaryTournament(Solution solution1, Solution solution2)
          Performs binary tournament selection with Pareto dominance.
static Solution binaryTournament(Solution solution1, Solution solution2, DominanceComparator comparator)
          Performs binary tournament selection.
 DominanceComparator getComparator()
          Returns the dominance comparator used to determine the tournament winner.
 int getSize()
          Returns the tournament size.
 Solution[] select(int arity, Population population)
          Returns an array of length arity of solutions selected from the specified population.
 void setSize(int size)
          Sets the tournament size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TournamentSelection

public TournamentSelection()
Constructs a binary tournament selection operator using Pareto dominance.


TournamentSelection

public TournamentSelection(DominanceComparator comparator)
Constructs a binary tournament selection operator using the specified dominance comparator.

Parameters:
comparator - the comparator used to determine the tournament winner

TournamentSelection

public TournamentSelection(int size)
Constructs a tournament selection operator of the specified size using Pareto dominance.

Parameters:
size - the tournament size

TournamentSelection

public TournamentSelection(int size,
                           DominanceComparator comparator)
Constructs a tournament selection operator of the specified size and using the specified dominance comparator.

Parameters:
size - the tournament size
comparator - the comparator used to determine the tournament winner
Method Detail

getSize

public int getSize()
Returns the tournament size.

Returns:
the tournament size

setSize

public void setSize(int size)
Sets the tournament size.

Parameters:
size - the new tournament size

getComparator

public DominanceComparator getComparator()
Returns the dominance comparator used to determine the tournament winner.

Returns:
the comparator used to determine the tournament winner

select

public Solution[] select(int arity,
                         Population population)
Description copied from interface: Selection
Returns an array of length arity of solutions selected from the specified population.

Specified by:
select in interface Selection
Parameters:
arity - the number of solutions selected from the specified population
population - the population from which solutions are selected
Returns:
an array of length arity of solutions selected from the specified population

binaryTournament

public static Solution binaryTournament(Solution solution1,
                                        Solution solution2,
                                        DominanceComparator comparator)
Performs binary tournament selection.

Parameters:
solution1 - the first solution
solution2 - the second solution
comparator - the comparison operator
Returns:
the solution that wins the tournament

binaryTournament

public static Solution binaryTournament(Solution solution1,
                                        Solution solution2)
Performs binary tournament selection with Pareto dominance.

Parameters:
solution1 - the first solution
solution2 - the second solution
Returns:
the solution that wins the tournament

MOEA Framework 2.12
API Specification

Copyright 2009-2016 MOEA Framework. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage. Visit us on Github!