pub trait Heuristic: Debug {
// Required methods
fn changes(&self, solve_state: &SolveState<'_>) -> Option<Changes>;
fn seen_coords(&self, solve_state: &SolveState<'_>) -> CoordSet;
fn description(&self) -> String;
}Expand description
Represents a heuristic for solving a Queens board.
Required Methods§
Sourcefn changes(&self, solve_state: &SolveState<'_>) -> Option<Changes>
fn changes(&self, solve_state: &SolveState<'_>) -> Option<Changes>
What changes would this heuristic make? This returns None if the heuristic does not see any possible changes, or returns Some(Changes) containing the changes it would make.
Sourcefn seen_coords(&self, solve_state: &SolveState<'_>) -> CoordSet
fn seen_coords(&self, solve_state: &SolveState<'_>) -> CoordSet
What coordinates did this heuristic consider?
This allows visualizations to highlight appropriate squares, or solvers to prioritize strategies that “look at” fewer coordinates.
Sourcefn description(&self) -> String
fn description(&self) -> String
A human explanation of what this heuristic does.
Important: This should always be two lines, so that animations know where to move the cursor. The recommended format is:
- First line – an explanation of what the heuristic saw.
- Second line – an explanation of what the heuristic does.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".