Struct cmaes::options::CMAESOptions
[−]
[src]
pub struct CMAESOptions { pub end_conditions: Vec<CMAESEndConditions>, pub dimension: usize, pub initial_step_size: f64, pub initial_standard_deviations: Vec<f64>, pub initial_mean: Vec<f64>, pub threads: usize, }
A container for end conditions, problem dimension, and thread count.
Examples
use cmaes::CMAESOptions; // A set of options with 2 variables to optimize, and a default of // 1 thread and 500 max generations. let default = CMAESOptions::default(2); // A set of options with 2 variables to optimize, 2000 max evaluations, // 1 thread, and 10 stable generations with 0.01 change in fitness. let custom = CMAESOptions::custom(2) .max_evaluations(2000) .stable_generations(0.01, 10);
Fields
end_conditions: Vec<CMAESEndConditions>
dimension: usize
initial_step_size: f64
initial_standard_deviations: Vec<f64>
initial_mean: Vec<f64>
threads: usize
Methods
impl CMAESOptions
[src]
fn default(dimension: usize) -> CMAESOptions
Returns a set of default options with the specified dimension (number of variables to optimize).
fn custom(dimension: usize) -> CMAESOptions
Returns a set of options with no end conditions.
fn threads(self, threads: usize) -> CMAESOptions
Sets the number of threads to use in the algorithm.
fn initial_step_size(self, step_size: f64) -> CMAESOptions
Sets the initial step size (search radius). This is only a starting point and is adapted by the algorithm.
fn initial_standard_deviations(self, deviations: Vec<f64>) -> CMAESOptions
Sets the initial standard deviations of each variable (individual search radii). These are only used as starting points and are adapted by the algorithm.
fn initial_mean(self, mean: Vec<f64>) -> CMAESOptions
Sets where to start searching for solutions. This is only a starting point and is adapted by the algorithm.
fn stable_generations(self, fitness: f64, generations: usize) -> CMAESOptions
Sets the stable generation count. The algorithm terminates if the specified number of generations pass where the change in best fitness is under the specified amount.
fn fitness_threshold(self, fitness: f64) -> CMAESOptions
Sets the minimum fitness. The algorithm terminates if the best fitness is under the threshold.
fn max_generations(self, generations: usize) -> CMAESOptions
Sets the maximum generation count. The algorithm terminates after the specified number of generations.
fn max_evaluations(self, evaluations: usize) -> CMAESOptions
Sets the maximum evaluation count. The algorithm terminates after the specified number of fitness function calls.
Trait Implementations
impl Clone for CMAESOptions
[src]
fn clone(&self) -> CMAESOptions
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more