Parasol Planning Library (PPL)
Neighbor Struct Referencefinal

#include <Neighbors.h>

Public Types

Local Types
typedef size_t VID
 
typedef std::function< bool(const Neighbor &_a, const Neighbor &_b)> Comparator
 

Public Member Functions

Construction
 Neighbor ()
 
 Neighbor (const VID _target, const double _distance)
 
 Neighbor (const VID _source, const VID _target, const double _distance)
 
Equality
bool operator== (const Neighbor &_other) const noexcept
 Checks equality with another Neighbor. More...
 
bool operator!= (const Neighbor &_other) const noexcept
 Checks inequality with another Neighbor. More...
 

Data Fields

Internal State
VID source {VID(-1)}
 The source VID. More...
 
VID target {VID(-1)}
 The target VID. More...
 
double distance {std::numeric_limits<double>::infinity()}
 The distance between source and target. More...
 

Ordering

There are several ways to order a set of neighbors. The default is to order only by distance. The static functions here give alternate comparators that can be used to select the desired ordering.

bool operator< (const Neighbor &_other) const noexcept
 Orders by distance only. More...
 
static Comparator OrderByDistanceThenTarget () noexcept
 Orders by distance, then target VID. More...
 
static Comparator OrderByDistanceThenSource () noexcept
 Orders by distance, then source VID. More...
 
static Comparator OrderByAll () noexcept
 Orders by distance, then source, then target. More...
 

Detailed Description

Describes a distance relation between two cfgs as determined by a neighborhood finder. At least one of the cfgs should be in the roadmap.

Member Typedef Documentation

◆ Comparator

typedef std::function<bool(const Neighbor& _a, const Neighbor& _b)> Neighbor::Comparator

A function for comparing two neighbors for ordering purposes. Returns true if _a is ordered before _b.

◆ VID

typedef size_t Neighbor::VID

Constructor & Destructor Documentation

◆ Neighbor() [1/3]

Neighbor::Neighbor ( )
inlinedefault

◆ Neighbor() [2/3]

Neighbor::Neighbor ( const VID  _target,
const double  _distance 
)
inline

◆ Neighbor() [3/3]

Neighbor::Neighbor ( const VID  _source,
const VID  _target,
const double  _distance 
)
inline

Member Function Documentation

◆ operator!=()

bool Neighbor::operator!= ( const Neighbor _other) const
inlinenoexcept

Checks inequality with another Neighbor.

◆ operator<()

bool Neighbor::operator< ( const Neighbor _other) const
inlinenoexcept

Orders by distance only.

◆ operator==()

bool Neighbor::operator== ( const Neighbor _other) const
inlinenoexcept

Checks equality with another Neighbor.

◆ OrderByAll()

Neighbor::Comparator Neighbor::OrderByAll ( )
inlinestaticnoexcept

Orders by distance, then source, then target.

◆ OrderByDistanceThenSource()

Neighbor::Comparator Neighbor::OrderByDistanceThenSource ( )
inlinestaticnoexcept

Orders by distance, then source VID.

◆ OrderByDistanceThenTarget()

Neighbor::Comparator Neighbor::OrderByDistanceThenTarget ( )
inlinestaticnoexcept

Orders by distance, then target VID.

Field Documentation

◆ distance

double Neighbor::distance {std::numeric_limits<double>::infinity()}

The distance between source and target.

◆ source

VID Neighbor::source {VID(-1)}

The source VID.

◆ target

VID Neighbor::target {VID(-1)}

The target VID.


The documentation for this struct was generated from the following file: