[−][src]Struct bracket_pathfinding::prelude::DijkstraMap
Representation of a Dijkstra flow map. map is a vector of floats, having a size equal to size_x * size_y (one per tile). size_x and size_y are stored for overflow avoidance. max_depth is the maximum number of iterations this search shall support.
Fields
map: Vec<f32>
Methods
impl DijkstraMap
[src]
pub fn new<T>(
size_x: T,
size_y: T,
starts: &[usize],
map: &dyn BaseMap,
max_depth: f32
) -> DijkstraMap where
T: TryInto<usize>,
[src]
size_x: T,
size_y: T,
starts: &[usize],
map: &dyn BaseMap,
max_depth: f32
) -> DijkstraMap where
T: TryInto<usize>,
Construct a new Dijkstra map, ready to run. You must specify the map size, and link to an implementation of a BaseMap trait that can generate exits lists. It then builds the map, giving you a result.
pub fn new_empty<T>(size_x: T, size_y: T, max_depth: f32) -> DijkstraMap where
T: TryInto<usize>,
[src]
T: TryInto<usize>,
Creates an empty Dijkstra map node.
pub fn clear(dm: &mut DijkstraMap)
[src]
pub fn build(dm: &mut DijkstraMap, starts: &[usize], map: &dyn BaseMap)
[src]
Builds the Dijkstra map: iterate from each starting point, to each exit provided by BaseMap's exits implementation. Each step adds cost to the current depth, and is discarded if the new depth is further than the current depth. If you provide more starting points than you have CPUs, automatically branches to a parallel version.
pub fn find_lowest_exit(
dm: &DijkstraMap,
position: usize,
map: &dyn BaseMap
) -> Option<usize>
[src]
dm: &DijkstraMap,
position: usize,
map: &dyn BaseMap
) -> Option<usize>
pub fn find_highest_exit(
dm: &DijkstraMap,
position: usize,
map: &dyn BaseMap
) -> Option<usize>
[src]
dm: &DijkstraMap,
position: usize,
map: &dyn BaseMap
) -> Option<usize>
Auto Trait Implementations
impl RefUnwindSafe for DijkstraMap
impl Send for DijkstraMap
impl Sync for DijkstraMap
impl Unpin for DijkstraMap
impl UnwindSafe for DijkstraMap
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,