pub trait Procedure<P> {
type Output;
type State;
const NAME: &'static str;
// Required methods
fn step(
&self,
problem: &mut P,
state: &mut Self::State,
guard: CancellationGuard<'_>,
);
fn finalise(&self, problem: &mut P, state: &Self::State) -> Self::Output;
// Provided method
fn initialise(&self, _problem: &mut P, _state: &mut Self::State) { ... }
}Expand description
Trait implemented by all problems solvable by Trellis
A procedure defines the core loop of the solver. Typically we would write a for loop, consisting of an initialisation step where the procedure is arranged, a procedure carried out on each loop iteration, and a finalisation step prior to return. This trait separates these methods so they can be called by the Engine
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn step(
&self,
problem: &mut P,
state: &mut Self::State,
guard: CancellationGuard<'_>,
)
fn step( &self, problem: &mut P, state: &mut Self::State, guard: CancellationGuard<'_>, )
One iteration of the core algorithm
Provided Methods§
Sourcefn initialise(&self, _problem: &mut P, _state: &mut Self::State)
fn initialise(&self, _problem: &mut P, _state: &mut Self::State)
Initialisation.
This step prepares the state object for the main procedure loop.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".