pub trait Problem: Function + Default {
// Required methods
fn dimensions(&self) -> usize;
fn domain(&self) -> Vec<(f64, f64)>;
fn minimum(&self) -> (Vec<f64>, f64);
fn random_start(&self) -> Vec<f64>;
// Provided method
fn is_legal_position(&self, position: &[f64]) -> bool { ... }
}
Expand description
Specifies a well known optimization problem.
Required Methods§
Sourcefn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Returns the dimensionality of the input domain.
Sourcefn domain(&self) -> Vec<(f64, f64)>
fn domain(&self) -> Vec<(f64, f64)>
Returns the input domain of the function in terms of upper and lower, respectively, for each input dimension.
Sourcefn minimum(&self) -> (Vec<f64>, f64)
fn minimum(&self) -> (Vec<f64>, f64)
Returns the position as well as the value of the global minimum.
Sourcefn random_start(&self) -> Vec<f64>
fn random_start(&self) -> Vec<f64>
Generates a random and feasible position to start a minimization.
Provided Methods§
Sourcefn is_legal_position(&self, position: &[f64]) -> bool
fn is_legal_position(&self, position: &[f64]) -> bool
Tests whether the supplied position is legal for this function.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.