|
|
| CCTracker (RoadmapType *const _r) |
|
| ~CCTracker () |
|
|
- Note
- If this object is moved/copied as part of a move/copy on the roadmap, we must also update the roadmap pointer and hooks.
-
Move will retain stat class tracking but copying does not. This is because moving generally pertains to an internal re-organization of the same roadmap, while copying usually indicates moving a roadmap to another solution.
|
| CCTracker (const CCTracker &) |
|
| CCTracker (CCTracker &&) |
|
CCTracker & | operator= (const CCTracker &) |
|
CCTracker & | operator= (CCTracker &&) |
|
|
void | SetRoadmap (RoadmapType *const _r) noexcept |
| Set the roadmap object.
|
|
void | SetStatClass (StatClass *const _stats) const noexcept |
| Set the stat class pointer if we wish to do performance profiling.
|
|
|
These functions answer questions about the CCs in the graph.
|
size_t | GetNumCCs () const noexcept |
| Get the number of connected components in the graph.
|
|
const VertexSet * | GetCC (const VID _vid) const noexcept |
|
VertexSet | GetRepresentatives () const noexcept |
|
bool | InSameCC (const VID _vid1, const VID _vid2) const noexcept |
|
|
|
ComponentSet::const_iterator | begin () const noexcept |
|
ComponentSet::const_iterator | end () const noexcept |
|
|
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) |
|
|
Updates can be disabled to optimize rewiring operations (where we change the graph without changing connectivity).
|
void | Disable () |
|
void | Enable () |
|
|
void | Print (std::ostream &_os, const std::string &_indent={}) const |
|
|
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 |
|
|
|
typedef RoadmapType::VID | VID |
|
typedef RoadmapType::vertex_iterator | vertex_iterator |
|
typedef RoadmapType::adj_edge_iterator | edge_iterator |
|
typedef RoadmapType::VertexSet | VertexSet |
|
|
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 |
|
template<typename RoadmapType>
class CCTracker< RoadmapType >
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.
- Warning
- This class assumes that either all edges are bidirectional, or the roadmap is a single tree. It will not work correctly (silent errors) on a non-tree directed graph!
- Todo:
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.