pub struct RastriginProblem { /* private fields */ }Expand description
Rastrigin: a classic multimodal continuous minimization benchmark.
Minimize: f(x) = 10n + sum(x_i^2 - 10 cos(2 pi x_i))
Variables: x_i in [lower_bound, upper_bound] Global optimum: f(0, …, 0) = 0
Implementations§
Source§impl RastriginProblem
impl RastriginProblem
pub fn new( number_of_variables: usize, lower_bound: f64, upper_bound: f64, ) -> Self
pub fn new_default() -> Self
pub fn number_of_variables(&self) -> usize
pub fn lower_bound(&self) -> f64
pub fn upper_bound(&self) -> f64
Trait Implementations§
Source§impl Clone for RastriginProblem
impl Clone for RastriginProblem
Source§fn clone(&self) -> RastriginProblem
fn clone(&self) -> RastriginProblem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Problem<f64> for RastriginProblem
impl Problem<f64> for RastriginProblem
Source§fn dominates(
&self,
solution_a: &Solution<f64, f64>,
solution_b: &Solution<f64, f64>,
) -> bool
fn dominates( &self, solution_a: &Solution<f64, f64>, solution_b: &Solution<f64, f64>, ) -> bool
The solution that dominates is the one who is near to zero
fn new() -> Self
Source§fn evaluate(&self, solution: &mut Solution<f64>)
fn evaluate(&self, solution: &mut Solution<f64>)
Evaluates a solution and updates its quality/fitness
fn better_fitness_fn(&self) -> fn(f64, f64) -> bool
Source§fn create_solution(&self, rng: &mut Random) -> Solution<f64>
fn create_solution(&self, rng: &mut Random) -> Solution<f64>
Creates a new random solution for this problem that serves as a starting point for the algorithm
fn set_problem_description(&mut self, description: String)
fn get_problem_description(&self) -> String
Source§fn format_solution(&self, solution: &Solution<f64>) -> String
fn format_solution(&self, solution: &Solution<f64>) -> String
Returns a human-friendly representation for one solution. Read more
fn is_better_fitness(&self, candidate: f64, reference: f64) -> bool
fn non_improving_fitness_loss(&self, current: f64, candidate: f64) -> f64
fn get_problem_parameters_payload(&self) -> String
Auto Trait Implementations§
impl Freeze for RastriginProblem
impl RefUnwindSafe for RastriginProblem
impl Send for RastriginProblem
impl Sync for RastriginProblem
impl Unpin for RastriginProblem
impl UnsafeUnpin for RastriginProblem
impl UnwindSafe for RastriginProblem
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