pub struct FlowFieldBuilder;Expand description
Builds a PreparedFlowField for one goal on a uniform-cost 4-connected grid.
Preprocess is reverse BFS (integration + directions). Rejects non-unit
traversal_cost. Prefer when many agents share one static goal without MAPF.
Implementations§
Source§impl FlowFieldBuilder
impl FlowFieldBuilder
Sourcepub const fn new() -> FlowFieldBuilder
pub const fn new() -> FlowFieldBuilder
Creates a default builder (stateless).
Sourcepub fn preprocess(
&self,
grid: &Grid,
goal: Point,
) -> Result<PreparedFlowField, FlowFieldBuildError>
pub fn preprocess( &self, grid: &Grid, goal: Point, ) -> Result<PreparedFlowField, FlowFieldBuildError>
Preprocess a static grid for many agents sharing goal.
§Errors
Returns FlowFieldBuildError::InvalidGoal when goal is blocked or
out of bounds, and FlowFieldBuildError::NonUniformCost when any
walkable cell has a traversal cost other than 1.
Trait Implementations§
Source§impl Clone for FlowFieldBuilder
impl Clone for FlowFieldBuilder
Source§fn clone(&self) -> FlowFieldBuilder
fn clone(&self) -> FlowFieldBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FlowFieldBuilder
Source§impl Debug for FlowFieldBuilder
impl Debug for FlowFieldBuilder
Source§impl Default for FlowFieldBuilder
impl Default for FlowFieldBuilder
Source§fn default() -> FlowFieldBuilder
fn default() -> FlowFieldBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FlowFieldBuilder
impl RefUnwindSafe for FlowFieldBuilder
impl Send for FlowFieldBuilder
impl Sync for FlowFieldBuilder
impl Unpin for FlowFieldBuilder
impl UnsafeUnpin for FlowFieldBuilder
impl UnwindSafe for FlowFieldBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more