TreeNode

Trait TreeNode 

Source
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§

Source

type State

The type used to describe the state of the node.

Source

type Action

The type of action that can be taken from one node to another.

Source

type Cost

The type used to decide whether to prefer one node over another. Lower values are preferable.

Required Methods§

Source

fn state(&self) -> &Self::State

Get the state of the node.

Source

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.

Source

fn cost(&self) -> Self::Cost

Get the actual cost of arriving at this node from its initial state.

Source

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.

Source

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.

Implementors§

Source§

impl<State, Action, Cost> TreeNode for mapf::algorithm::a_star::Node<State, Action, Cost>
where Cost: Clone + Add<Cost, Output = Cost>,

Source§

type State = State

Source§

type Action = Action

Source§

type Cost = Cost

Source§

impl<State, Action, Cost: Clone> TreeNode for mapf::algorithm::dijkstra::forward::Node<State, Action, Cost>

Source§

type State = State

Source§

type Action = Action

Source§

type Cost = Cost