pub struct Diffusion<I, S, X, M, P> {
pub config: Config,
pub operators: Operators<I, S, X, M, P>,
}Expand description
The diffusion-model GA; the Operators::selection picks the partner within the deme
(linear ranking is GLEAM’s choice).
Fields§
§config: ConfigThe run parameters.
operators: Operators<I, S, X, M, P>The breeding operators.
Implementations§
Source§impl<I, S, X, M, P> Diffusion<I, S, X, M, P>
impl<I, S, X, M, P> Diffusion<I, S, X, M, P>
Sourcepub fn new(config: Config, operators: Operators<I, S, X, M, P>) -> Self
pub fn new(config: Config, operators: Operators<I, S, X, M, P>) -> Self
Creates a diffusion-model run.
Sourcepub fn run<G, O, B, Obs, R>(
&mut self,
objective: &mut O,
budget: &mut B,
observer: &mut Obs,
rng: &mut R,
) -> Outcome<G>
pub fn run<G, O, B, Obs, R>( &mut self, objective: &mut O, budget: &mut B, observer: &mut Obs, rng: &mut R, ) -> Outcome<G>
Runs until the budget or a stagnation limit stops it.
§Panics
Panics if the population is smaller than twice the deme size.
Sourcepub fn run_memetic<G, L, O, B, Obs, R>(
&mut self,
memetic: &mut Memetic<L>,
objective: &mut O,
budget: &mut B,
observer: &mut Obs,
rng: &mut R,
) -> Outcome<G>
pub fn run_memetic<G, L, O, B, Obs, R>( &mut self, memetic: &mut Memetic<L>, objective: &mut O, budget: &mut B, observer: &mut Obs, rng: &mut R, ) -> Outcome<G>
Runs HyGLEAM: the diffusion model with memetic local search on the best offspring of
every mating.
§Panics
Panics if the population is smaller than twice the deme size.
Trait Implementations§
Source§impl<I: PartialEq, S: PartialEq, X: PartialEq, M: PartialEq, P: PartialEq> PartialEq for Diffusion<I, S, X, M, P>
impl<I: PartialEq, S: PartialEq, X: PartialEq, M: PartialEq, P: PartialEq> PartialEq for Diffusion<I, S, X, M, P>
impl<I: PartialEq, S: PartialEq, X: PartialEq, M: PartialEq, P: PartialEq> StructuralPartialEq for Diffusion<I, S, X, M, P>
Auto Trait Implementations§
impl<I, S, X, M, P> Forget for Diffusion<I, S, X, M, P>
impl<I, S, X, M, P> Freeze for Diffusion<I, S, X, M, P>
impl<I, S, X, M, P> Move for Diffusion<I, S, X, M, P>
impl<I, S, X, M, P> RefUnwindSafe for Diffusion<I, S, X, M, P>where
Operators<I, S, X, M, P>: RefUnwindSafe,
impl<I, S, X, M, P> Send for Diffusion<I, S, X, M, P>
impl<I, S, X, M, P> Sync for Diffusion<I, S, X, M, P>
impl<I, S, X, M, P> Unpin for Diffusion<I, S, X, M, P>
impl<I, S, X, M, P> UnsafeUnpin for Diffusion<I, S, X, M, P>where
Operators<I, S, X, M, P>: UnsafeUnpin,
impl<I, S, X, M, P> UnwindSafe for Diffusion<I, S, X, M, P>where
Operators<I, S, X, M, P>: UnwindSafe,
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