Skip to main content

bounded_mutation

Function bounded_mutation 

Source
pub fn bounded_mutation<R: Rng>(
    sigma: f64,
    lower: f64,
    upper: f64,
) -> impl Fn(&Address, &ChoiceValue, &mut R) -> ChoiceValue
Expand description

Bounded mutation function that respects bounds.

Adds a true Normal(0, sigma) perturbation and clamps the result to [lower, upper].