pub struct RrtStarTree<X, T, const N: usize>where
X: Scalar,
T: Trajectory<X, N>,{ /* private fields */ }Expand description
Tree structure for holding the optimal tree
Implementations§
Source§impl<X, T, const N: usize> RrtStarTree<X, T, N>
impl<X, T, const N: usize> RrtStarTree<X, T, N>
Source§impl<X, T, const N: usize> RrtStarTree<X, T, N>where
X: Scalar,
T: Trajectory<X, N>,
impl<X, T, const N: usize> RrtStarTree<X, T, N>where
X: Scalar,
T: Trajectory<X, N>,
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Returns the number of nodes in the graph
Sourcepub fn get_goal_idx(&self) -> NodeIndex
pub fn get_goal_idx(&self) -> NodeIndex
Returns the index of the goal node
Sourcepub fn all_edges(&self) -> EdgeIter<'_, X, T, N> ⓘ
pub fn all_edges(&self) -> EdgeIter<'_, X, T, N> ⓘ
Returns iterator over all edges in the graph
Sourcepub fn parent(&self, node: NodeIndex) -> Option<NodeIndex>
pub fn parent(&self, node: NodeIndex) -> Option<NodeIndex>
Returns the NodeIndex of the parent of a in the optimal subtree if exists Returns None if no parent edge
Sourcepub fn is_parent(&self, node: NodeIndex, parent: NodeIndex) -> bool
pub fn is_parent(&self, node: NodeIndex, parent: NodeIndex) -> bool
Looks up edge from node -> parent to see if parent is the parent of node
Sourcepub fn children(&self, node: NodeIndex) -> Neighbors<'_, T, DefaultIx>
pub fn children(&self, node: NodeIndex) -> Neighbors<'_, T, DefaultIx>
Returns iterator over all children of a in the optimal subtree. Iterator will be empty for leaf nodes
Sourcepub fn children_walker(&self, node: NodeIndex) -> WalkNeighbors<DefaultIx>
pub fn children_walker(&self, node: NodeIndex) -> WalkNeighbors<DefaultIx>
Returns walker over all children of a in the optimal subtree. Iterator will be empty for leaf nodes
Sourcepub fn is_child(&self, node: NodeIndex, child: NodeIndex) -> bool
pub fn is_child(&self, node: NodeIndex, child: NodeIndex) -> bool
Looks up edge from child -> node to see if node is the parent of child
Sourcepub fn add_orphan(&mut self, node: NodeIndex)
pub fn add_orphan(&mut self, node: NodeIndex)
Add node and children of node to the internal set of orphans
This garentees that the children of any orphan node are also marked as orphans as soon as they are added
Sourcepub fn remove_orphan(&mut self, node: NodeIndex)
pub fn remove_orphan(&mut self, node: NodeIndex)
Remove node from the internal list of orphans, doesn’t modifiy the graph
Sourcepub fn is_orphan(&self, node: NodeIndex) -> bool
pub fn is_orphan(&self, node: NodeIndex) -> bool
Checks if node is in the internal set of orphans
Sourcepub fn clear_orphans(&mut self)
pub fn clear_orphans(&mut self)
Remove all orphan nodes from the graph and the orphan set
Sourcepub fn add_node(
&mut self,
node: Node<X, N>,
parent: NodeIndex,
trajectory: T,
) -> (NodeIndex, EdgeIndex)
pub fn add_node( &mut self, node: Node<X, N>, parent: NodeIndex, trajectory: T, ) -> (NodeIndex, EdgeIndex)
Adds a node to the graph and returns it’s index in addition fo the edge index to the parent
Sourcepub fn update_edge(
&mut self,
node: NodeIndex,
new_parent: NodeIndex,
new_trajectory: T,
) -> EdgeIndex
pub fn update_edge( &mut self, node: NodeIndex, new_parent: NodeIndex, new_trajectory: T, ) -> EdgeIndex
Sets the new parent and removes any existing parent
Sourcepub fn get_optimal_path(
&self,
node: NodeIndex,
) -> Option<OptimalPathIter<'_, X, T, N>>
pub fn get_optimal_path( &self, node: NodeIndex, ) -> Option<OptimalPathIter<'_, X, T, N>>
Returns an iterator of edges over the optimal path to the goal node Returns None if no such path exists
Sourcepub fn get_node(&self, idx: NodeIndex) -> &Node<X, N>
pub fn get_node(&self, idx: NodeIndex) -> &Node<X, N>
Returns a refernce the specified node
panics if idx is invalid
Sourcepub fn get_node_mut(&mut self, idx: NodeIndex) -> &mut Node<X, N>
pub fn get_node_mut(&mut self, idx: NodeIndex) -> &mut Node<X, N>
Returns a mutable refernce the specified node
panics if idx is invalid
Sourcepub fn get_edge(&self, idx: EdgeIndex) -> &T
pub fn get_edge(&self, idx: EdgeIndex) -> &T
Returns a refernce the specified edge
panics if idx is invalid
Sourcepub fn get_endpoints(&self, idx: EdgeIndex) -> (NodeIndex, NodeIndex)
pub fn get_endpoints(&self, idx: EdgeIndex) -> (NodeIndex, NodeIndex)
Returns source and target endpoints of an edge
Sourcepub fn get_trajectory(&self, idx: EdgeIndex) -> FullTrajRefOwned<'_, X, T, N>
pub fn get_trajectory(&self, idx: EdgeIndex) -> FullTrajRefOwned<'_, X, T, N>
Returns the trajectory stored at the specified edge
panics if idx is invalid
Trait Implementations§
Source§impl<X, T, const N: usize> Clone for RrtStarTree<X, T, N>
impl<X, T, const N: usize> Clone for RrtStarTree<X, T, N>
Source§fn clone(&self) -> RrtStarTree<X, T, N>
fn clone(&self) -> RrtStarTree<X, T, N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<X, T, const N: usize> Debug for RrtStarTree<X, T, N>
impl<X, T, const N: usize> Debug for RrtStarTree<X, T, N>
Source§impl<'de, X, T, const N: usize> Deserialize<'de> for RrtStarTree<X, T, N>
impl<'de, X, T, const N: usize> Deserialize<'de> for RrtStarTree<X, T, N>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl<X, T, const N: usize> Freeze for RrtStarTree<X, T, N>
impl<X, T, const N: usize> RefUnwindSafe for RrtStarTree<X, T, N>where
T: RefUnwindSafe,
X: RefUnwindSafe,
impl<X, T, const N: usize> Send for RrtStarTree<X, T, N>where
T: Send,
impl<X, T, const N: usize> Sync for RrtStarTree<X, T, N>where
T: Sync,
impl<X, T, const N: usize> Unpin for RrtStarTree<X, T, N>
impl<X, T, const N: usize> UnwindSafe for RrtStarTree<X, T, N>where
T: UnwindSafe,
X: 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Pointable for T
impl<T> Pointable for 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.