Template Class KStrategy

Inheritance Relationships

Derived Types

Class Documentation

template<class Milestone>
class KStrategy

Attempt to connect to the k nearest neighbors.

Subclassed by ompl::geometric::KBoundedStrategy< Milestone >, ompl::geometric::KStarStrategy< Milestone >

Public Functions

inline KStrategy(const unsigned int k, std::shared_ptr<NearestNeighbors<Milestone>> nn)

Constructor takes the maximum number of nearest neighbors to return (k) and the nearest neighbors datastruture to use (nn)

virtual ~KStrategy() = default
inline void setNearestNeighbors(const std::shared_ptr<NearestNeighbors<Milestone>> &nn)

Set the nearest neighbors datastructure to use.

inline const std::vector<Milestone> &operator()(const Milestone &m)

Given a milestone m, find the number of nearest neighbors connection attempts that should be made from it, according to the connection strategy.

inline unsigned int getNumNeighbors() const

Protected Attributes

unsigned int k_

Maximum number of nearest neighbors to attempt to connect new milestones to.

std::shared_ptr<NearestNeighbors<Milestone>> nn_

Nearest neighbors data structure.

std::vector<Milestone> neighbors_

Scratch space for storing k-nearest neighbors.