ompl::geometric::BITstar::Vertex Class Reference
The vertex of the underlying graphs in BIT*. More...
#include <ompl/geometric/planners/bitstar/datastructures/Vertex.h>
Public Member Functions | |
Vertex (ompl::base::SpaceInformationPtr si, const CostHelper *const costHelpPtr, bool root=false) | |
Constructor. | |
virtual | ~Vertex () |
Destructor. | |
BITstar::VertexId | getId () const |
The (unique) vertex ID. | |
const ompl::base::State * | stateConst () const |
The state of a vertex as a constant pointer. | |
ompl::base::State * | state () |
The state of a vertex as a mutable pointer. | |
bool | isRoot () const |
Whether the vertex is root. | |
bool | hasParent () const |
Get whether this vertex has a parent. | |
bool | isInTree () const |
Get whether a vertex is "in the graph" or not. This returns true if the vertex is the graph root or is connected to a parent. | |
unsigned int | getDepth () const |
Get the "depth" of the vertex from the root. A root vertex is at depth 0, a direct descendent of the root 1, etc. | |
VertexConstPtr | getParentConst () const |
Get the parent of a vertex as a constant pointer. | |
VertexPtr | getParent () |
Get the parent of a vertex as a mutable pointer. | |
void | addParent (const VertexPtr &newParent, const ompl::base::Cost &edgeInCost, bool updateChildCosts) |
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 | getChildrenConst (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. | |
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. | |
bool | isNew () const |
Returns true if the vertex is marked as new. Vertices are new until marked old. | |
void | markNew () |
Mark the vertex as new. | |
void | markOld () |
Mark the vertex as old. | |
bool | hasBeenExpandedToSamples () const |
Returns true if the vertex has been expanded towards samples. | |
void | markExpandedToSamples () |
Mark the vertex as expanded towards samples. | |
void | markUnexpandedToSamples () |
Mark the vertex as not expanded towards samples. | |
bool | hasBeenExpandedToVertices () const |
Returns true if the vertex has been expanded towards vertices. | |
void | markExpandedToVertices () |
Mark the vertex as expanded towards vertices. | |
void | markUnexpandedToVertices () |
Mark the vertex as not expanded towards vertices. | |
bool | isPruned () const |
Whether the vertex has been pruned. | |
void | markPruned () |
Mark the vertex as pruned. | |
void | markUnpruned () |
Mark the vertex as unpruned. | |
SearchQueue::VertexQueueIter | getVertexQueueIter () const |
Get an iterator to this vertex in the vertex queue. | |
void | setVertexQueueIter (const SearchQueue::VertexQueueIter &newPtr) |
Set the iterator to this vertex in the vertex queue. | |
void | clearVertexQueueIter () |
Clear the iterator to this vertex in the vertex queue. | |
bool | hasVertexQueueEntry () const |
Return true if the vertex has a link to it's entry in the Vertex Queue. | |
void | addIncomingEdgeQueuePtr (const SearchQueue::EdgeQueueElemPtr &newInPtr, unsigned int vertexQueueResetNum) |
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 | rmIncomingEdgeQueuePtr (const SearchQueue::EdgeQueueElemPtr &elemToDelete, unsigned int vertexQueueResetNum) |
Remove an incoming edge queue entry by value to the member vector. | |
void | rmIncomingEdgeQueuePtrByIter (const SearchQueue::EdgeQueueElemPtrVector::const_iterator &constIterToDelete, unsigned int vertexQueueResetNum) |
Remove an incoming edge queue entry by iterator to the member vector. | |
void | clearIncomingEdgeQueuePtrs () |
Clear the pointers to all of the incoming edge queue entries. | |
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator | incomingEdgeQueuePtrsBeginConst (unsigned int vertexQueueResetNum) |
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 | incomingEdgeQueuePtrsEndConst (unsigned int vertexQueueResetNum) |
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. | |
unsigned int | getNumIncomingEdgeQueuePtrs (unsigned int vertexQueueResetNum) |
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. | |
bool | hasIncomingEdgeQueueEntries (unsigned int vertexQueueResetNum) |
Return true if the vertex has links to incoming entries in the Edge Queue. Will clear existing in/out lookups if they were added under a different id. | |
void | addOutgoingEdgeQueuePtr (const SearchQueue::EdgeQueueElemPtr &newOutPtr, unsigned int vertexQueueResetNum) |
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 | rmOutgoingEdgeQueuePtr (const SearchQueue::EdgeQueueElemPtr &elemToDelete, unsigned int vertexQueueResetNum) |
Remove an outgoing edge queue entry by value. | |
void | rmOutgoingEdgeQueuePtrByIter (const SearchQueue::EdgeQueueElemPtrVector::const_iterator &constIterToDelete, unsigned int vertexQueueResetNum) |
Remove an outgoing edge queue entry by iterator to the member vector. | |
void | clearOutgoingEdgeQueuePtrs () |
Clear the pointers to all of the outgoing edge queue entries. | |
BITstar::SearchQueue::EdgeQueueElemPtrVector::const_iterator | outgoingEdgeQueuePtrsBeginConst (unsigned int vertexQueueResetNum) |
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 | outgoingEdgeQueuePtrsEndConst (unsigned int vertexQueueResetNum) |
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 | getNumOutgoingEdgeQueuePtrs (unsigned int vertexQueueResetNum) |
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. | |
bool | hasOutgoingEdgeQueueEntries (unsigned int vertexQueueResetNum) |
Return true if the vertex has links to outgoing entries in the Edge Queue. Will clear existing in/out lookups if they were added under a different id. | |
Protected Member Functions | |
void | updateCostAndDepth (bool cascadeUpdates=true) |
Calculates the updated cost and depth of the current state, as well as calling all children's updateCostAndDepth() functions and thus updating everything down-stream (if desired). | |
Detailed Description
The vertex of the underlying graphs in 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.
The documentation for this class was generated from the following files:
- ompl/geometric/planners/bitstar/datastructures/Vertex.h
- ompl/geometric/planners/bitstar/datastructures/src/Vertex.cpp