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
(lower 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 treated as a cost: smaller values are better. This
matches the convention used throughout crate::ops::selection.
§Choosing a replacement strategy
| Strategy | Parent survival | Use when |
|---|---|---|
generational | none | offspring quality is trusted; GA / CMA-ES |
elitist | top-k | preserving known-good solutions matters |
mu_plus_lambda | best of μ+λ pool | ES / DE with strong elitism |
mu_comma_lambda | none (offspring only) | ES with deliberate age-based forgetting |
Functions§
- elitist
- Elitist replacement: keeps the
kbest 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.