Genex v1.0.1-beta Genex.Tools.Selection View Source

Implementation of several popular selection methods.

Selection occurs in two stages in Genex: parent selection and survivor selection. Parent Selection dictates which chromosomes are to be reserved for crossover according to some crossover rate. In this stage, a number of chromosomes are selected and paired off in 2-tuples in the order they are selected. Future versions of Genex will provide more advanced methods of parent selection.

Survivor Selection occurs last in the GA cycle. As of this version of Genex, the survivor rate is always equal to 1 - CR where CR is the crossover rate. Future versions will support more advanced survivor selection, including the ability to fluctuate the population according to some operators.

Link to this section Summary

Functions

Natural selection of some number of chromosomes.

Random selection of some number of chromosomes.

Roulette selection of some number of chromosomes.

Stochastic Universal Sampling of chromosomes.

Tournament selection of some number of chromosomes.

Worst selection of some number of chromosomes.

Link to this section Functions

Link to this function

natural(chromosomes, n)

View Source
natural(Enum.t(), integer()) :: Enum.t()

Natural selection of some number of chromosomes.

This will select the n best (fittest) chromosomes.

Returns Enum.t.

Parameters

  • chromosomes: Enum of Chromosomes.
  • n: Number of chromosomes to select.
Link to this function

random(chromosomes, n)

View Source
random(Enum.t(), integer()) :: Enum.t()

Random selection of some number of chromosomes.

This will select n random chromosomes.

Returns Enum.t.

Parameters

  • chromosomes: Enum of Chromosomes.
  • n: Number of chromosomes to select.
Link to this function

roulette(chromosomes, n)

View Source
roulette(Enum.t(), integer()) :: Enum.t()

Roulette selection of some number of chromosomes.

This will select n chromosomes using a "roulette" wheel where the probability of a chromosome being selected is proportional to it's fitness.

Returns Enum.t().

Parameters

  • chromosomes: Enum of Chromosomes.
  • n: Number of chromosomes to select.
Link to this function

stochastic_universal_sampling(chromosomes, n)

View Source
stochastic_universal_sampling(Enum.t(), integer()) :: Enum.t()

Stochastic Universal Sampling of chromosomes.

This will sample all of the chromosomes without bias, choosing them at evenly spaced intervals.

Returns Enum.t().

Parameters

  • chromosomes: Enum of Chromosomes.
  • n: Number of chromomsomes to select.
Link to this function

tournament(chromosomes, n, tournsize)

View Source
tournament(Enum.t(), integer(), integer()) :: Enum.t()

Tournament selection of some number of chromosomes.

This will select n chromosomes from tournaments of size k. We randomly select k chromosomes from the population and choose the max to be in the tournament.

Returns Enum.t().

Parameters

  • chromosomes: Enum of Chromosomes.
  • n: Number of chromosomes to select.
  • tournsize: The size of the tournament to run.
Link to this function

worst(chromosomes, n)

View Source
worst(Enum.t(), integer()) :: Enum.t()

Worst selection of some number of chromosomes.

This will select the n worst (least fit) chromosomes.

Returns Enum.t.

Parameters

  • chromosomes: Enum of Chromosomes.
  • n: Number of chromosomes to select.