pub trait Problem: Clone {
type Solution;
type Value: Clone;
const NAME: &'static str;
// Required methods
fn parameter_names() -> &'static [&'static str];
fn parameters(&self) -> ProblemParameters;
fn evaluate(
&self,
solution: &Self::Solution,
) -> Result<Self::Value, EvaluationError>;
fn variant() -> Vec<(&'static str, &'static str)>;
// Provided method
fn problem_type() -> ProblemType { ... }
}Expand description
Minimal problem trait — a problem maps a solution to a value or an evaluation error.
This trait defines the interface for computational problems that can be evaluated or reduced to other problems.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn parameter_names() -> &'static [&'static str]
fn parameter_names() -> &'static [&'static str]
Canonical parameter names for this problem model.
Sourcefn parameters(&self) -> ProblemParameters
fn parameters(&self) -> ProblemParameters
Measure the complete canonical parameters of this concrete instance.
Provided Methods§
Sourcefn problem_type() -> ProblemType
fn problem_type() -> ProblemType
Look up this problem’s catalog entry.
Returns the full crate::registry::ProblemType metadata from the catalog registry.
The default implementation uses Self::NAME to perform the lookup.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".