pub trait ObjectiveFunction { // Required method fn evaluate(&self, params: &[f64; 4]) -> f64; // Provided method fn in_bounds(&self, _params: &[f64; 4]) -> bool { ... } }
Objective function trait for optimization
Evaluate objective function
Check if parameters are within bounds