Skip to main content

ReachSearch

Struct ReachSearch 

Source
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>
where R: Reach<N> + Steer<N, R::Control>, G: Goal<N>,

Source

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
Source

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.

Source

pub fn nodes(&self) -> &[Node<R::Control, N>]

All search-tree nodes by id; node 0 is the root.

Source

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.

Source

pub const fn goal_node(&self) -> Option<usize>

The node whose set was proven inside the goal, if one was popped.

Source

pub const fn pruned(&self) -> usize

The number of descendants skipped by Config::prune_superseded_subtrees so far.

Source

pub const fn expansions(&self) -> usize

The number of nodes expanded so far.

Source

pub fn is_exhausted(&self) -> bool

Whether every generated node has been expanded, popped as the goal or superseded by a dominating node.

Source

pub const fn problem(&self) -> &Problem<R, N, G>

The problem being solved.

Source

pub fn branch(&self, node: usize) -> Vec<usize>

The node ids from the root to node, inclusive.

§Panics

Panics if node is not a node id.

Source

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>
where Problem<R, N, G>: Freeze, Vec<Node<<R as Reach<N>>::Control, N>>: Freeze, HashMap<[i64; N], Vec<usize>>: Freeze,

§

impl<R, const N: usize, G> Move for ReachSearch<R, N, G>

§

impl<R, const N: usize, G> RefUnwindSafe for ReachSearch<R, N, G>

§

impl<R, const N: usize, G> Send for ReachSearch<R, N, G>
where Problem<R, N, G>: Send, Vec<Node<<R as Reach<N>>::Control, N>>: Send, HashMap<[i64; N], Vec<usize>>: Send,

§

impl<R, const N: usize, G> Sync for ReachSearch<R, N, G>
where Problem<R, N, G>: Sync, Vec<Node<<R as Reach<N>>::Control, N>>: Sync, HashMap<[i64; N], Vec<usize>>: Sync,

§

impl<R, const N: usize, G> Unpin for ReachSearch<R, N, G>
where Problem<R, N, G>: Unpin, Vec<Node<<R as Reach<N>>::Control, N>>: Unpin, HashMap<[i64; N], Vec<usize>>: Unpin,

§

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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.