feat(operators): add SimulatedBinaryCrossover (SBX)

Deb & Agrawal's standard real-valued crossover for NSGA-II. Takes two
parents, returns two children; per dimension, with
`per_variable_probability`, mixes the parents using a polynomial
spread parameter \\(\\beta\\) drawn from a distribution controlled by
`eta` (the distribution index — typical values 10–30, default 15).
Children are clamped to per-variable bounds.

Per-dim formula (Deb & Agrawal 1995):
- `u ~ U[0, 1)`
- `β = (2u)^(1/(η+1))` if `u ≤ 0.5` else `(1 / (2(1-u)))^(1/(η+1))`
- `c1 = 0.5·((1+β)·p1 + (1-β)·p2)`, `c2 = 0.5·((1-β)·p1 + (1+β)·p2)`

This is the simple compute-then-clamp form; the bounds-aware
β formulation from the full paper is left as a future refinement.

Tests cover: two children for two parents, output lengths preserved,
all variables clamped to bounds, and per_variable_probability=0
returns the parents unchanged.
This commit is contained in:
2026-05-04 19:43:53 -06:00
parent acf1789d5b
commit 36a7dbb2ef
2 changed files with 129 additions and 1 deletions
+2 -1
View File
@@ -17,7 +17,8 @@ pub use crate::pareto::{
};
pub use crate::operators::{
BitFlipMutation, BoundedGaussianMutation, GaussianMutation, RealBounds, SwapMutation,
BitFlipMutation, BoundedGaussianMutation, GaussianMutation, RealBounds,
SimulatedBinaryCrossover, SwapMutation,
};
pub use crate::algorithms::{