pub trait OptimizationProblem: Problem<Metric = SolutionSize<Self::Value>> {
type Value: PartialOrd + Clone;
// Required method
fn direction(&self) -> Direction;
}Expand description
Extension for problems with a numeric objective to optimize.
The supertrait bound guarantees Metric = SolutionSize<Self::Value>,
so the solver can call metric.is_valid() and metric.is_better()
directly — no per-problem customization needed.
Required Associated Types§
Sourcetype Value: PartialOrd + Clone
type Value: PartialOrd + Clone
The inner objective value type (e.g., i32, f64).
Required Methods§
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.