pub struct RrtxGraph<X: Scalar, T: Trajectory<X, N>, const N: usize> { /* private fields */ }Implementations§
Source§impl<X, T, const N: usize> RrtxGraph<X, T, N>where
X: Scalar,
T: Trajectory<X, N>,
impl<X, T, const N: usize> RrtxGraph<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 neighbor_set(
&self,
a: NodeIndex,
set: NeighborSet,
) -> NeighborSetIter<'_, X, T, N> ⓘ
pub fn neighbor_set( &self, a: NodeIndex, set: NeighborSet, ) -> NeighborSetIter<'_, X, T, N> ⓘ
Returns an iterator over the neighbors to a in the described set
Sourcepub fn neighbor_set_walker(
&self,
node: NodeIndex,
set: NeighborSet,
) -> NeighborSetWalker
pub fn neighbor_set_walker( &self, node: NodeIndex, set: NeighborSet, ) -> NeighborSetWalker
Returns an walker over the neighbors to a in the described set
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 for the root node
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) -> Childern<'_, X, T, N> ⓘ
pub fn children(&self, node: NodeIndex) -> Childern<'_, X, T, N> ⓘ
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) -> ChildernWalker
pub fn children_walker(&self, node: NodeIndex) -> ChildernWalker
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 Returns None if they aren’t connected
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 add_node(&mut self, node: Node<X, N>) -> NodeIndex
pub fn add_node(&mut self, node: Node<X, N>) -> NodeIndex
Adds a node to the graph and returns it’s index
Sourcepub fn add_edge(
&mut self,
a: NodeIndex,
b: NodeIndex,
outgoing_neighbor_type: NeighborType,
incoming_neighbor_type: NeighborType,
is_parent: bool,
trajectory: T,
) -> EdgeIndex
pub fn add_edge( &mut self, a: NodeIndex, b: NodeIndex, outgoing_neighbor_type: NeighborType, incoming_neighbor_type: NeighborType, is_parent: bool, trajectory: T, ) -> EdgeIndex
Adds a edge to the graph from a -> b with the associated data
Sourcepub fn change_parent(
&mut self,
node: NodeIndex,
new_parent: NodeIndex,
) -> Result<Option<NodeIndex>, Option<NodeIndex>>
pub fn change_parent( &mut self, node: NodeIndex, new_parent: NodeIndex, ) -> Result<Option<NodeIndex>, Option<NodeIndex>>
Switches the unique parent edge from node to the new_parent Still keeps a connection to the old parent Returns Ok if the new_parent was set correctly, otherwise Err Either way, returns the old_parent if was found
Sourcepub fn remove_parent(&mut self, node_idx: NodeIndex) -> Option<NodeIndex>
pub fn remove_parent(&mut self, node_idx: NodeIndex) -> Option<NodeIndex>
Blindly sets edge connected to parent node as not a parent Return Some parent index if found
Sourcepub fn remove_running_neighbor(
&mut self,
node: NodeIndex,
neighbor: NodeIndex,
) -> Option<()>
pub fn remove_running_neighbor( &mut self, node: NodeIndex, neighbor: NodeIndex, ) -> Option<()>
Removes any outgoing or incoming running neighbor connection on the edge from node -> neighbor Returns None if the edge wasn’t found
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 check_node(&self, idx: NodeIndex) -> bool
pub fn check_node(&self, idx: NodeIndex) -> bool
Checks if the specified node exists
Sourcepub fn delete_node(&mut self, idx: NodeIndex)
pub fn delete_node(&mut self, idx: NodeIndex)
Irreversibly delete the specified node
panics if idx is invalid
Sourcepub fn get_edge(&self, idx: EdgeIndex) -> &Edge<X, T, N>
pub fn get_edge(&self, idx: EdgeIndex) -> &Edge<X, T, N>
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
panics if idx is invalid
Sourcepub fn get_trajectory(
&self,
idx: EdgeIndex,
) -> Option<FullTrajRefOwned<'_, X, T, N>>
pub fn get_trajectory( &self, idx: EdgeIndex, ) -> Option<FullTrajRefOwned<'_, X, T, N>>
Returns the trajectory stored at the specified edge if exists
panics if idx is invalid
Sourcepub fn update_trajectory(&mut self, idx: EdgeIndex, new_trajectory: T)
pub fn update_trajectory(&mut self, idx: EdgeIndex, new_trajectory: T)
Updates the trajectory along the specified edge
panics if idx is invalid
Sourcepub fn set_infinite_edge_cost(&mut self, idx: EdgeIndex)
pub fn set_infinite_edge_cost(&mut self, idx: EdgeIndex)
Sets the cost of the given edge to infinity
panics if idx is invalid
Trait Implementations§
Source§impl<X: Clone + Scalar, T: Clone + Trajectory<X, N>, const N: usize> Clone for RrtxGraph<X, T, N>
impl<X: Clone + Scalar, T: Clone + Trajectory<X, N>, const N: usize> Clone for RrtxGraph<X, T, N>
Source§impl<X: Debug + Scalar, T: Debug + Trajectory<X, N>, const N: usize> Debug for RrtxGraph<X, T, N>
impl<X: Debug + Scalar, T: Debug + Trajectory<X, N>, const N: usize> Debug for RrtxGraph<X, T, N>
Source§impl<'de, X, T, const N: usize> Deserialize<'de> for RrtxGraph<X, T, N>
impl<'de, X, T, const N: usize> Deserialize<'de> for RrtxGraph<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 RrtxGraph<X, T, N>
impl<X, T, const N: usize> RefUnwindSafe for RrtxGraph<X, T, N>where
T: RefUnwindSafe,
X: RefUnwindSafe,
impl<X, T, const N: usize> Send for RrtxGraph<X, T, N>
impl<X, T, const N: usize> Sync for RrtxGraph<X, T, N>
impl<X, T, const N: usize> Unpin for RrtxGraph<X, T, N>
impl<X, T, const N: usize> UnwindSafe for RrtxGraph<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.