ConnectionStrategy.h
61 KStrategy(const unsigned int k, std::shared_ptr<NearestNeighbors<Milestone>> nn) : k_(k), nn_(std::move(nn))
137 , kPRMConstant_(boost::math::constants::e<double>() + (boost::math::constants::e<double>() / (double)d))
void log(const char *file, int line, LogLevel level, const char *m,...)
Root level logging function. This should not be invoked directly, but rather used via a logging macro...
Definition: Console.cpp:120
Definition: SPARSdb.cpp:73
std::vector< Milestone > neighbors_
Scratch space for storing k-nearest neighbors.
Definition: ConnectionStrategy.h:91
STL namespace.
const double bound_
The maximum distance at which nearby milestones are reported.
Definition: ConnectionStrategy.h:192
KBoundedStrategy(const unsigned int k, const double bound, const std::shared_ptr< NearestNeighbors< Milestone >> &nn)
Constructor.
Definition: ConnectionStrategy.h:167
unsigned int k_
Maximum number of nearest neighbors to attempt to connect new milestones to.
Definition: ConnectionStrategy.h:85
Return at most k neighbors, as long as they are also within a specified bound.
Definition: ConnectionStrategy.h:157
const std::vector< Milestone > & operator()(const Milestone &m)
Given a milestone m, find the number of nearest neighbors connection attempts that should be made fro...
Definition: ConnectionStrategy.h:77
const NumNeighborsFn n_
Function returning the number of milestones added to the roadmap so far.
Definition: ConnectionStrategy.h:149
KStarStrategy(const NumNeighborsFn &n, const std::shared_ptr< NearestNeighbors< Milestone >> &nn, const unsigned int d=1)
Constructor.
Definition: ConnectionStrategy.h:133
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 dat...
Definition: ConnectionStrategy.h:61
Abstract representation of a container that can perform nearest neighbors queries.
Definition: NearestNeighbors.h:48
void setNearestNeighbors(const std::shared_ptr< NearestNeighbors< Milestone >> &nn)
Set the nearest neighbors datastructure to use.
Definition: ConnectionStrategy.h:69
Make the minimal number of connections required to ensure asymptotic optimality.
Definition: ConnectionStrategy.h:120
std::shared_ptr< NearestNeighbors< Milestone > > nn_
Nearest neighbors data structure.
Definition: ConnectionStrategy.h:88
std::function< double(const _T &, const _T &)> DistanceFunction
The definition of a distance function.
Definition: NearestNeighbors.h:52