pub trait WidthProblem {
type State: Clone;
type Action: Clone;
// Required methods
fn initial_state(&self) -> Self::State;
fn successors(
&self,
state: &Self::State,
out: &mut Vec<(Self::Action, Self::State)>,
);
fn features(&self, state: &Self::State, out: &mut Vec<u32>);
fn num_features(&self) -> usize;
fn is_goal(&self, state: &Self::State) -> bool;
}Expand description
A search problem described by successors and integer features.
Width-based search never inspects states directly. It only needs the
successors of a state, the goal test, and the features that are true in a
state, numbered 0..num_features(). Novelty is computed over those
features, so their choice decides what counts as “new”.
Required Associated Types§
Required Methods§
Sourcefn initial_state(&self) -> Self::State
fn initial_state(&self) -> Self::State
The state the search starts from.
Sourcefn successors(
&self,
state: &Self::State,
out: &mut Vec<(Self::Action, Self::State)>,
)
fn successors( &self, state: &Self::State, out: &mut Vec<(Self::Action, Self::State)>, )
Push all (action, successor) pairs of state into out.
Sourcefn features(&self, state: &Self::State, out: &mut Vec<u32>)
fn features(&self, state: &Self::State, out: &mut Vec<u32>)
Push the feature ids (< num_features()) true in state into out.
Sourcefn num_features(&self) -> usize
fn num_features(&self) -> usize
Number of distinct features; every id from WidthProblem::features
must be below it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".