pub struct CmaEsState {Show 23 fields
pub mean: Vec<f64>,
pub sigma: f64,
pub covariance: Vec<Vec<f64>>,
pub path_sigma: Vec<f64>,
pub path_c: Vec<f64>,
pub eigenvalues: Vec<f64>,
pub eigenvectors: Vec<Vec<f64>>,
pub eigen_eval: usize,
pub dimension: usize,
pub lambda: usize,
pub mu: usize,
pub weights: Vec<f64>,
pub mu_eff: f64,
pub c_1: f64,
pub c_mu: f64,
pub c_sigma: f64,
pub d_sigma: f64,
pub c_c: f64,
pub chi_n: f64,
pub generation: usize,
pub evaluations: usize,
pub best_fitness: f64,
pub best_solution: Vec<f64>,
}Expand description
CMA-ES state containing all adaptation parameters
Fields§
§mean: Vec<f64>Current mean of the search distribution
sigma: f64Global step size (σ)
covariance: Vec<Vec<f64>>Covariance matrix C (stored as upper triangular for efficiency)
path_sigma: Vec<f64>Evolution path for σ adaptation (p_σ)
path_c: Vec<f64>Evolution path for C adaptation (p_c)
eigenvalues: Vec<f64>Eigenvalues of C (D²)
eigenvectors: Vec<Vec<f64>>Eigenvectors of C (B)
eigen_eval: usizeGeneration counter for eigendecomposition
dimension: usizeProblem dimension
lambda: usizePopulation size (λ)
mu: usizeParent number (μ)
weights: Vec<f64>Recombination weights
mu_eff: f64Variance effective selection mass (μ_eff)
c_1: f64Learning rate for rank-1 update
c_mu: f64Learning rate for rank-μ update
c_sigma: f64Learning rate for cumulation for σ control
d_sigma: f64Damping for σ
c_c: f64Learning rate for cumulation for C
chi_n: f64Expected length of random vector ||N(0, I)||
generation: usizeCurrent generation
evaluations: usizeTotal evaluations
best_fitness: f64Best fitness found
best_solution: Vec<f64>Best solution found
Implementations§
Source§impl CmaEsState
impl CmaEsState
Sourcepub fn new(
initial_mean: Vec<f64>,
initial_sigma: f64,
lambda: Option<usize>,
) -> Self
pub fn new( initial_mean: Vec<f64>, initial_sigma: f64, lambda: Option<usize>, ) -> Self
Create a new CMA-ES state
Sourcepub fn sample_population<R: Rng>(&self, rng: &mut R) -> Vec<RealVector>
pub fn sample_population<R: Rng>(&self, rng: &mut R) -> Vec<RealVector>
Sample lambda offspring from the current distribution
Sourcepub fn update(&mut self, offspring: &[(RealVector, f64)])
pub fn update(&mut self, offspring: &[(RealVector, f64)])
Update the CMA-ES state based on evaluated offspring
Offspring should be sorted by fitness (best first for minimization).
Sourcepub fn has_converged(&self) -> bool
pub fn has_converged(&self) -> bool
Check if algorithm has converged
Trait Implementations§
Source§impl Clone for CmaEsState
impl Clone for CmaEsState
Source§fn clone(&self) -> CmaEsState
fn clone(&self) -> CmaEsState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CmaEsState
impl RefUnwindSafe for CmaEsState
impl Send for CmaEsState
impl Sync for CmaEsState
impl Unpin for CmaEsState
impl UnsafeUnpin for CmaEsState
impl UnwindSafe for CmaEsState
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
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>
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>
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>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.