Trait multivariate_optimization::optimize::Specimen
source · pub trait Specimen {
// Required methods
fn params(&self) -> &[f64];
fn cmp_cost(&self, other: &Self) -> Ordering;
// Provided method
fn params_dist(&self, other: &Self) -> f64 { ... }
}Expand description
Specimen in evolutionary process.
Two methods are required to be implemented:
- The
paramsmethod needs to return the parameters originally used to create the specimen (seeconstructorargument to functionSolver::new). - The
cmp_costmethod compares specimen by their fitness (lower cost values are better).
For most cases, the module provides a BasicSpecimen which is an
implementation only storing the params and cost values.
Required Methods§
Provided Methods§
sourcefn params_dist(&self, other: &Self) -> f64
fn params_dist(&self, other: &Self) -> f64
Euclidean distance between two specimens’ parameters