![]() |
Parasol Planning Library (PPL)
|
#include <CCTracker.h>
Public Types | |
Motion Planning Types | |
typedef RoadmapType::VID | VID |
typedef RoadmapType::vertex_iterator | vertex_iterator |
typedef RoadmapType::adj_edge_iterator | edge_iterator |
typedef RoadmapType::VertexSet | VertexSet |
Local Types | |
typedef CCTracker< RoadmapType > | CCTrackerType |
typedef std::unordered_set< VertexSet * > | ComponentSet |
typedef std::function< void(const CCTrackerType *const, const VertexSet *const)> | CreatedHook |
typedef std::function< void(const CCTrackerType *const, const VertexSet *const)> | DeletedHook |
typedef std::function< void(const CCTrackerType *const, const VertexSet *const, const VertexSet *const)> | BrokenHook |
typedef std::function< void(const CCTrackerType *const, const VertexSet *const, const VertexSet *const)> | MergedHook |
Public Member Functions | |
Construction | |
CCTracker (RoadmapType *const _r) | |
~CCTracker () | |
Move and Copy | |
| |
CCTracker (const CCTracker &) | |
CCTracker (CCTracker &&) | |
CCTracker & | operator= (const CCTracker &) |
CCTracker & | operator= (CCTracker &&) |
Modifiers | |
void | SetRoadmap (RoadmapType *const _r) noexcept |
Set the roadmap object. More... | |
void | SetStatClass (StatClass *const _stats) const noexcept |
Set the stat class pointer if we wish to do performance profiling. More... | |
Query Functions | |
These functions answer questions about the CCs in the graph. | |
size_t | GetNumCCs () const noexcept |
Get the number of connected components in the graph. More... | |
const VertexSet * | GetCC (const VID _vid) const noexcept |
VertexSet | GetRepresentatives () const noexcept |
bool | InSameCC (const VID _vid1, const VID _vid2) const noexcept |
Iteration | |
Iterate over the CCs. | |
ComponentSet::const_iterator | begin () const noexcept |
ComponentSet::const_iterator | end () const noexcept |
Event Hooks | |
These functions install and manage hook functions which are called in response to changes in the components. Each has a unique label; duplicates will trigger exceptions. | |
void | InstallCreatedHook (const std::string &_label, const CreatedHook &_h) |
void | InstallDeletedHook (const std::string &_label, const DeletedHook &_h) |
void | InstallBrokenHook (const std::string &_label, const BrokenHook &_h) |
void | InstallMergedHook (const std::string &_label, const MergedHook &_h) |
Optimization | |
Updates can be disabled to optimize rewiring operations (where we change the graph without changing connectivity). | |
void | Disable () |
void | Enable () |
Debug | |
void | Print (std::ostream &_os, const std::string &_indent={}) const |
Roadmap Callback Functions | |
These functions accept graph updates and adjust the internal CCs accordingly. They should be installed as hooks in the roadmap. | |
void | AddVertex (const vertex_iterator _vi) noexcept |
void | DeleteVertex (const vertex_iterator _vi) noexcept |
void | AddEdge (const edge_iterator _ei) noexcept |
void | DeleteEdge (const edge_iterator _ei) noexcept |
Track the set of CC's in a roadmap.
For directed graphs, we will compute weak connectivity because it describes the typical usage for RRT and nonholonomic robots. One should recall, however, that in such cases shared CC membership does not imply connectivity.
For this to work correctly with directed trees, one must ensure that the graph always remains a tree. For instance, if you rewire the tree by switching a vertex's parent, you must delete the old edge before adding the new one.
Add support for non-tree directed graphs. We need to use predecessor information to do this, which we now have in the roadmap graph.
The stat class tracking adds a lot of complication. Remove it once we're sure the performance is fast enough to forgo tracking.
typedef std::function<void(const CCTrackerType* const, const VertexSet* const, const VertexSet* const)> CCTracker< RoadmapType >::BrokenHook |
An event hook for component breaks. Called after breaking.
Pointer | to this. |
The | component which is now broken. |
The | new component split off from the old (does not trigger a create event). |
typedef CCTracker<RoadmapType> CCTracker< RoadmapType >::CCTrackerType |
typedef std::unordered_set<VertexSet*> CCTracker< RoadmapType >::ComponentSet |
typedef std::function<void(const CCTrackerType* const, const VertexSet* const)> CCTracker< RoadmapType >::CreatedHook |
An event hook for component creation. Called after creation.
Pointer | to this. |
The | newly created component. |
typedef std::function<void(const CCTrackerType* const, const VertexSet* const)> CCTracker< RoadmapType >::DeletedHook |
An event hook for component deletion. Called prior to deletion.
Pointer | to this. |
The | to-be deleted component. |
typedef RoadmapType::adj_edge_iterator CCTracker< RoadmapType >::edge_iterator |
typedef std::function<void(const CCTrackerType* const, const VertexSet* const, const VertexSet* const)> CCTracker< RoadmapType >::MergedHook |
An event hook for component merges. Called prior to merging.
Pointer | to this. |
The | component which will be merged into. |
The | component which will be removed after merging (does not trigger a delete event). |
typedef RoadmapType::vertex_iterator CCTracker< RoadmapType >::vertex_iterator |
Constructor.
_r | The roadmap for which we will track CCs. |
CCTracker< RoadmapType >::CCTracker | ( | const CCTracker< RoadmapType > & | _other | ) |
CCTracker< RoadmapType >::CCTracker | ( | CCTracker< RoadmapType > && | _other | ) |
|
noexcept |
Update for an edge added to the graph.
_ei | The edge iterator. |
|
noexcept |
Update for a vertex added to the graph.
_vi | The vertex iterator. |
|
inlinenoexcept |
|
noexcept |
Update for an edge deleted from the graph.
_ei | The edge iterator. |
|
noexcept |
Update for a vertex deleted from the graph.
_vi | The vertex iterator. |
void CCTracker< RoadmapType >::Disable |
void CCTracker< RoadmapType >::Enable |
|
inlinenoexcept |
|
noexcept |
Get the CC which contains a representative node.
_vid | The representative's descriptor. |
|
inlinenoexcept |
Get the number of connected components in the graph.
|
noexcept |
Get a set of representative VIDs for each CC.
|
inlinenoexcept |
Check if two vertices are in the same CC.
_vid1 | The descriptor of the first vertex. |
_vid2 | The descriptor of the second vertex. |
void CCTracker< RoadmapType >::InstallBrokenHook | ( | const std::string & | _label, |
const BrokenHook & | _h | ||
) |
void CCTracker< RoadmapType >::InstallCreatedHook | ( | const std::string & | _label, |
const CreatedHook & | _h | ||
) |
void CCTracker< RoadmapType >::InstallDeletedHook | ( | const std::string & | _label, |
const DeletedHook & | _h | ||
) |
void CCTracker< RoadmapType >::InstallMergedHook | ( | const std::string & | _label, |
const MergedHook & | _h | ||
) |
CCTracker< RoadmapType > & CCTracker< RoadmapType >::operator= | ( | CCTracker< RoadmapType > && | _other | ) |
CCTracker< RoadmapType > & CCTracker< RoadmapType >::operator= | ( | const CCTracker< RoadmapType > & | _other | ) |
void CCTracker< RoadmapType >::Print | ( | std::ostream & | _os, |
const std::string & | _indent = {} |
||
) | const |
Print the full set of CC information.
_os | The ostream to print to. |
_indent | A set of indent characters to print before each line. |
|
inlinenoexcept |
Set the roadmap object.
|
inlinenoexcept |
Set the stat class pointer if we wish to do performance profiling.