Skip to main content

GridAStarOpts

Struct GridAStarOpts 

Source
pub struct GridAStarOpts<'a> {
    pub width: usize,
    pub height: usize,
    pub diagonal: bool,
    pub periodic: bool,
    pub admissibility: f64,
    pub walkable: Option<&'a dyn Fn(usize, usize) -> bool>,
    pub cost_metric: Option<&'a dyn CostMetric>,
}
Expand description

Options for the full-featured grid A* pathfinder.

Mirrors the keyword arguments of Agents.jl Pathfinding.AStar.

Fields§

§width: usize

Grid width.

§height: usize

Grid height.

§diagonal: bool

Allow diagonal movement (8-connected vs 4-connected).

§periodic: bool

Periodic (toroidal) boundary wrapping.

§admissibility: f64

Admissibility factor. 0.0 gives optimal paths. Higher values allow suboptimal paths for faster search: the algorithm uses f = g + (1 + admissibility) * h.

Mirrors Agents.jl admissibility keyword.

§walkable: Option<&'a dyn Fn(usize, usize) -> bool>

Walkability predicate: walkable(x, y) returns true if the cell is passable. Defaults to all-walkable if None.

§cost_metric: Option<&'a dyn CostMetric>

Cost metric for heuristic and edge cost estimation. Defaults to DirectDistance if None.

Implementations§

Source§

impl<'a> GridAStarOpts<'a>

Source

pub fn new(width: usize, height: usize) -> Self

Create default options for a grid of the given dimensions.

Trait Implementations§

Source§

impl<'a> Debug for GridAStarOpts<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for GridAStarOpts<'a>

§

impl<'a> !RefUnwindSafe for GridAStarOpts<'a>

§

impl<'a> !Send for GridAStarOpts<'a>

§

impl<'a> !Sync for GridAStarOpts<'a>

§

impl<'a> Unpin for GridAStarOpts<'a>

§

impl<'a> UnsafeUnpin for GridAStarOpts<'a>

§

impl<'a> !UnwindSafe for GridAStarOpts<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V