struct Position {
coordinates: (u8, u8),
facing: Facing,
score: u32,
distance: u32,
visited: Vec<(u8, u8)>,
}
Expand description
A node in the graph search storing the position and facing, the score and estimated distance to the goal to allow ordering, and a record of the path taken to reach this node.
Fields§
§coordinates: (u8, u8)
§facing: Facing
§score: u32
§distance: u32
§visited: Vec<(u8, u8)>
Implementations§
source§impl Position
impl Position
pub fn new( coordinates: (u8, u8), facing: Facing, score: u32, distance: u32, visited: Vec<(u8, u8)>, ) -> Self
sourcefn turn_to(&self, facing: Facing, maze: &Maze) -> Self
fn turn_to(&self, facing: Facing, maze: &Maze) -> Self
The updated facing, cost and remaining distance guess after turning to a new facing
Trait Implementations§
source§impl Ord for Position
impl Ord for Position
source§impl PartialOrd for Position
impl PartialOrd for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.