The vertex of the underlying graphs in gBITstar BIT*. More...
#include <ompl/geometric/planners/informedtrees/bitstar/Vertex.h>
Public Member Functions | |
Vertex (ompl::base::SpaceInformationPtr spaceInformation, const CostHelper *const costHelpPtr, SearchQueue *const queuePtr, const std::shared_ptr< const unsigned int > &approximationId, bool root=false) | |
Construct a vertex using space information, and helpers to compute various costs. | |
virtual | ~Vertex () |
Destruct a vertex. | |
BITstar::VertexId | getId () const |
The (unique) vertex ID. | |
ompl::base::State * | state () |
The state of a vertex as a pointer. | |
ompl::base::State const * | state () const |
The state of a vertex as a pointer to const. | |
bool | isRoot () const |
Returns whether the vertex is the root of the search tree. | |
bool | hasParent () const |
Returns whether this vertex has a parent. | |
bool | isInTree () const |
Get whether a vertex is in the search tree or a sample (i.e., a vertex of the RRG). | |
unsigned int | getDepth () const |
Get the depth of the vertex from the root. | |
VertexConstPtr | getParent () const |
Get a const pointer to the parent of this vertex. | |
VertexPtr | getParent () |
Get a pointer to the parent of this vertex. | |
bool | isConsistent () const |
Whether the vertex is consistent. | |
bool | isPruned () const |
Whether the vertex has been pruned. | |
bool | isExpandedOnCurrentApproximation () const |
Returns whether the vertex is expanded on current approximation. | |
bool | isExpandedOnCurrentSearch () const |
Returns whether the vertex is expaned on current search. | |
bool | hasEverBeenExpandedAsRewiring () const |
Returns whether the vertex has ever been expanded as a rewiring. | |
void | addParent (const VertexPtr &newParent, const ompl::base::Cost &edgeInCost) |
Set the parent of this vertex, cannot be used to replace a previous parent. Will always update this vertex's cost, and can update descendent costs. | |
void | removeParent (bool updateChildCosts) |
Remove the parent of this vertex. Will always update this vertex's cost, and can update the descendent costs. | |
bool | hasChildren () const |
Get whether this vertex has any children. | |
void | getChildren (VertexConstPtrVector *children) const |
Get the children of a vertex as constant pointers. | |
void | getChildren (VertexPtrVector *children) |
Get the children of a vertex as mutable pointers. | |
void | addChild (const VertexPtr &newChild) |
Add a child to this vertex. Does not change this vertex's cost or those of its descendants. Child must already have this vertex listed as it's parent. | |
void | removeChild (const VertexPtr &oldChild) |
Remove a child from this vertex. Does not change this vertex's cost or those of its descendants. Child must still have this vertex listed as its parent and it will also throw an exception if the given vertex pointer is not found. | |
void | blacklistChild (const VertexConstPtr &vertex) |
Put the vertex on the blacklist of children. | |
void | whitelistChild (const VertexConstPtr &vertex) |
Put the vertex on the whitelist of children. | |
bool | isBlacklistedAsChild (const VertexConstPtr &vertex) const |
Returns true if the vertex is blacklisted as a child of this vertex. | |
bool | isWhitelistedAsChild (const VertexConstPtr &vertex) const |
Returns true if the vertex is blacklisted as a child of this vertex. | |
void | clearBlacklist () |
Clears the blacklist. | |
void | clearWhitelist () |
Clears the whitelist. | |
ompl::base::Cost | getCost () const |
Get the cost-to-come of a vertex. Return infinity if the edge is disconnected. | |
ompl::base::Cost | getEdgeInCost () const |
Get the incremental cost-to-come of a vertex. | |
void | registerExpansion () |
Mark the vertex as expanded. | |
void | registerRewiringExpansion () |
Mark expansion to vertices. | |
void | markPruned () |
Mark the vertex as pruned. | |
void | markUnpruned () |
Mark the vertex as unpruned. | |
void | insertInEdgeQueueInLookup (const SearchQueue::EdgeQueueElemPtr &inEdge) |
Add to the list of the edge queue entries that point in to this vertex. Will clear existing in/out lookups if they were added under a different id. | |
void | insertInEdgeQueueOutLookup (const SearchQueue::EdgeQueueElemPtr &outEdge) |
Add to the list of the edge queue entries that point out of this vertex. Will clear existing in/out lookups if they were added under a different id. | |
void | removeFromEdgeQueueInLookup (const SearchQueue::EdgeQueueElemPtr &inEdge) |
Remove an incoming edge queue entry by value to the member vector. | |
void | removeFromEdgeQueueOutLookup (const SearchQueue::EdgeQueueElemPtr &outEdge) |
Remove an outgoing edge queue entry by value. | |
void | removeFromEdgeQueueInLookup (const SearchQueue::EdgeQueueElemPtrVector::const_iterator &inEdge) |
Remove an incoming edge queue entry by iterator to the member vector. | |
void | removeFromEdgeQueueOutLookup (const SearchQueue::EdgeQueueElemPtrVector::const_iterator &outEdge) |
Remove an outgoing edge queue entry by iterator to the member vector. | |
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator | edgeQueueInLookupConstBegin () |
Get an iterator to the front of the incoming edge queue entry vector. Will clear existing in/out lookups if they were added under a different id. | |
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator | edgeQueueOutLookupConstBegin () |
Get an iterator to the front of the outgoing edge queue entry vector. Will clear existing in/out lookups if they were added under a different id. | |
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator | edgeQueueInLookupConstEnd () |
Get an iterator to the end of the incoming edge queue entry vector. Will clear existing in/out lookups if they were added under a different id. | |
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator | edgeQueueOutLookupConstEnd () |
Get an iterator to the end of the outgoing edge queue entry vector. Will clear existing in/out lookups if they were added under a different id. | |
unsigned int | edgeQueueInLookupSize () |
Get the number of edge queue entries incoming to this vertex. Will clear existing in/out lookups if they were added under a different id. | |
unsigned int | edgeQueueOutLookupSize () |
Get the number of edge queue entries outgoing from this vertex. Will clear existing in/out lookups if they were added under a different id. | |
void | clearEdgeQueueInLookup () |
Clear the pointers to all of the incoming edge queue entries. | |
void | clearEdgeQueueOutLookup () |
Clear the pointers to all of the outgoing edge queue entries. |
Detailed Description
The vertex of the underlying graphs in gBITstar BIT*.
- Short description
- A class to store a state as a vertex in a (tree) graph. Allocates and frees it's own memory on construction/destruction. Parent vertices are owned by their children as shared pointers, assuring that a parent vertex will not be deleted while the child exists. Child vertices are owned by their parents as weak pointers, assuring that the shared-pointer ownership loop is broken.
- Note
- Add/Remove functions should almost always update their children's cost. The only known exception is when a series of operations are being performed and it would be beneficial to delay the update until the last operation. In this case, make sure that the last call updates the children and is on the highest ancestor that has been changed. Updates only flow downstream.
Constructor & Destructor Documentation
◆ Vertex()
ompl::geometric::BITstar::Vertex::Vertex | ( | ompl::base::SpaceInformationPtr | spaceInformation, |
const CostHelper *const | costHelpPtr, | ||
SearchQueue *const | queuePtr, | ||
const std::shared_ptr< const unsigned int > & | approximationId, | ||
bool | root = false ) |
Construct a vertex using space information, and helpers to compute various costs.
Definition at line 107 of file Vertex.cpp.
◆ ~Vertex()
|
virtual |
Destruct a vertex.
Definition at line 130 of file Vertex.cpp.
Member Function Documentation
◆ addChild()
void ompl::geometric::BITstar::Vertex::addChild | ( | const VertexPtr & | newChild | ) |
Add a child to this vertex. Does not change this vertex's cost or those of its descendants. Child must already have this vertex listed as it's parent.
Definition at line 343 of file Vertex.cpp.
◆ addParent()
void ompl::geometric::BITstar::Vertex::addParent | ( | const VertexPtr & | newParent, |
const ompl::base::Cost & | edgeInCost ) |
Set the parent of this vertex, cannot be used to replace a previous parent. Will always update this vertex's cost, and can update descendent costs.
Definition at line 240 of file Vertex.cpp.
◆ blacklistChild()
void ompl::geometric::BITstar::Vertex::blacklistChild | ( | const VertexConstPtr & | vertex | ) |
Put the vertex on the blacklist of children.
Definition at line 436 of file Vertex.cpp.
◆ clearBlacklist()
void ompl::geometric::BITstar::Vertex::clearBlacklist | ( | ) |
Clears the blacklist.
Definition at line 456 of file Vertex.cpp.
◆ clearEdgeQueueInLookup()
void ompl::geometric::BITstar::Vertex::clearEdgeQueueInLookup | ( | ) |
Clear the pointers to all of the incoming edge queue entries.
Definition at line 635 of file Vertex.cpp.
◆ clearEdgeQueueOutLookup()
void ompl::geometric::BITstar::Vertex::clearEdgeQueueOutLookup | ( | ) |
Clear the pointers to all of the outgoing edge queue entries.
Definition at line 765 of file Vertex.cpp.
◆ clearWhitelist()
void ompl::geometric::BITstar::Vertex::clearWhitelist | ( | ) |
Clears the whitelist.
Definition at line 461 of file Vertex.cpp.
◆ edgeQueueInLookupConstBegin()
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator ompl::geometric::BITstar::Vertex::edgeQueueInLookupConstBegin | ( | ) |
Get an iterator to the front of the incoming edge queue entry vector. Will clear existing in/out lookups if they were added under a different id.
Definition at line 642 of file Vertex.cpp.
◆ edgeQueueInLookupConstEnd()
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator ompl::geometric::BITstar::Vertex::edgeQueueInLookupConstEnd | ( | ) |
Get an iterator to the end of the incoming edge queue entry vector. Will clear existing in/out lookups if they were added under a different id.
Definition at line 652 of file Vertex.cpp.
◆ edgeQueueInLookupSize()
unsigned int ompl::geometric::BITstar::Vertex::edgeQueueInLookupSize | ( | ) |
Get the number of edge queue entries incoming to this vertex. Will clear existing in/out lookups if they were added under a different id.
Definition at line 662 of file Vertex.cpp.
◆ edgeQueueOutLookupConstBegin()
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator ompl::geometric::BITstar::Vertex::edgeQueueOutLookupConstBegin | ( | ) |
Get an iterator to the front of the outgoing edge queue entry vector. Will clear existing in/out lookups if they were added under a different id.
Definition at line 772 of file Vertex.cpp.
◆ edgeQueueOutLookupConstEnd()
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator ompl::geometric::BITstar::Vertex::edgeQueueOutLookupConstEnd | ( | ) |
Get an iterator to the end of the outgoing edge queue entry vector. Will clear existing in/out lookups if they were added under a different id.
Definition at line 782 of file Vertex.cpp.
◆ edgeQueueOutLookupSize()
unsigned int ompl::geometric::BITstar::Vertex::edgeQueueOutLookupSize | ( | ) |
Get the number of edge queue entries outgoing from this vertex. Will clear existing in/out lookups if they were added under a different id.
Definition at line 792 of file Vertex.cpp.
◆ getChildren() [1/2]
void ompl::geometric::BITstar::Vertex::getChildren | ( | VertexConstPtrVector * | children | ) | const |
Get the children of a vertex as constant pointers.
Definition at line 299 of file Vertex.cpp.
◆ getChildren() [2/2]
void ompl::geometric::BITstar::Vertex::getChildren | ( | VertexPtrVector * | children | ) |
Get the children of a vertex as mutable pointers.
Definition at line 321 of file Vertex.cpp.
◆ getCost()
ompl::base::Cost ompl::geometric::BITstar::Vertex::getCost | ( | ) | const |
Get the cost-to-come of a vertex. Return infinity if the edge is disconnected.
Definition at line 466 of file Vertex.cpp.
◆ getDepth()
unsigned int ompl::geometric::BITstar::Vertex::getDepth | ( | ) | const |
Get the depth of the vertex from the root.
Definition at line 183 of file Vertex.cpp.
◆ getEdgeInCost()
ompl::base::Cost ompl::geometric::BITstar::Vertex::getEdgeInCost | ( | ) | const |
Get the incremental cost-to-come of a vertex.
Definition at line 473 of file Vertex.cpp.
◆ getId()
BITstar::VertexId ompl::geometric::BITstar::Vertex::getId | ( | ) | const |
The (unique) vertex ID.
Definition at line 138 of file Vertex.cpp.
◆ getParent() [1/2]
BITstar::VertexPtr ompl::geometric::BITstar::Vertex::getParent | ( | ) |
Get a pointer to the parent of this vertex.
Definition at line 219 of file Vertex.cpp.
◆ getParent() [2/2]
BITstar::VertexConstPtr ompl::geometric::BITstar::Vertex::getParent | ( | ) | const |
Get a const pointer to the parent of this vertex.
Definition at line 198 of file Vertex.cpp.
◆ hasChildren()
bool ompl::geometric::BITstar::Vertex::hasChildren | ( | ) | const |
Get whether this vertex has any children.
Definition at line 292 of file Vertex.cpp.
◆ hasEverBeenExpandedAsRewiring()
bool ompl::geometric::BITstar::Vertex::hasEverBeenExpandedAsRewiring | ( | ) | const |
Returns whether the vertex has ever been expanded as a rewiring.
Definition at line 507 of file Vertex.cpp.
◆ hasParent()
bool ompl::geometric::BITstar::Vertex::hasParent | ( | ) | const |
Returns whether this vertex has a parent.
Definition at line 169 of file Vertex.cpp.
◆ insertInEdgeQueueInLookup()
void ompl::geometric::BITstar::Vertex::insertInEdgeQueueInLookup | ( | const SearchQueue::EdgeQueueElemPtr & | inEdge | ) |
Add to the list of the edge queue entries that point in to this vertex. Will clear existing in/out lookups if they were added under a different id.
Definition at line 542 of file Vertex.cpp.
◆ insertInEdgeQueueOutLookup()
void ompl::geometric::BITstar::Vertex::insertInEdgeQueueOutLookup | ( | const SearchQueue::EdgeQueueElemPtr & | outEdge | ) |
Add to the list of the edge queue entries that point out of this vertex. Will clear existing in/out lookups if they were added under a different id.
Definition at line 672 of file Vertex.cpp.
◆ isBlacklistedAsChild()
bool ompl::geometric::BITstar::Vertex::isBlacklistedAsChild | ( | const VertexConstPtr & | vertex | ) | const |
Returns true if the vertex is blacklisted as a child of this vertex.
Definition at line 446 of file Vertex.cpp.
◆ isConsistent()
bool ompl::geometric::BITstar::Vertex::isConsistent | ( | ) | const |
Whether the vertex is consistent.
Definition at line 487 of file Vertex.cpp.
◆ isExpandedOnCurrentApproximation()
bool ompl::geometric::BITstar::Vertex::isExpandedOnCurrentApproximation | ( | ) | const |
Returns whether the vertex is expanded on current approximation.
Definition at line 497 of file Vertex.cpp.
◆ isExpandedOnCurrentSearch()
bool ompl::geometric::BITstar::Vertex::isExpandedOnCurrentSearch | ( | ) | const |
Returns whether the vertex is expaned on current search.
Definition at line 502 of file Vertex.cpp.
◆ isInTree()
bool ompl::geometric::BITstar::Vertex::isInTree | ( | ) | const |
Get whether a vertex is in the search tree or a sample (i.e., a vertex of the RRG).
Definition at line 176 of file Vertex.cpp.
◆ isPruned()
bool ompl::geometric::BITstar::Vertex::isPruned | ( | ) | const |
Whether the vertex has been pruned.
Definition at line 492 of file Vertex.cpp.
◆ isRoot()
bool ompl::geometric::BITstar::Vertex::isRoot | ( | ) | const |
Returns whether the vertex is the root of the search tree.
Definition at line 162 of file Vertex.cpp.
◆ isWhitelistedAsChild()
bool ompl::geometric::BITstar::Vertex::isWhitelistedAsChild | ( | const VertexConstPtr & | vertex | ) | const |
Returns true if the vertex is blacklisted as a child of this vertex.
Definition at line 451 of file Vertex.cpp.
◆ markPruned()
void ompl::geometric::BITstar::Vertex::markPruned | ( | ) |
Mark the vertex as pruned.
Definition at line 527 of file Vertex.cpp.
◆ markUnpruned()
void ompl::geometric::BITstar::Vertex::markUnpruned | ( | ) |
Mark the vertex as unpruned.
Definition at line 535 of file Vertex.cpp.
◆ registerExpansion()
void ompl::geometric::BITstar::Vertex::registerExpansion | ( | ) |
Mark the vertex as expanded.
Definition at line 512 of file Vertex.cpp.
◆ registerRewiringExpansion()
void ompl::geometric::BITstar::Vertex::registerRewiringExpansion | ( | ) |
Mark expansion to vertices.
Definition at line 522 of file Vertex.cpp.
◆ removeChild()
void ompl::geometric::BITstar::Vertex::removeChild | ( | const VertexPtr & | oldChild | ) |
Remove a child from this vertex. Does not change this vertex's cost or those of its descendants. Child must still have this vertex listed as its parent and it will also throw an exception if the given vertex pointer is not found.
Definition at line 370 of file Vertex.cpp.
◆ removeFromEdgeQueueInLookup() [1/2]
void ompl::geometric::BITstar::Vertex::removeFromEdgeQueueInLookup | ( | const SearchQueue::EdgeQueueElemPtr & | inEdge | ) |
Remove an incoming edge queue entry by value to the member vector.
Definition at line 574 of file Vertex.cpp.
◆ removeFromEdgeQueueInLookup() [2/2]
void ompl::geometric::BITstar::Vertex::removeFromEdgeQueueInLookup | ( | const SearchQueue::EdgeQueueElemPtrVector::const_iterator & | inEdge | ) |
Remove an incoming edge queue entry by iterator to the member vector.
Definition at line 617 of file Vertex.cpp.
◆ removeFromEdgeQueueOutLookup() [1/2]
void ompl::geometric::BITstar::Vertex::removeFromEdgeQueueOutLookup | ( | const SearchQueue::EdgeQueueElemPtr & | outEdge | ) |
Remove an outgoing edge queue entry by value.
Definition at line 704 of file Vertex.cpp.
◆ removeFromEdgeQueueOutLookup() [2/2]
void ompl::geometric::BITstar::Vertex::removeFromEdgeQueueOutLookup | ( | const SearchQueue::EdgeQueueElemPtrVector::const_iterator & | outEdge | ) |
Remove an outgoing edge queue entry by iterator to the member vector.
Definition at line 747 of file Vertex.cpp.
◆ removeParent()
void ompl::geometric::BITstar::Vertex::removeParent | ( | bool | updateChildCosts | ) |
Remove the parent of this vertex. Will always update this vertex's cost, and can update the descendent costs.
Definition at line 267 of file Vertex.cpp.
◆ state() [1/2]
ompl::base::State * ompl::geometric::BITstar::Vertex::state | ( | ) |
The state of a vertex as a pointer.
Definition at line 152 of file Vertex.cpp.
◆ state() [2/2]
ompl::base::State const * ompl::geometric::BITstar::Vertex::state | ( | ) | const |
The state of a vertex as a pointer to const.
Definition at line 145 of file Vertex.cpp.
◆ whitelistChild()
void ompl::geometric::BITstar::Vertex::whitelistChild | ( | const VertexConstPtr & | vertex | ) |
Put the vertex on the whitelist of children.
Definition at line 441 of file Vertex.cpp.
The documentation for this class was generated from the following files:
- ompl/geometric/planners/informedtrees/bitstar/Vertex.h
- ompl/geometric/planners/informedtrees/bitstar/src/Vertex.cpp