![]() |
Parasol Planning Library (PPL)
|
#include <ConnectorMethod.h>
Public Types | |
Motion Planning Types | |
typedef MPBaseObject::GroupCfgType | GroupCfgType |
typedef MPBaseObject::RoadmapType | RoadmapType |
typedef MPBaseObject::GroupRoadmapType | GroupRoadmapType |
typedef RoadmapType::VID | VID |
typedef RoadmapType::VertexSet | VertexSet |
Local Types | |
typedef std::pair< VID, VID > | ConnectionAttempt |
typedef std::unordered_set< ConnectionAttempt > | ConnectionAttempts |
typedef std::unordered_map< void *, ConnectionAttempts > | ConnectionAttemptsCache |
template<typename AbstractRoadmapType > | |
using | OutputIterator = std::back_insert_iterator< std::vector< typename AbstractRoadmapType::VP > > |
![]() | |
typedef DefaultWeight< Cfg > | WeightType |
typedef GenericStateGraph< Cfg, WeightType > | RoadmapType |
typedef GroupCfg< RoadmapType > | GroupCfgType |
typedef GroupLocalPlan< RoadmapType > | GroupWeightType |
typedef GroupRoadmap< GroupCfgType, GroupWeightType > | GroupRoadmapType |
Public Member Functions | |
Construction | |
ConnectorMethod () | |
ConnectorMethod (XMLNode &_node) | |
virtual | ~ConnectorMethod ()=default |
MPBaseObject Overrides | |
virtual void | Print (std::ostream &_os) const override |
virtual void | Initialize () override |
Connection Interface | |
template<typename AbstractRoadmapType > | |
void | Connect (AbstractRoadmapType *const _r, const VertexSet *const _targetSet=nullptr, OutputIterator< AbstractRoadmapType > *const _collision=nullptr) |
template<typename AbstractRoadmapType > | |
void | Connect (AbstractRoadmapType *const _r, const VID _source, const VertexSet *const _targetSet=nullptr, OutputIterator< AbstractRoadmapType > *const _collision=nullptr) |
template<typename AbstractRoadmapType , typename InputIterator > | |
void | Connect (AbstractRoadmapType *const _r, InputIterator _sourceBegin, InputIterator _sourceEnd, const VertexSet *const _targetSet=nullptr, OutputIterator< AbstractRoadmapType > *const _collision=nullptr) |
bool | IsRewiring () const noexcept |
![]() | |
MPBaseObject (const std::string &_label="", const std::string &_name="", bool _debug=false) | |
MPBaseObject (XMLNode &_node) | |
virtual | ~MPBaseObject () |
const std::string & | GetName () const |
Get the class name for this object. More... | |
const std::string & | GetLabel () const |
Get the unique label for this object. More... | |
std::string | GetNameAndLabel () const |
Get the unique string identifier for this object "m_name::m_label". More... | |
void | SetLabel (const std::string &) |
Set the unique label for this object. More... | |
void | SetMPLibrary (MPLibrary *) noexcept |
Set the owning MPLibrary. More... | |
MPLibrary * | GetMPLibrary () const noexcept |
Get the owning MPLibrary. More... | |
bool | IsRunning () const noexcept |
Check the library's running flag. More... | |
MPProblem * | GetMPProblem () const noexcept |
Get the library's current MPProblem. More... | |
Environment * | GetEnvironment () const noexcept |
Get the current environment. More... | |
MPTask * | GetTask () const noexcept |
Get the current task. More... | |
GroupTask * | GetGroupTask () const noexcept |
Get the current group task. More... | |
MPSolutionType * | GetMPSolution () const noexcept |
RoadmapType * | GetRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current free-space roadmap. More... | |
GroupRoadmapType * | GetGroupRoadmap (RobotGroup *const _g=nullptr) const noexcept |
Get the current free-space group roadmap. More... | |
RoadmapType * | GetBlockRoadmap (Robot *const _r=nullptr) const noexcept |
Get the current obstacle-space roadmap. More... | |
Path * | GetPath (Robot *const _r=nullptr) const noexcept |
GroupPath * | GetGroupPath (RobotGroup *const _g=nullptr) const noexcept |
Get the current best group path. More... | |
StatClass * | GetStatClass () const noexcept |
Get the current StatClass. More... | |
LocalObstacleMap * | GetLocalObstacleMap () const noexcept |
Get the local obstacle map. More... | |
Protected Member Functions | |
Connection Helpers | |
virtual void | ConnectImpl (RoadmapType *const _r, const VID _source, const VertexSet *const _targetSet=nullptr, OutputIterator< RoadmapType > *const _collision=nullptr) |
virtual void | ConnectImpl (GroupRoadmapType *const _r, const VID _source, const VertexSet *const _targetSet=nullptr, OutputIterator< GroupRoadmapType > *const _collision=nullptr) |
template<typename AbstractRoadmapType > | |
void | ConnectNeighbors (AbstractRoadmapType *const _r, const VID _source, const std::vector< Neighbor > &_neighbors, OutputIterator< AbstractRoadmapType > *const _collision=nullptr, const bool _earlyQuit=false) |
bool | ConnectNodes (RoadmapType *const _r, const VID _source, const VID _target, OutputIterator< RoadmapType > *const _collision=nullptr) |
bool | ConnectNodes (GroupRoadmapType *const _r, const VID _source, const VID _target, OutputIterator< GroupRoadmapType > *const _collision=nullptr) |
template<typename AbstractRoadmapType > | |
bool | DoNotCheck (AbstractRoadmapType *const _r, const VID _source, const VID _target) const |
Connection Caching | |
void | CacheFailedConnection (void *const _map, const VID _source, const VID _target) noexcept |
bool | IsCached (void *const _map, const VID _source, const VID _target) const noexcept |
void | ClearConnectionAttempts () |
Clear the attempts cache. More... | |
![]() | |
void | SetName (const std::string &_s) |
const std::string & | GetBaseFilename () const |
Protected Attributes | |
Internal State | |
ConnectionAttemptsCache | m_attemptsCache |
All failed connection attempts. More... | |
std::string | m_lpLabel |
Local Planner. More... | |
bool | m_skipIfSameCC {true} |
Skip connections within the same CC? More... | |
size_t | m_maxFailures {0} |
Maximum allowed failures per use. More... | |
size_t | m_failures {0} |
Failures in this use. More... | |
bool | m_oneWay {false} |
Create one-way edges or two-way? More... | |
bool | m_rewiring {false} |
Does this connector delete edges? More... | |
bool | m_selfEdges {false} |
Indicates if roadmap vertices should have self-edges. More... | |
std::vector< Neighbor > | m_neighborBuffer |
![]() | |
bool | m_debug |
Print debug info? More... | |
Base algorithm abstraction for Connectors. Connectors attempt to connect a set of 'source' roadmap vertices to each of a second 'target' set of vertices. Successes generate new edges in the roadmap.
typedef std::pair<VID, VID> ConnectorMethod::ConnectionAttempt |
typedef std::unordered_set<ConnectionAttempt> ConnectorMethod::ConnectionAttempts |
typedef std::unordered_map<void*, ConnectionAttempts> ConnectorMethod::ConnectionAttemptsCache |
using ConnectorMethod::OutputIterator = std::back_insert_iterator< std::vector< typename AbstractRoadmapType::VP > > |
typedef RoadmapType::VID ConnectorMethod::VID |
ConnectorMethod::ConnectorMethod | ( | ) |
ConnectorMethod::ConnectorMethod | ( | XMLNode & | _node | ) |
|
virtualdefault |
|
protectednoexcept |
Add a failed connection attempt to the cache.
_map | The map pointer (either individual or group roadmap). |
_source | The source VID. |
_target | The target VID. |
|
protected |
Clear the attempts cache.
void ConnectorMethod::Connect | ( | AbstractRoadmapType *const | _r, |
const VertexSet *const | _targetSet = nullptr , |
||
OutputIterator< AbstractRoadmapType > *const | _collision = nullptr |
||
) |
Generate edges using all vertices in the roadmap as the source.
_r | The roadmap to connect. |
_targetSet | The set of target vertices, or null for the full roadmap. |
_collision | An optional output iterator for collisions. |
void ConnectorMethod::Connect | ( | AbstractRoadmapType *const | _r, |
const VID | _source, | ||
const VertexSet *const | _targetSet = nullptr , |
||
OutputIterator< AbstractRoadmapType > *const | _collision = nullptr |
||
) |
Generate edges using a single vertex as the source.
_r | The roadmap to connect. |
_source | The source vertex. |
_targetSet | The set of target vertices, or null for the full roadmap. |
_collision | An optional output iterator for collisions. |
void ConnectorMethod::Connect | ( | AbstractRoadmapType *const | _r, |
InputIterator | _sourceBegin, | ||
InputIterator | _sourceEnd, | ||
const VertexSet *const | _targetSet = nullptr , |
||
OutputIterator< AbstractRoadmapType > *const | _collision = nullptr |
||
) |
Generate edges using a range of VIDs as the source.
InputIterator | Either a roadmap iterator or any iterator that dereferences to a VID. |
_r | The roadmap to connect. |
_sourceBegin | The beginning of the VID range. |
_sourceEnd | The end of the VID range. |
_targetSet | The set of target vertices, or null for the full roadmap. |
_collision | An optional output iterator for collisions. |
|
protectedvirtual |
Reimplemented in RewireConnector, and NeighborhoodConnector.
|
protectedvirtual |
Connect a source node to some subset of a target set. Derived classes specify how this will happen.
_r | The owning roadmap. |
_source | The source node to connect. |
_targetSet | The candidate target nodes, or null for the whole roadmap. |
_collision | An optional output iterator for collisions. |
Reimplemented in RewireConnector, and NeighborhoodConnector.
|
protected |
Try to connect a given configuration to a set of nearest neighbors.
_r | The roadmap. |
_source | The configuration. |
_neighbors | The set of neighbors to try. |
_collision | Output for invalid configurations. |
_earlyQuit | Quit after the first successful connection? |
|
protected |
Attempt a connection between two group configurations.
_r | The group roadmap. |
_source | The source configuration's VID. |
_target | The target configuration's VID. |
_collision | Output for invalid configurations. |
|
protected |
Attempt a connection between two individual configurations.
_r | The roadmap. |
_source | The source configuration's VID. |
_target | The target configuration's VID. |
_collision | Output for invalid configurations. |
|
protected |
Check whether a connection should be attempted.
_r | The roadmap. |
_source | The source vertex. |
_target | The target vertex. |
|
overridevirtual |
Initialize this object for the current MPProblem. This should reset any internal state of the algorithms so that they are ready for execution. It is also the place to initialize any state that depends on the current problem.
Reimplemented from MPBaseObject.
|
protectednoexcept |
Check if attempt is in the failure cache.
_map | The map pointer (either individual or group roadmap). |
_source | The source VID. |
_target | The target VID. |
|
noexcept |
Check whether this is a rewiring connector (which may delete edges).
|
overridevirtual |
Print internal state of this object.
_os | The std::ostream to print to. |
Reimplemented from MPBaseObject.
Reimplemented in NeighborhoodConnector, and CCsConnector.
|
protected |
All failed connection attempts.
|
protected |
Failures in this use.
|
protected |
Local Planner.
|
protected |
Maximum allowed failures per use.
|
protected |
This is a performance optimization which makes a big impact. The neighbor set can be as large as the roadmap, so it is important to avoid re-allocating it on every call to ConnectImpl.
|
protected |
Create one-way edges or two-way?
|
protected |
Does this connector delete edges?
|
protected |
Indicates if roadmap vertices should have self-edges.
|
protected |
Skip connections within the same CC?