Selection operators

Parent and Survivor selection operators (a.k.a. selectors) in EvoLP are based on fitness and are used to select individuals for crossover or survival for the next generation. The selectors always return indices so that individuals can be selected from the population later.

Parent Selectors

Parent selectors are used to generate the mating pool (the offspring) in evolutionary algorithms. Since EvoLP.jl v2.1, all parent selectors can now optionally take a sample size N to generate an entire mating pool in a single function call. If N is omitted, they default to 2, as in a steady-state genetic algorithm where 2 parents create 1 offspring.

For generational algorithms, you need to pass the appropriate value for $N$, for example, once per each individual in the population, or $N=\mu$.

Parent selectors are derived from the EvoLP.ParentSelector abstract type, which is itself derived from the EvoLP.Selector abstract super type. Some of the selectors have parameters you can adjust.

Survival Selectors

Survival selectors are deterministic operators that choose which individuals survive to form the next generation. They are commonly used in Evolutionary Strategies and Evolutionary Algorithms with no crossover (mutation only).

Survival selectors are derived from the EvoLP.SurvivalSelector, and as parent selectors, they also return indices that can be applied directly to your population arrays.

For PlusSelector, the returned indices refer to a concatenated array of vcat(parents, offspring).

Deterministic Behaviour

Unlike Parent Selectors, which rely on stochastic sampling to generate a mating pool, Survival Selectors in EvoLP model strict environmental truncation. Their select methods do not accept or require a Random Number Generator (rng) parameter because they deterministically extract the top μ individuals.

EvoLP.CommaSelector — Type
CommaSelector(μ::Int)

$(\mu, \lambda)$ survival selection. Selects the indices of the best μ individuals exclusively from the offspring population.

source
EvoLP.PlusSelector — Type
PlusSelector(μ::Int)

$(\mu + \lambda)$ survival selection. Selects the indices of the best μ individuals from the combined pool of parents and offspring.

source

Performing the selection

After "instantiating" a selection method, you can use the select function on an array of fitnesses y to obtain $N$ parent indices (that you will need to slice from the population in your algorithm later.)

In the case of survival selectors, you would get $N$ indices (that you will need to slice from the population of offspring, for example) to get the population for the next iteration.

EvoLP.select — Function
select(t::TournamentSelector, y, N::Int = 2; rng = Random.GLOBAL_RNG)

Select N parents which are the winners from N random tournaments of size t.T.

source
select(t::TruncationSelector, y, N::Int = 2; rng = Random.GLOBAL_RNG)

Select N random parent indices out from the top t.k in the population.

source
select(::RouletteWheelSelector, y, N::Int = 2; rng = Random.GLOBAL_RNG)

Select N random parent indices with probability proportional to their fitness.

source
select(::RankBasedSelector, y, N::Int = 2; rng = Random.GLOBAL_RNG)

Select N random parent indices with probability proportional to their ranks.

source
select(::UniformSelector, y, N::Int = 2; rng = Random.GLOBAL_RNG)

Select N parent indices uniformly at random with replacement. Useful for (μ, λ)-ES and EAs.

source
select(S::CommaSelector, y_λ)

Return the indices of the best μ offspring.

source
select(S::PlusSelector, y_μ, y_λ)

Return the indices of the best μ individuals from both parents and offspring.

source
select(S_M::RandomDemeSelector, y)

Return a list of size S_M.k of random indices from a vector of fitnesses y. Used inside drift to select individuals to be sent to another island, or inside reinsert! to select individuals to be replaced.

source
select(S_M::WorstDemeSelector, y)

Return the indices of the S_M.k-worst fitnesses in y. Used inside drift to select individuals to be sent to another island, or inside reinsert! to select individuals to be replaced.

source