pub struct AdaptiveOperatorSelection {
pub num_operators: usize,
pub weights: Vec<f64>,
pub learning_rate: f64,
pub min_probability: f64,
pub decay: f64,
}Expand description
Adaptive operator selection using fitness-based credit assignment
Tracks performance of multiple operators and adjusts selection probabilities based on the fitness improvements they produce.
Fields§
§num_operators: usizeNumber of operators
weights: Vec<f64>Selection weights for each operator
learning_rate: f64Learning rate for weight updates
min_probability: f64Minimum probability for any operator
decay: f64Decay factor for old rewards
Implementations§
Source§impl AdaptiveOperatorSelection
impl AdaptiveOperatorSelection
Sourcepub fn new(num_operators: usize) -> Self
pub fn new(num_operators: usize) -> Self
Create a new adaptive operator selection with uniform initial weights
Sourcepub fn with_learning_rate(self, rate: f64) -> Self
pub fn with_learning_rate(self, rate: f64) -> Self
Set learning rate
Sourcepub fn with_min_probability(self, prob: f64) -> Self
pub fn with_min_probability(self, prob: f64) -> Self
Set minimum probability
Sourcepub fn with_decay(self, decay: f64) -> Self
pub fn with_decay(self, decay: f64) -> Self
Set decay factor
Sourcepub fn update(&mut self, operator_idx: usize, fitness_improvement: f64)
pub fn update(&mut self, operator_idx: usize, fitness_improvement: f64)
Update weights based on fitness improvement from an operator
Sourcepub fn probabilities(&self) -> &[f64]
pub fn probabilities(&self) -> &[f64]
Get current selection probabilities
Trait Implementations§
Source§impl Clone for AdaptiveOperatorSelection
impl Clone for AdaptiveOperatorSelection
Source§fn clone(&self) -> AdaptiveOperatorSelection
fn clone(&self) -> AdaptiveOperatorSelection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AdaptiveOperatorSelection
impl RefUnwindSafe for AdaptiveOperatorSelection
impl Send for AdaptiveOperatorSelection
impl Sync for AdaptiveOperatorSelection
impl Unpin for AdaptiveOperatorSelection
impl UnsafeUnpin for AdaptiveOperatorSelection
impl UnwindSafe for AdaptiveOperatorSelection
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.