|
|
template<typename MPSolution > |
| GroupRoadmap (RobotGroup *const _g, MPSolution *const _solution) |
| Construct a group roadmap.
|
|
|
Move and copy are disabled because the group cfgs and edges need to know their group roadmap pointer. To implement these, we'll need to update the pointer on every component.
|
| GroupRoadmap (const GroupRoadmap &)=delete |
|
| GroupRoadmap (GroupRoadmap &&)=delete |
|
GroupRoadmap & | operator= (const GroupRoadmap &)=delete |
|
GroupRoadmap & | operator= (GroupRoadmap &&)=delete |
|
|
RobotGroup * | GetGroup () |
| Get the robot group.
|
|
IndividualRoadmap * | GetRoadmap (const size_t _index) |
|
const IndividualRoadmap * | GetRoadmap (const size_t _index) const |
|
size_t | GetNumRobots () const noexcept |
| Get the number of robots for the group this roadmap is for.
|
|
|
virtual void | Write (const std::string &_filename, Environment *_env) const override |
|
void | WriteCompositeGraph (const std::string &_filename, Environment *const _env) const |
|
std::string | PrettyPrint () const |
|
|
virtual VID | AddVertex (const Vertex &_v) noexcept override |
|
virtual void | DeleteVertex (const VID _v) noexcept override |
|
virtual void | AddEdge (const VID _source, const VID _target, const Edge &_w) noexcept override |
|
virtual void | DeleteEdge (EI _iterator) noexcept override |
|
|
virtual void | ClearHooks () noexcept override |
|
|
bool | operator== (const RoadmapGraph &_r) const noexcept |
|
bool | operator!= (const RoadmapGraph &_r) const noexcept |
|
|
virtual VID | AddDuplicateVertex (const Vertex &_v) noexcept |
|
virtual void | AddEdge (const VID _source, const VID _target, const std::pair< Edge, Edge > &_w) noexcept |
|
virtual void | DeleteEdge (const VID _source, const VID _target) noexcept |
|
void | SetRobot (Robot *const _r) noexcept |
| Set the robot pointer on all configurations in the map.
|
|
void | AppendRoadmap (const RoadmapGraph &_r) |
|
void | SetCCTracker (StatClass *const _stats=nullptr) |
|
|
size_t | Size () const noexcept |
| Get the number of vertices in the roadmap.
|
|
bool | IsVertex (const VID _vid) const noexcept |
|
bool | IsVertex (const Vertex &_v) const noexcept |
|
bool | IsVertex (const Vertex &_v, CVI &_vi) const noexcept |
|
bool | IsEdge (const VID _source, const VID _target) const noexcept |
|
template<typename T > |
VID | GetVID (const T &_t) const noexcept |
|
VID | GetVID (const VI &_t) const noexcept |
|
VID | GetVID (const Vertex &_t) const noexcept |
|
const VertexSet & | GetPredecessors (const VID _vid) const noexcept |
|
VID | GetLastVID () const noexcept |
| Get the descriptor of the last vertex added to the graph.
|
|
size_t | GetTimestamp () const noexcept |
| Each time the roadmap is modified, we update the timestamp.
|
|
const VertexSet & | GetAllVIDs () const noexcept |
| Get the set of all VIDs in the roadmap.
|
|
|
Robot * | GetRobot () const noexcept |
| Get the robot represented by this roadmap.
|
|
CCTrackerType * | GetCCTracker () const noexcept |
| Get the connected component tracker.
|
|
template<typename T > |
VP & | GetVertex (T &_t) noexcept |
| Retrieve a reference to a vertex property by descriptor or iterator.
|
|
VP & | GetVertex (VI &_t) noexcept |
|
VP & | GetVertex (VID _t) noexcept |
|
template<typename T > |
const VP & | GetVertex (T &_t) const noexcept |
|
const VP & | GetVertex (CVI &_t) const noexcept |
|
const VP & | GetVertex (VID _t) const noexcept |
|
std::vector< VID > | GetChildren (const VID _vid) const noexcept |
|
bool | GetEdge (const VID _source, const VID _target, EI &_ei) noexcept |
|
bool | GetEdge (const VID _source, const VID _target, CEI &_ei) const noexcept |
|
EP & | GetEdge (const VID _source, const VID _target) noexcept |
|
EP & | GetEdge (const EID _descriptor) noexcept |
|
|
Hooks are arbitrary functions that are attached to roadmap events. I.e., whenever a vertex is added, a set of functions should be called (hooks). There is a set of hooks for each of the four modifying actions (add/delete a vertex/edge).
IMPORTANT: Hooks for 'add' events execute immediately after the event, while hooks for 'delete' events execute immediately prior. This ensures that the iterator and neighbor information are valid in both cases.
IMPORTANT: Dependencies between hooks create data races. To avoid problems, any piece of data that is modified by one hook should not be read or modified by any other hook.
|
bool | IsHook (const HookType, const std::string &_label) const |
|
void | InstallHook (const HookType _type, const std::string &_label, const VertexHook &_h) |
|
void | InstallHook (const HookType _type, const std::string &_label, const EdgeHook &_h) |
|
void | RemoveHook (const HookType _type, const std::string &_label) |
|
void | DisableHooks () noexcept |
|
void | EnableHooks () noexcept |
| Enable the hook functions (default).
|
|
|
|
typedef RoadmapGraph< Vertex, Edge > | BaseType |
|
typedef BaseType::EID | ED |
|
typedef Vertex::IndividualCfg | IndividualCfg |
|
typedef Edge::IndividualEdge | IndividualEdge |
|
typedef Vertex::VIDSet | VIDSet |
|
typedef RoadmapGraph< IndividualCfg, IndividualEdge > | IndividualRoadmap |
|
typedef BaseType::adj_edge_iterator | adj_edge_iterator |
|
typedef BaseType::edge_descriptor | edge_descriptor |
|
typedef BaseType::vertex_iterator | vertex_iterator |
|
typedef BaseType::vertex_descriptor | vertex_descriptor |
|
typedef STAPLGraph::const_vertex_iterator | CVI |
|
typedef STAPLGraph::vertex_iterator | VI |
|
typedef STAPLGraph::adj_edge_iterator | EI |
|
typedef STAPLGraph::vertex_descriptor | VID |
|
using | STAPLGraph = stapl::sequential::graph< stapl::DIRECTED, stapl::NONMULTIEDGES, Vertex, Edge > |
|
|
enum class | HookType { AddVertex
, DeleteVertex
, AddEdge
, DeleteEdge
} |
|
typedef STAPLGraph::edge_descriptor | EID |
|
typedef EID::edge_id_type | EdgeID |
|
typedef std::unordered_set< VID > | VertexSet |
|
typedef STAPLGraph::const_adj_edge_iterator | CEI |
|
typedef STAPLGraph::vertex_property | VP |
|
typedef STAPLGraph::edge_property | EP |
|
typedef Vertex | CfgType |
|
typedef Edge | EdgeType |
|
typedef stapl::sequential::vector_property_map< STAPLGraph, size_t > | ColorMap |
|
typedef std::function< void(VI)> | VertexHook |
|
typedef std::function< void(EI)> | EdgeHook |
|
typedef CCTracker< RoadmapGraph< Vertex, Edge > > | CCTrackerType |
|
|
|
RobotGroup *const | m_group |
| The robot group.
|
|
std::vector< IndividualRoadmap * > | m_roadmaps |
| The individual roadmaps.
|
|
size_t | m_timestamp |
| Tracks the number of changes to the graph.
|
|
|
Robot * | m_robot {nullptr} |
| The robot this roadmap is for.
|
|
bool | m_enableHooks {true} |
| Use hook functions?
|
|
std::unordered_map< std::string, VertexHook > | m_addVertexHooks |
| Hook functions to call when adding a vertex.
|
|
std::unordered_map< std::string, VertexHook > | m_deleteVertexHooks |
| Hook functions to call when deleting a vertex.
|
|
std::unordered_map< std::string, EdgeHook > | m_addEdgeHooks |
| Hook functions to call when adding an edge.
|
|
std::unordered_map< std::string, EdgeHook > | m_deleteEdgeHooks |
| Hook functions to call when deleting an edge.
|
|
std::unique_ptr< CCTrackerType > | m_ccTracker |
| Tracks weak CCs within the roadmap.
|
|
std::unordered_map< VID, VertexSet > | m_predecessors |
|
VertexSet | m_allVIDs |
|
template<typename Vertex, typename Edge>
class GroupRoadmap< Vertex, Edge >
Represents a roadmap for a robot group.
Rather than duplicating the data for each robot, this object refers to an individual roadmap for each robot. This object however does not own the individual roadmaps - it merely points to them.
Note that VIDs in this object refer to GROUP configuration VIDs.