pub trait TreeNode {
type State;
type Action;
type Cost;
// Required methods
fn state(&self) -> &Self::State;
fn parent(&self) -> Option<(usize, &Self::Action)>;
fn cost(&self) -> Self::Cost;
fn queue_evaluation(&self) -> Self::Cost;
fn queue_bias(&self) -> Option<Self::Cost>;
}Required Associated Types§
Required Methods§
Sourcefn parent(&self) -> Option<(usize, &Self::Action)>
fn parent(&self) -> Option<(usize, &Self::Action)>
If the node has a parent, get the identity of that parent and the action used to arrive from it.
Sourcefn cost(&self) -> Self::Cost
fn cost(&self) -> Self::Cost
Get the actual cost of arriving at this node from its initial state.
Sourcefn queue_evaluation(&self) -> Self::Cost
fn queue_evaluation(&self) -> Self::Cost
Evaluate this node for its placement in the search queue. For an uninformed node this would simply return its aggregated cost. For an informed node this would return its aggregated cost plus its remaining cost estimate.
Sourcefn queue_bias(&self) -> Option<Self::Cost>
fn queue_bias(&self) -> Option<Self::Cost>
Give a bias to this node. When queue_evaluation is exactly equal, the node will be ordered by this bias instead. Higher bias will push it later in the queue. For an informed node this could be its remaining cost estimate.