pub trait CostSearchable: Scoreable + Sized {
// Required method
fn next_states_with_costs(
&self,
) -> impl Iterator<Item = (Self, Self::Score)>;
}Expand description
Trait for search space exploration guided by a cost function & heuristic.
Implement this + Scoreable + SolutionIdentifiable to perform A* guided search-space exploration.
Searchable is automatically implemented if this trait is implemented.
Required Methods§
Sourcefn next_states_with_costs(&self) -> impl Iterator<Item = (Self, Self::Score)>
fn next_states_with_costs(&self) -> impl Iterator<Item = (Self, Self::Score)>
Yield all adjacent explorable states reachable from this state, paired with the associated cost of traversing from the current state each new state.
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.