pub struct BayesianAdaptiveGA<P, F>{ /* private fields */ }Expand description
A single-level Bayesian adaptive genetic algorithm.
See the module docs for the model. Operator step sizes are selected
by Thompson sampling over per-operator Beta success posteriors, which are
updated by conjugate Bayesian updates from observed improvement events.
Implementations§
Source§impl<P, F> BayesianAdaptiveGA<P, F>
impl<P, F> BayesianAdaptiveGA<P, F>
Sourcepub fn new(
prior: P,
fitness: F,
population_size: usize,
generations: usize,
) -> Self
pub fn new( prior: P, fitness: F, population_size: usize, generations: usize, ) -> Self
Create a new adaptive GA with a default set of mutation step sizes.
Sourcepub fn with_step_sizes(self, sigmas: Vec<f64>) -> Self
pub fn with_step_sizes(self, sigmas: Vec<f64>) -> Self
Replace the operator step sizes (each gets a fresh Beta(1, 1) prior).
Sourcepub fn with_mutation_rate(self, rate: f64) -> Self
pub fn with_mutation_rate(self, rate: f64) -> Self
Set the coordinate mutation probability.
Sourcepub fn with_tournament_size(self, size: usize) -> Self
pub fn with_tournament_size(self, size: usize) -> Self
Set the tournament size for parent selection.
Auto Trait Implementations§
impl<P, F> Freeze for BayesianAdaptiveGA<P, F>
impl<P, F> RefUnwindSafe for BayesianAdaptiveGA<P, F>where
P: RefUnwindSafe,
F: RefUnwindSafe,
impl<P, F> Send for BayesianAdaptiveGA<P, F>
impl<P, F> Sync for BayesianAdaptiveGA<P, F>
impl<P, F> Unpin for BayesianAdaptiveGA<P, F>
impl<P, F> UnsafeUnpin for BayesianAdaptiveGA<P, F>where
P: UnsafeUnpin,
F: UnsafeUnpin,
impl<P, F> UnwindSafe for BayesianAdaptiveGA<P, F>where
P: UnwindSafe,
F: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.