Skip to main content

Optimizer

Trait Optimizer 

Source
pub trait Optimizer: Send {
    // Required methods
    fn name(&self) -> &str;
    fn doc_md(&self) -> &str;
    fn coordinate_source(
        &self,
        space: &SearchSpace,
        budget: &Budget,
        lex: Box<dyn PullSource>,
    ) -> Box<dyn CoordinateSource>;

    // Provided method
    fn optimize(
        &self,
        space: &SearchSpace,
        obj: &mut dyn Objective,
        budget: &Budget,
    ) -> Report { ... }
}
Expand description

A non-derivative, multi-factor optimizer — a stateless functor that transforms the default lexicographic coordinate stream into a (possibly adaptive) CoordinateSource (SRD-86). The search state lives in the produced source, not in the optimizer.

Required Methods§

Source

fn name(&self) -> &str

The registered name (matches the registry key).

Source

fn doc_md(&self) -> &str

User-level documentation, in markdown (SRD-86 §5). Surfaced by nmbrs describe optimizers.

Source

fn coordinate_source( &self, space: &SearchSpace, budget: &Budget, lex: Box<dyn PullSource>, ) -> Box<dyn CoordinateSource>

Build the coordinate source from the param space, the budget, and the default lex stream. sweep returns lex unchanged (identity). The source owns its own termination (budget / convergence); the driver pulls until it yields None.

Provided Methods§

Source

fn optimize( &self, space: &SearchSpace, obj: &mut dyn Objective, budget: &Budget, ) -> Report

Standalone driver: run the search by pulling this optimizer’s source and querying obj, returning a Report. Used for unit testing and the non-runtime path; the graph executor drives the source itself (pull-through, observing each phase’s objective wire).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§