Skip to main content

Objective

Trait Objective 

Source
pub trait Objective {
    // Required method
    fn query(&mut self, x: &[AxisValue]) -> Observation;

    // Provided method
    fn query_fidelity(&mut self, x: &[AxisValue], _fidelity: f64) -> Observation { ... }
}
Expand description

The thing an optimizer queries. The runtime’s PhaseFeed implements it by running a probe phase at the coordinate and reading the objective metric. The optimizer maximizes Observation::value.

Required Methods§

Source

fn query(&mut self, x: &[AxisValue]) -> Observation

Provided Methods§

Source

fn query_fidelity(&mut self, x: &[AxisValue], _fidelity: f64) -> Observation

Evaluate at a reduced fidelity in (0, 1] (1.0 = full). Default ignores fidelity (used by multi-fidelity methods).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§