Trait Problem

Source
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§

Source

fn dimensions(&self) -> usize

Returns the dimensionality of the input domain.

Source

fn domain(&self) -> Vec<(f64, f64)>

Returns the input domain of the function in terms of upper and lower, respectively, for each input dimension.

Source

fn minimum(&self) -> (Vec<f64>, f64)

Returns the position as well as the value of the global minimum.

Source

fn random_start(&self) -> Vec<f64>

Generates a random and feasible position to start a minimization.

Provided Methods§

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.

Implementors§