Skip to main content

ObjectiveFunction

Trait ObjectiveFunction 

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

Source

fn evaluate(&self, result: &SimulationResult) -> Decimal

Evaluates the simulation result and returns a score.

Source

fn name(&self) -> &'static str

Returns the name of the objective function.

Provided Methods§

Source

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".

Implementors§