pub struct Zero;Expand description
The blind heuristic: estimates Cost::ZERO everywhere. Turns A* into Dijkstra’s
algorithm and is admissible and consistent for every non-negative cost.
Implemented for every scalar Cost and for raw f64 values, which are not a Cost
(they are not Ord) but are what value-iteration style searches estimate in. Cost
vectors keep their own zero heuristic (see MIGRATION.md).
§Examples
use search_core::{Decimal, Heuristic, Zero};
assert_eq!(Heuristic::<&str>::estimate(&mut Zero, &"any"), Some(0_u32));
assert_eq!(Heuristic::<u8, Decimal<2>>::estimate(&mut Zero, &1), Some(Decimal::from_raw(0)));
assert_eq!(Heuristic::<u8, f64>::estimate(&mut Zero, &1), Some(0.0));Trait Implementations§
impl Copy for Zero
impl Eq for Zero
Source§impl<S> Heuristic<S, f64> for Zero
Raw f64 estimates: f64 is not a Cost, so this does not overlap the impl above.
impl<S> Heuristic<S, f64> for Zero
Raw f64 estimates: f64 is not a Cost, so this does not overlap the impl above.
impl StructuralPartialEq for Zero
Auto Trait Implementations§
impl Forget for Zero
impl Freeze for Zero
impl Move for Zero
impl RefUnwindSafe for Zero
impl Send for Zero
impl Sync for Zero
impl Unpin for Zero
impl UnsafeUnpin for Zero
impl UnwindSafe for Zero
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