Skip to main content

Solver

Trait Solver 

Source
pub trait Solver: Send + Sync {
    type Problem: Problem;
    type Plan: Plan<Problem = Self::Problem>;

    // Required methods
    fn problem_kind(&self) -> ProblemKind;
    fn make_plan<T>(
        &self,
        problem: &Self::Problem,
        planner: &mut Planner<T>,
    ) -> Option<Self::Plan>
       where T: Float;
    fn name(&self) -> &'static str;

    // Provided method
    fn priority(&self) -> i32 { ... }
}
Expand description

Solver creates plans for specific problem types.

The planner iterates through registered solvers to find the best plan for a given problem.

Required Associated Types§

Source

type Problem: Problem

The problem type this solver handles.

Source

type Plan: Plan<Problem = Self::Problem>

The plan type this solver produces.

Required Methods§

Source

fn problem_kind(&self) -> ProblemKind

Problem kind this solver handles.

Source

fn make_plan<T>( &self, problem: &Self::Problem, planner: &mut Planner<T>, ) -> Option<Self::Plan>
where T: Float,

Attempt to create a plan for the given problem.

Returns None if this solver cannot handle the problem.

Source

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

Solver name for debugging.

Provided Methods§

Source

fn priority(&self) -> i32

Priority hint (higher = try first).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§