Skip to main content

Module replacement

Module replacement 

Source
Expand description

Survivor-selection / replacement operators.

Each function takes the current generation’s population and fitness plus the offspring population and fitness, and returns the (population, fitness) pair that becomes the next generation’s starting state.

All selection logic operates on host-side &[f32] fitness slices (canonical: higher is better), and winners are lifted back to the device via a single Tensor::select gather. None of these functions draw random numbers; they are deterministic given their inputs.

§Fitness convention

Fitness is canonical (maximise): larger values are better. This matches the convention used throughout crate::ops::selection.

§Choosing a replacement strategy

StrategyParent survivalUse when
generationalnoneoffspring quality is trusted; GA / CMA-ES
elitisttop-kpreserving known-good solutions matters
mu_plus_lambdabest of μ+λ poolES / DE with strong elitism
mu_comma_lambdanone (offspring only)ES with deliberate age-based forgetting

Functions§

elitist
Elitist replacement: keeps the k best parents and the best remaining offspring.
generational
Replaces the entire current generation with the offspring (no elitism).
mu_comma_lambda
(μ, λ) replacement: discards parents and keeps the μ best offspring.
mu_plus_lambda
(μ + λ) replacement: keeps the μ best individuals from the merged parent and offspring pool.