Package org.jppf.ga

Class TournamentSelector

java.lang.Object
org.jppf.ga.TournamentSelector
All Implemented Interfaces:
Selector

public class TournamentSelector extends Object implements Selector
Tornament slection implemntation.
Author:
Laurent Cohen
  • Field Details

    • random

      protected Random random
      Random number generator.
  • Constructor Details

    • TournamentSelector

      public TournamentSelector(int size)
      Initialize this selector with the specified size.
      Parameters:
      size - the tournament size.
  • Method Details

    • select

      public Chromosome[] select(Chromosome[] population, int nbSelect)
      Description copied from interface: Selector
      Select the specified number of chromosomes among the specified population.
      Specified by:
      select in interface Selector
      Parameters:
      population - the population from which to select.
      nbSelect - the number of chromosomes to select.
      Returns:
      an array of the selected chromosomes.