pub trait ObjectiveFunction {
// Required methods
fn evaluate(&self, result: &SimulationResult) -> Decimal;
fn name(&self) -> &'static str;
// Provided method
fn compare(&self, a: &SimulationResult, b: &SimulationResult) -> Ordering { ... }
}Expand description
Trait for objective functions.
Required Methods§
Sourcefn evaluate(&self, result: &SimulationResult) -> Decimal
fn evaluate(&self, result: &SimulationResult) -> Decimal
Evaluates the simulation result and returns a score.
Provided Methods§
Sourcefn compare(&self, a: &SimulationResult, b: &SimulationResult) -> Ordering
fn compare(&self, a: &SimulationResult, b: &SimulationResult) -> Ordering
Compares two simulation results.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".