Vertex.cpp
48 BITstar::Vertex::Vertex(const ompl::base::SpaceInformationPtr& si, const ompl::base::OptimizationObjectivePtr& opt, bool root /*= false*/)
149 throw ompl::Exception("Attempting to get the depth of a vertex that does not have a parent yet is not root.");
199 void BITstar::Vertex::addParent(const VertexPtr& newParent, const ompl::base::Cost& edgeInCost, bool updateChildCosts /*= true*/)
209 throw ompl::Exception("Attempting to add a parent to the root vertex, which cannot have a parent.");
231 throw ompl::Exception("Attempting to remove the parent of a vertex that does not have a parent.");
235 throw ompl::Exception("Attempting to remove the parent of the root vertex, which cannot have a parent.");
262 for (std::vector<VertexWeakPtr>::const_iterator cIter = childWPtrs_.begin(); cIter != childWPtrs_.end(); ++cIter)
267 throw ompl::Exception("A (weak) pointer to a child was found to have expired while calculating the children of a vertex.");
284 for (std::vector<VertexWeakPtr>::const_iterator cIter = childWPtrs_.begin(); cIter != childWPtrs_.end(); ++cIter)
289 throw ompl::Exception("A (weak) pointer to a child was found to have expired while calculating the children of a vertex.");
324 //Iterate over the list of children pointers until the child is found. Iterators make erase easier
326 for (std::vector<VertexWeakPtr>::iterator cIter = childWPtrs_.begin(); cIter != childWPtrs_.end() && foundChild == false; ++cIter)
331 throw ompl::Exception("A (weak) pointer to a child was found to have expired while removing a child from a vertex.");
357 throw ompl::Exception("Attempting to remove a child vertex not present in the list of children stored in the (supposed) parent vertex.");
379 throw ompl::Exception("Attempting to access the incoming-edge cost of a vertex without a parent.");
515 throw ompl::Exception("Attempting to update descendants' costs and depths of a vertex that does not have a parent and is not root. This information would therefore be gibberish.");
536 throw ompl::Exception("A (weak) pointer to a child has was found to have expired while updating the costs and depths of descendant vertices.");
bool isNew() const
Returns true if the vertex is marked as new. Vertices are new until marked old.
Definition: Vertex.cpp:387
bool hasBeenExpandedToVertices() const
Returns true if the vertex has been expanded towards vertices.
Definition: Vertex.cpp:441
VertexConstPtr getParentConst() const
Get the parent of a vertex as a constant pointer.
Definition: Vertex.cpp:157
void updateCostAndDepth(bool cascadeUpdates=true)
Calculates the updated cost and depth of the current state, as well as calling all children's updateC...
Definition: Vertex.cpp:494
std::shared_ptr< const Vertex > VertexConstPtr
A constant vertex shared pointer.
Definition: BITstar.h:125
void addParent(const VertexPtr &newParent, const ompl::base::Cost &edgeInCost, bool updateChildCosts=true)
Set the parent of a vertex, cannot be used to replace a previous parent. Will update this vertex's co...
Definition: Vertex.cpp:199
void removeParent(bool updateChildCosts=true)
Remove the parent edge. Will update this vertex's cost, and can update the descendent costs...
Definition: Vertex.cpp:225
void markUnexpandedToVertices()
Mark the vertex as not expanded towards vertices.
Definition: Vertex.cpp:459
A shared pointer wrapper for ompl::base::SpaceInformation.
ompl::base::OptimizationObjectivePtr getOpt() const
The optimization objective used by the vertex.
Definition: Vertex.cpp:89
void addChild(const VertexPtr &newChild, bool updateChildCosts=true)
Add a child vertex. Does not change this vertex's cost, and can update the child and its descendent c...
Definition: Vertex.cpp:300
void removeChild(VertexPtr oldChild, bool updateChildCosts=true)
Remove a child vertex. Does not change this vertex's cost, and can update the child and its descenden...
Definition: Vertex.cpp:316
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 ...
Definition: Vertex.cpp:143
void getChildrenConst(std::vector< VertexConstPtr > *children) const
Get the children of a vertex as constant pointers.
Definition: Vertex.cpp:256
A shared pointer wrapper for ompl::base::OptimizationObjective.
void markUnexpandedToSamples()
Mark the vertex as not expanded towards samples.
Definition: Vertex.cpp:432
bool hasBeenExpandedToSamples() const
Returns true if the vertex has been expanded towards samples.
Definition: Vertex.cpp:414
ompl::base::Cost getEdgeInCost() const
Get the incremental cost-to-come of a vertex.
Definition: Vertex.cpp:373
ompl::base::State const * stateConst() const
The state of a vertex as a constant pointer.
Definition: Vertex.cpp:98
bool isInTree() const
Get whether a vertex is "in the graph" or not. This returns true if the vertex is the graph root or i...
Definition: Vertex.cpp:134
Vertex(const ompl::base::SpaceInformationPtr &si, const ompl::base::OptimizationObjectivePtr &opt, bool root=false)
Constructor.
Definition: Vertex.cpp:48
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition: Cost.h:47
ompl::base::Cost getCost() const
Get the cost-to-come of a vertex. Return infinity if the edge is disconnected.
Definition: Vertex.cpp:364
void markExpandedToVertices()
Mark the vertex as expanded towards vertices.
Definition: Vertex.cpp:450
void getChildren(std::vector< VertexPtr > *children)
Get the children of a vertex as mutable pointers.
Definition: Vertex.cpp:278