pub struct Weight { /* private fields */ }Expand description
A rational heuristic weight w = numerator / denominator for Weighted A*.
Rational so that integer costs keep exact arithmetic: Weighted A* orders by
denominator * g + numerator * h, which sorts like g + w * h.
Implementations§
Source§impl Weight
impl Weight
Sourcepub const fn new(numerator: u32, denominator: u32) -> Weight
pub const fn new(numerator: u32, denominator: u32) -> Weight
Creates the weight numerator / denominator.
Weights below 1 are allowed; they bias the search towards Dijkstra’s order.
§Panics
Panics if denominator is zero.
Sourcepub const fn denominator(self) -> u32
pub const fn denominator(self) -> u32
The denominator of the weight. Never zero.
Trait Implementations§
impl Copy for Weight
impl Eq for Weight
impl StructuralPartialEq for Weight
Auto Trait Implementations§
impl Forget for Weight
impl Freeze for Weight
impl Move for Weight
impl RefUnwindSafe for Weight
impl Send for Weight
impl Sync for Weight
impl Unpin for Weight
impl UnsafeUnpin for Weight
impl UnwindSafe for Weight
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