Skip to main content

PackSolver

Trait PackSolver 

Source
pub trait PackSolver: Send + Sync {
    // Required methods
    fn id(&self) -> &'static str;
    fn solve(
        &self,
        spec: &ProblemSpec,
    ) -> Result<(Value, SolverReport), GateError>;
    fn is_exact(&self) -> bool;
}
Expand description

A solver within a pack

Each pack can have multiple solvers (e.g., greedy, exact, heuristic).

Required Methods§

Source

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

Solver identifier (e.g., “greedy-v1”)

Source

fn solve(&self, spec: &ProblemSpec) -> Result<(Value, SolverReport), GateError>

Solve and produce plan payload + report

Source

fn is_exact(&self) -> bool

Whether this solver guarantees optimality

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§