pub trait Objective<Something> {
// Required method
fn score(&self, something: &Something) -> f64;
}Expand description
Objective function. The genetic algorithms try to minimize this function. Possible functions include “length of program” (the algorithm tries to reduce this, so it will find the shortest program), and “average runtime in machine cycles” (the algorithm tries to reduce this, so it will find faster programs).
Required Methods§
Sourcefn score(&self, something: &Something) -> f64
fn score(&self, something: &Something) -> f64
Evaluates the objective function