pub struct BestFirst<'a, I, N, E, Ty, Ix, F> {
pub direction: Direction,
pub h: F,
/* private fields */
}
Expand description
Best first implementation.
This is a key function that is later used to implement variants, this is possible due to the pattern all variants repeat, where only the heuristics function changes but te procedure is the same.
The following searching methods are implemented using this function: - Dijkstra - A* - A* Weighted - Greedy best first
The function takes a function h
of type F
for computing the heuristic value for each node.
This function F
has access to the node index on the graph, the edge index of the connection
to its parent, the current state of the search instance and the index of its parent.
With all these values, any heuristic can be calculated, I presume.
Fields§
§direction: Direction
§h: F
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a, I, N, E, Ty, Ix, F> RefUnwindSafe for BestFirst<'a, I, N, E, Ty, Ix, F>where E: RefUnwindSafe, F: RefUnwindSafe, I: RefUnwindSafe, Ix: RefUnwindSafe, N: RefUnwindSafe, Ty: RefUnwindSafe,
impl<'a, I, N, E, Ty, Ix, F> !Send for BestFirst<'a, I, N, E, Ty, Ix, F>
impl<'a, I, N, E, Ty, Ix, F> !Sync for BestFirst<'a, I, N, E, Ty, Ix, F>
impl<'a, I, N, E, Ty, Ix, F> Unpin for BestFirst<'a, I, N, E, Ty, Ix, F>where F: Unpin, Ix: Unpin,
impl<'a, I, N, E, Ty, Ix, F> UnwindSafe for BestFirst<'a, I, N, E, Ty, Ix, F>where E: RefUnwindSafe, F: UnwindSafe, I: RefUnwindSafe, Ix: UnwindSafe + RefUnwindSafe, N: RefUnwindSafe, Ty: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more