Skip to main content

a_star/discovered/
discovered_set.rs

1use crate::NodeCost;
2
3/// Responsible for keeping track of the discovered nodes.
4pub trait DiscoveredSet<Node, Cost>
5where
6    Node: Copy,
7    Cost: Copy + Ord,
8{
9    /// Pushes the `node` with its associated `f(n)` cost.
10    fn push(&mut self, node: NodeCost<Node, Cost>);
11
12    /// Pops the node with the lowest `f(n)` cost.
13    fn pop(&mut self) -> Option<NodeCost<Node, Cost>>;
14
15    /// Removes all the nodes from the set.
16    fn clear(&mut self);
17}