pub enum GraphParam {
Start,
Neighbours,
Weight,
Heuristic,
Goal,
}Expand description
One parameter of a graph helper, as a shape rather than as a type.
praxis-stdlib cannot name a Type — that is praxis-typeck, which depends
on this crate — so the signature is written as the shapes inference then
builds the types from. The match on this in seed_builtin_schemes is
exhaustive, so a new shape is a compile error there rather than a parameter
that silently gets the wrong type.
Variants§
Start
The state the walk starts from: a T.
Neighbours
(T) -> Vec[T] — the states reachable in one step from a given one.
Returning a Vec rather than a lazy sequence is what makes the helper
callable from the runtime, which has no way to drive a pipeline.
Weight
(T, T) -> Int — the cost of the edge between two adjacent states.
Heuristic
(T) -> Int — the estimated remaining cost from a state to a goal.
Goal
(T) -> Bool — whether a state is a goal. A predicate rather than a
goal value so a search can stop on a property (|s| s.0 == n), which
is what §6.5’s own example writes.
Trait Implementations§
Source§impl Clone for GraphParam
impl Clone for GraphParam
Source§fn clone(&self) -> GraphParam
fn clone(&self) -> GraphParam
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more