Skip to main content

Optimizer

Trait Optimizer 

Source
pub trait Optimizer: Sync {
    // Required methods
    fn optimize(&self, problem: &dyn Problem, term: &Termination) -> Report;
    fn with_seed(&self, seed: u64) -> Self
       where Self: Sized;
}
Expand description

The uniform interface every optimizer implements: run on a Problem under a Termination, and produce a copy of itself with a different RNG seed (the hook ensembles use to give each island an independent stream).

Sync is a supertrait so optimizers can be shared across island workers.

Required Methods§

Source

fn optimize(&self, problem: &dyn Problem, term: &Termination) -> Report

Minimizes problem within its bounds under term.

Source

fn with_seed(&self, seed: u64) -> Self
where Self: Sized,

Returns the same configuration with its RNG seed replaced.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§