Parasol Planning Library (PPL)
|
#include <NeighborhoodFinderMethod.h>
Public Types | |
Local Types | |
enum class | Type { K , RADIUS , APPROX , OTHER } |
The type of neighbors found. More... | |
typedef std::back_insert_iterator< std::vector< Neighbor > > | OutputIterator |
Output iterator for writing discovered neighbors to a container. More... | |
Motion Planning Types | |
typedef MPBaseObject::RoadmapType | RoadmapType |
typedef RoadmapType::VID | VID |
typedef RoadmapType::VertexSet | VertexSet |
typedef MPBaseObject::GroupRoadmapType | GroupRoadmapType |
typedef MPBaseObject::GroupCfgType | GroupCfgType |
Public Types inherited from MPBaseObject | |
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 | |
NeighborhoodFinderMethod (const Type _type=Type::OTHER) | |
NeighborhoodFinderMethod (XMLNode &_node, const Type _type=Type::OTHER, const bool _requireDM=true) | |
virtual | ~NeighborhoodFinderMethod ()=default |
MPBaseObject Overrides | |
virtual void | Print (std::ostream &_os) const override |
Accessors | |
Type | GetType () const noexcept |
virtual size_t & | GetK () noexcept |
virtual double & | GetRadius () noexcept |
virtual void | SetDMLabel (const std::string &_label) noexcept |
virtual const std::string & | GetDMLabel () const noexcept |
Nearest-Neighbor Queries | |
virtual void | FindNeighbors (RoadmapType *const _r, const Cfg &_cfg, const VertexSet &_candidates, OutputIterator _out)=0 |
virtual void | FindNeighbors (GroupRoadmapType *const _r, const GroupCfgType &_cfg, const VertexSet &_candidates, OutputIterator _out)=0 |
template<typename AbstractRoadmapType > | |
void | FindNeighbors (AbstractRoadmapType *const _r, const typename AbstractRoadmapType::CfgType &_cfg, OutputIterator _out) |
Public Member Functions inherited from MPBaseObject | |
MPBaseObject (const std::string &_label="", const std::string &_name="", bool _debug=false) | |
MPBaseObject (XMLNode &_node) | |
virtual | ~MPBaseObject () |
virtual void | Initialize () |
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 | |
Helpers | |
template<typename AbstractRoadmapType > | |
bool | DirectEdge (const AbstractRoadmapType *_g, const typename AbstractRoadmapType::CfgType &_c, const typename AbstractRoadmapType::VID _v) const noexcept |
Protected Member Functions inherited from MPBaseObject | |
void | SetName (const std::string &_s) |
const std::string & | GetBaseFilename () const |
Protected Attributes | |
Internal State | |
| |
Type | m_nfType {Type::OTHER} |
Type of neighborhood finder. More... | |
size_t | m_k {0} |
How many closest neighbors to find? More... | |
double | m_radius {0} |
Maximum distance of closest neighbors. More... | |
std::string | m_dmLabel |
The distance metric to use. More... | |
bool | m_unconnected {false} |
Require neighbors with no direct edge. More... | |
Protected Attributes inherited from MPBaseObject | |
bool | m_debug |
Print debug info? More... | |
Base algorithm abstraction for NeighborhoodFinders, which are methods that solve nearest-neighbor queries against configurations in a roadmap.
The primary function 'FindNeighbors' takes an input configuration and optionally a set of candidate neighbors. It returns the computed set of "nearest" neighbors and their distances (through the 'Neighbor' structure). @usage
typedef std::back_insert_iterator<std::vector<Neighbor> > NeighborhoodFinderMethod::OutputIterator |
Output iterator for writing discovered neighbors to a container.
|
strong |
NeighborhoodFinderMethod::NeighborhoodFinderMethod | ( | const Type | _type = Type::OTHER | ) |
NeighborhoodFinderMethod::NeighborhoodFinderMethod | ( | XMLNode & | _node, |
const Type | _type = Type::OTHER , |
||
const bool | _requireDM = true |
||
) |
|
virtualdefault |
|
inlineprotectednoexcept |
Checks if there is a direct edge to potential neighbor.
_g | The roadmap graph we are searching. |
_c | The query configuration. |
_v | A potential neighbor for _c. |
void NeighborhoodFinderMethod::FindNeighbors | ( | AbstractRoadmapType *const | _r, |
const typename AbstractRoadmapType::CfgType & | _cfg, | ||
OutputIterator | _out | ||
) |
|
pure virtual |
Implemented in RandomNF, RadiusNF, KdTreeNF, and BruteForceNF.
|
pure virtual |
Some methods can be implemented more efficiently if the candidates are provided in a hash set. This function is to support that; the default implementation forwards to the iterator version.
_r | The roadmap. |
_cfg | The query configuration. |
_candidates | The set of candidate VIDs. |
_out | Output iterator. |
Implemented in RandomNF, RadiusNF, KdTreeNF, and BruteForceNF.
|
inlinevirtualnoexcept |
Get the distance metric label.
|
inlinevirtualnoexcept |
|
inlinevirtualnoexcept |
|
inlinenoexcept |
|
overridevirtual |
Print internal state of this object.
_os | The std::ostream to print to. |
Reimplemented from MPBaseObject.
Reimplemented in RandomNF, RadiusNF, KdTreeNF, and BruteForceNF.
|
inlinevirtualnoexcept |
Set the distance metric label.
_label | The new DM label to use. |
|
protected |
The distance metric to use.
|
protected |
How many closest neighbors to find?
|
protected |
Type of neighborhood finder.
|
protected |
Maximum distance of closest neighbors.
|
protected |
Require neighbors with no direct edge.