pub struct ReachSearch<R: Reach<N>, const N: usize, G = PolytopeGoal<N>> { /* private fields */ }Expand description
A* over reachable-set nodes; see the module docs.
Every edge in the search tree is proven safe over its whole duration, every intermediate time step included, from the reachable set of its parent.
Implementations§
Source§impl<R, const N: usize, G> ReachSearch<R, N, G>
impl<R, const N: usize, G> ReachSearch<R, N, G>
Sourcepub fn new(problem: Problem<R, N, G>, config: Config) -> Result<Self, Error>
pub fn new(problem: Problem<R, N, G>, config: Config) -> Result<Self, Error>
Checks the start set and the settings and pushes the root.
§Errors
Error::ResolutionOutOfRangeif the resolution is not positive and finite.Error::GoalRadiusOutOfRangeif a fixed goal radius is negative or NaN.Error::GoalRadiusUnavailableif the radius should come from a goal that has none.Error::InvalidCostWeightif the cost weight is negative or not finite.Error::InvalidBoundsif the bounds are NaN, inverted or exclude the start, or, withConfig::bounds_contain_sets, do not provably contain the start set.Error::InvalidDedupToleranceif the proven-dedup tolerance is negative or not finite.Error::StartNotSafeif the start set is not proven disjoint from every obstacle.
Sourcepub fn solve(&mut self) -> Option<Path<[f64; N]>>
pub fn solve(&mut self) -> Option<Path<[f64; N]>>
Searches until a goal node is popped, the open list runs empty or
Config::max_expansions nodes are expanded.
Returns the nominal path to the goal, or None if none was found. Calling it again
after a budget stop continues with a fresh budget.
§Panics
Panics if the model’s sets do not have the obstacles’ dimension.
Sourcepub fn cost(&self, node: usize) -> f64
pub fn cost(&self, node: usize) -> f64
The cost from the root to node: the nominal path length with Cost::Length.
§Panics
Panics if node is not a node id.
Sourcepub const fn goal_node(&self) -> Option<usize>
pub const fn goal_node(&self) -> Option<usize>
The node whose set was proven inside the goal, if one was popped.
Sourcepub const fn pruned(&self) -> usize
pub const fn pruned(&self) -> usize
The number of descendants skipped by Config::prune_superseded_subtrees so far.
Sourcepub const fn expansions(&self) -> usize
pub const fn expansions(&self) -> usize
The number of nodes expanded so far.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Whether every generated node has been expanded, popped as the goal or superseded by a dominating node.
Sourcepub fn path(&self) -> Option<Path<[f64; N]>>
pub fn path(&self) -> Option<Path<[f64; N]>>
The nominal path to the goal node, or None if the goal was not reached yet.
The cost is ReachSearch::cost of the goal node. With Cost::Length that is the
Euclidean length of the nominal path, bit for bit.
Auto Trait Implementations§
impl<R, const N: usize, G> Forget for ReachSearch<R, N, G>
impl<R, const N: usize, G> Freeze for ReachSearch<R, N, G>
impl<R, const N: usize, G> Move for ReachSearch<R, N, G>
impl<R, const N: usize, G> RefUnwindSafe for ReachSearch<R, N, G>where
Problem<R, N, G>: RefUnwindSafe,
Vec<Node<<R as Reach<N>>::Control, N>>: RefUnwindSafe,
HashMap<[i64; N], Vec<usize>>: RefUnwindSafe,
impl<R, const N: usize, G> Send for ReachSearch<R, N, G>
impl<R, const N: usize, G> Sync for ReachSearch<R, N, G>
impl<R, const N: usize, G> Unpin for ReachSearch<R, N, G>
impl<R, const N: usize, G> UnsafeUnpin for ReachSearch<R, N, G>where
Problem<R, N, G>: UnsafeUnpin,
Vec<Node<<R as Reach<N>>::Control, N>>: UnsafeUnpin,
HashMap<[i64; N], Vec<usize>>: UnsafeUnpin,
impl<R, const N: usize, G> UnwindSafe for ReachSearch<R, N, G>where
Problem<R, N, G>: UnwindSafe,
Vec<Node<<R as Reach<N>>::Control, N>>: UnwindSafe,
HashMap<[i64; N], Vec<usize>>: UnwindSafe,
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.