Skip to main content

Module de

Module de 

Expand description

The pure differential-evolution operators, in the unit hypercube [0, 1]^d.

These are the arithmetic core of Dehb, kept free of any sampler or study state so they can be unit-tested on hand-computed vectors. Every operator works on the transform-layer unit representation of a configuration — a coordinate per dimension in [0, 1] — so a single implementation covers every Distribution kind (log, stepped, categorical, boolean): the mapping back to the declared support is Distribution::from_unit’s job, done once when the config is finally assigned.

The DE strategy is the classic rand/1/bin (Storn & Price 1997): a mutant is x_r1 + F·(x_r2 − x_r3) for three distinct random members, and binomial crossover mixes that mutant with a target at rate CR, always taking at least one mutant coordinate. A mutant coordinate can leave [0, 1]; a BoundaryFix pulls it back so the result is always a valid unit vector.

Enums§

BoundaryFix
How a mutant coordinate that has left [0, 1] is pulled back in.

Functions§

crossover_bin
Binomial crossover: mix mutant into target at rate cr, always keeping at least one mutant coordinate.
mutation_rand1
The rand/1 mutation: x_r1 + F·(x_r2 − x_r3), coordinate by coordinate.
random_unit_vector
A fresh uniform-random unit vector in [0, 1]^d — the low-discrepancy-free fallback for the initial population and for filling an under-sized donor pool.
sample_distinct
Draws k distinct indices from 0..n, uniformly without replacement.