pub struct De {
pub config: Config,
pub bounds: Bounds,
}Expand description
Differential evolution within box bounds. A trial coordinate that leaves the box is set halfway between the target’s coordinate and the violated bound (“bounce back”), which keeps the population inside without piling it up on the boundary.
Fields§
§config: ConfigThe run parameters.
bounds: BoundsThe search box.
Implementations§
Source§impl De
impl De
Sourcepub fn run<O, B, Obs, R>(
&mut self,
objective: &mut O,
budget: &mut B,
observer: &mut Obs,
rng: &mut R,
) -> Outcome<Vec<f64>>
pub fn run<O, B, Obs, R>( &mut self, objective: &mut O, budget: &mut B, observer: &mut Obs, rng: &mut R, ) -> Outcome<Vec<f64>>
Runs from a fresh initial population until the budget stops it.
§Panics
Panics if the population is smaller than 6.
Sourcepub fn run_from<O, B, Obs, R>(
&mut self,
seeds: Vec<Vec<f64>>,
objective: &mut O,
budget: &mut B,
observer: &mut Obs,
rng: &mut R,
) -> Outcome<Vec<f64>>
pub fn run_from<O, B, Obs, R>( &mut self, seeds: Vec<Vec<f64>>, objective: &mut O, budget: &mut B, observer: &mut Obs, rng: &mut R, ) -> Outcome<Vec<f64>>
Runs with seeds (for example from a WarmStartLibrary) as the first members of
the initial population (truncated to the population size, clamped into the bounds);
the rest is drawn by Config::initialization.
§Panics
Panics if the population is smaller than 6.
Trait Implementations§
impl StructuralPartialEq for De
Auto Trait Implementations§
impl Forget for De
impl Freeze for De
impl Move for De
impl RefUnwindSafe for De
impl Send for De
impl Sync for De
impl Unpin for De
impl UnsafeUnpin for De
impl UnwindSafe for De
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