pub struct OnePlusOne {
pub sigma: f64,
pub min_sigma: f64,
}Expand description
The (1+1)-ES with the 1/5th success rule: one parent, one Gaussian offspring per
iteration, accepted if not worse; σ grows by exp(1/3) on success and shrinks by
exp(-1/12) on failure, which keeps it stationary at a success rate of exactly 1/5.
use evolutionary_planning::es::OnePlusOne;
use evolutionary_planning::problems::single::sphere;
use evolutionary_planning::{Limits, SplitMix64};
let mut es = OnePlusOne { sigma: 1.0, min_sigma: 1e-300 };
let mut objective = |x: &Vec<f64>| sphere(x);
let outcome = es.run(vec![2.0; 5], &mut objective, &mut Limits::evaluations(3_000), &mut (), &mut SplitMix64::new(1));
assert!(outcome.best_cost() < 1e-10);Fields§
§sigma: f64The initial step size (absolute).
min_sigma: f64Step sizes never fall below this.
Implementations§
Trait Implementations§
Source§impl Clone for OnePlusOne
impl Clone for OnePlusOne
impl Copy for OnePlusOne
Source§impl Debug for OnePlusOne
impl Debug for OnePlusOne
Source§impl PartialEq for OnePlusOne
impl PartialEq for OnePlusOne
impl StructuralPartialEq for OnePlusOne
Auto Trait Implementations§
impl Forget for OnePlusOne
impl Freeze for OnePlusOne
impl Move for OnePlusOne
impl RefUnwindSafe for OnePlusOne
impl Send for OnePlusOne
impl Sync for OnePlusOne
impl Unpin for OnePlusOne
impl UnsafeUnpin for OnePlusOne
impl UnwindSafe for OnePlusOne
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more