Package ec.parsimony

# Class LexicographicTournamentSelection

java.lang.Object
ec.BreedingSource
ec.SelectionMethod
ec.select.TournamentSelection
ec.parsimony.LexicographicTournamentSelection

All Implemented Interfaces:
  `Prototype`, `Setup`, `SteadyStateBSourceForm`, `RandomChoiceChooserD`, `Serializable`, `Cloneable`

public class LexicographicTournamentSelection extends TournamentSelection
Does a simple tournament selection, limited to the subpopulation it's working in at the time.

Tournament selection works like this: first, size individuals are chosen at random from the population. Then of those individuals, the one with the best fitness is selected. If two individuals have the same fitness, the one with smaller size is prefered. The default tournament size is 7.

Typical Number of Individuals Produced Per `produce(...)` call
Always 1.

Parameters

base.`size` int >= 1 | (the tournament size)
base.`pick-worst` bool = `true` or `false` (default) | (should we pick the worst individual in the tournament instead of the best?)

Default Base
select.lexicographic-tournament

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `P_TOURNAMENT`
  default base

  ### Fields inherited from class ec.select.TournamentSelection

  `P_PICKWORST, P_SIZE, pickWorst, probabilityOfPickingSizePlusOne, size`

  ### Fields inherited from class ec.SelectionMethod

  `INDS_PRODUCED, KEY_PARENTS`

  ### Fields inherited from class ec.BreedingSource

  `NO_PROBABILITY, P_PROB, probability`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LexicographicTournamentSelection()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `betterThan(Individual first, Individual second, int subpopulation, EvolutionState state, int thread)`
  Returns true if *first* is a better (fitter, whatever) individual than *second*.
  `Parameter`
  `defaultBase()`
  Returns the default base for this prototype.

  ### Methods inherited from class ec.select.TournamentSelection

  `getRandomIndividual, getTournamentSizeToUse, individualReplaced, produce, setup, sourcesAreProperForm`

  ### Methods inherited from class ec.SelectionMethod

  `finishProducing, prepareToProduce, produce, produces, produceWithoutCloning, typicalIndsProduced`

  ### Methods inherited from class ec.BreedingSource

  `clone, fillStubs, getProbability, pickRandom, preparePipeline, setProbability, setupProbabilities`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### P_TOURNAMENT

    public static final String P_TOURNAMENT
    default base
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### LexicographicTournamentSelection

    public LexicographicTournamentSelection()

- ## Method Details

  - ### defaultBase

    public Parameter defaultBase()
    Description copied from interface: `Prototype`
    Returns the default base for this prototype. This should generally be implemented by building off of the static base() method on the DefaultsForm object for the prototype's package. This should be callable during setup(...).
    Specified by:
      `defaultBase` in interface `Prototype`
    Overrides:
      `defaultBase` in class `TournamentSelection`

  - ### betterThan

    public boolean betterThan(Individual first, Individual second, int subpopulation, EvolutionState state, int thread)
    Description copied from class: `TournamentSelection`
    Returns true if *first* is a better (fitter, whatever) individual than *second*.
    Overrides:
      `betterThan` in class `TournamentSelection`