All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IntegratedQueue.h
63 //I am member class of the BITstar class, so I need to include it's definition to be aware of the class BITstar. It has a forward declaration to me.
111 typedef std::function<unsigned int (const VertexPtr&, std::vector<VertexPtr>*)> NeighbourhoodFunc;
120 IntegratedQueue(const ompl::base::OptimizationObjectivePtr& opt, const DistanceFunc& distanceFunc, const NeighbourhoodFunc& nearSamplesFunc, const NeighbourhoodFunc& nearVerticesFunc, const VertexHeuristicFunc& lowerBoundHeuristicVertex, const VertexHeuristicFunc& currentHeuristicVertex, const EdgeHeuristicFunc& lowerBoundHeuristicEdge, const EdgeHeuristicFunc& currentHeuristicEdge, const EdgeHeuristicFunc& currentHeuristicEdgeTarget);
141 void eraseVertex(const VertexPtr& oldVertex, bool disconnectParent, const VertexPtrNNPtr& vertexNN, const VertexPtrNNPtr& freeStateNN, std::vector<VertexPtr>* recycledVertices);
192 std::pair<unsigned int, unsigned int> prune(const VertexPtr& pruneStartPtr, const VertexPtrNNPtr& vertexNN, const VertexPtrNNPtr& freeStateNN, std::vector<VertexPtr>* recycledVertices);
195 std::pair<unsigned int, unsigned int> resort(const VertexPtrNNPtr& vertexNN, const VertexPtrNNPtr& freeStateNN, std::vector<VertexPtr>* recycledVertices);
257 typedef std::multimap<ompl::base::Cost, VertexPtr, std::function<bool (const ompl::base::Cost&, const ompl::base::Cost&)> > CostToVertexMMap;
260 typedef std::multimap<CostPair, VertexPtrPair, std::function<bool (const CostPair&, const CostPair&)> > CostToVertexPtrPairMMap;
275 typedef std::unordered_map<BITstar::VertexId, EdgeQueueIterList> VertexIdToEdgeQueueIterListUMap;
294 void processKNearest(unsigned int k, const VertexConstPtr& vertex, std::vector<VertexPtr>* kNearSamples, std::vector<VertexPtr>* kNearVertices);
304 std::pair<unsigned int, unsigned int> pruneBranch(const VertexPtr& branchBase, const VertexPtrNNPtr& vertexNN, const VertexPtrNNPtr& freeStateNN, std::vector<VertexPtr>* recycledVertices);
313 //This is *NOT* by const-reference so that the oldVertex pointer doesn't go out of scope on me... which was happening if it was being called with an iter->second where the iter gets deleted in this function...
314 unsigned int vertexRemoveHelper(VertexPtr oldVertex, const VertexPtrNNPtr& vertexNN, const VertexPtrNNPtr& freeStateNN, std::vector<VertexPtr>* recycledVertices, bool removeLookups);
323 void edgeRemoveHelper(const EdgeQueueIter& oldEdgeIter, bool rmIncomingLookup, bool rmOutgoingLookup);
332 void rmEdgeLookupHelper(VertexIdToEdgeQueueIterListUMap& lookup, const BITstar::VertexId& idx, const EdgeQueueIter& mmapIterToRm);
362 bool isCostBetterThanOrEquivalentTo(const ompl::base::Cost& a, const ompl::base::Cost& b) const;
std::function< ompl::base::Cost(const VertexConstPtr &)> VertexHeuristicFunc
A std::function definition of a heuristic function for a vertex.
Definition: IntegratedQueue.h:102
void pruneEdgesTo(const VertexPtr &cVertex)
Prune edges in the edge queue that lead to the given vertex using the prune function.
Definition: IntegratedQueue.cpp:308
void listVertices(std::vector< VertexConstPtr > *vertexQueue)
Get a copy of the vertices in the vertex queue that are left to be expanded. This is expensive and is...
Definition: IntegratedQueue.cpp:854
void setDelayedRewiring(bool delayRewiring)
Delay considering rewiring edges until an initial solution is found. This improves the time required ...
Definition: IntegratedQueue.cpp:1674
bool samplePruneCondition(const VertexPtr &vertex) const
The condition used to prune disconnected samples from the free set. Compares lowerBoundHeuristicVerte...
Definition: IntegratedQueue.cpp:652
void markVertexUnsorted(const VertexPtr &vertex)
Mark the queue as requiring resorting downstream of the specified vertex.
Definition: IntegratedQueue.cpp:415
std::pair< ompl::base::Cost, ompl::base::Cost > CostPair
A typedef for a pair of costs, i.e., the edge sorting key.
Definition: IntegratedQueue.h:96
ompl::base::Cost lowerBoundHeuristicEdge(const VertexConstPtrPair &edgePair) const
Calculates a heuristic estimate of the cost of a solution constrained to go through an edge...
Definition: BITstar.cpp:1682
void eraseVertex(const VertexPtr &oldVertex, bool disconnectParent, const VertexPtrNNPtr &vertexNN, const VertexPtrNNPtr &freeStateNN, std::vector< VertexPtr > *recycledVertices)
Erase a vertex from the vertex expansion queue. Will disconnect the vertex from its parent and remove...
Definition: IntegratedQueue.cpp:103
unsigned int numVertices() const
Returns the number of vertices left to expand. This has nontrivial cost, as the token must be moved t...
Definition: IntegratedQueue.cpp:691
std::shared_ptr< NearestNeighbors< VertexPtr > > VertexPtrNNPtr
The OMPL::NearestNeighbors structure.
Definition: BITstar.h:137
bool edgePruneCondition(const VertexPtrPair &edge) const
The condition used to prune edge (i.e., vertex-pair) out of the queue. Compares lowerBoundHeuristicEd...
Definition: IntegratedQueue.cpp:661
unsigned int numEdgesTo(const VertexPtr &cVertex) const
Get the number of edges in the queue pointing to a specific vertex.
Definition: IntegratedQueue.cpp:713
std::function< ompl::base::Cost(const VertexConstPtrPair &)> EdgeHeuristicFunc
A std::function definition of a heuristic function for an edge.
Definition: IntegratedQueue.h:105
std::pair< unsigned int, unsigned int > resort(const VertexPtrNNPtr &vertexNN, const VertexPtrNNPtr &freeStateNN, std::vector< VertexPtr > *recycledVertices)
Resort the queue, only reinserting edges/vertices if their lower-bound heuristic is less then the thr...
Definition: IntegratedQueue.cpp:496
unsigned int numEdges() const
Returns the number of edges in the queue.
Definition: IntegratedQueue.cpp:684
std::function< double(const VertexConstPtr &, const VertexConstPtr &)> DistanceFunc
A std::function definition for the distance between two vertices.
Definition: IntegratedQueue.h:108
VertexPtr frontVertex()
Get the best vertex on the queue without incrementing the vertex queue.
Definition: IntegratedQueue.cpp:117
void pruneEdgesFrom(const VertexPtr &pVertex)
Prune edges in the edge queue that leave from the given vertex using the prune function.
Definition: IntegratedQueue.cpp:361
std::shared_ptr< const Vertex > VertexConstPtr
A constant vertex shared pointer.
Definition: BITstar.h:125
void insertEdge(const VertexPtrPair &newEdge)
Insert an edge into the edge processing queue. Edges are removed from the processing queue...
Definition: IntegratedQueue.cpp:95
bool isVertexExpanded(const VertexConstPtr &vertex) const
Returns whether a given vertex has been expanded or not.
Definition: IntegratedQueue.cpp:824
CostPair frontEdgeValue()
Get the value of the best edge on the queue, leaving it on the edge queue.
Definition: IntegratedQueue.cpp:165
VertexPtrPair frontEdge()
Get the best edge on the queue, leaving it on the edge queue.
Definition: IntegratedQueue.cpp:133
bool isEmpty()
Returns true if the queue is empty. In the case where the edge queue is empty but the vertex queue is...
Definition: IntegratedQueue.cpp:809
A queue of edges to be processed that integrates both the expansion of Vertices and the ordering of t...
Definition: IntegratedQueue.h:90
ompl::base::Cost currentHeuristicEdgeTarget(const VertexConstPtrPair &edgePair) const
Calculates a heuristic estimate of the cost of a path to the target of an edge, dependent on the cost...
Definition: BITstar.cpp:1696
void reset()
Reset the queue, clearing all the edge containers and moving the vertex expansion token to the start...
Definition: IntegratedQueue.cpp:603
void setThreshold(const ompl::base::Cost &costThreshold)
Set the threshold of the queue.
Definition: IntegratedQueue.cpp:218
ompl::base::Cost lowerBoundHeuristicVertex(const VertexConstPtr &vertex) const
Calculates a heuristic estimate of the cost of a solution constrained to pass through a vertex...
Definition: BITstar.cpp:1669
unsigned int numEdgesFrom(const VertexPtr &pVertex) const
Get the number of edges in the queue coming from a specific vertex.
Definition: IntegratedQueue.cpp:754
std::pair< VertexPtr, VertexPtr > VertexPtrPair
A pair of vertices, i.e., an edge.
Definition: BITstar.h:133
ompl::base::Cost getThreshold() const
Get the threshold of the queue.
Definition: IntegratedQueue.cpp:225
VertexPtrPair popFrontEdge()
Pop the best edge off the queue, removing it from the edge queue in the process.
Definition: IntegratedQueue.cpp:200
ompl::base::Cost currentHeuristicEdge(const VertexConstPtrPair &edgePair) const
Calculates a heuristic estimate of the cost of a solution constrained to go through an edge...
Definition: BITstar.cpp:1689
A shared pointer wrapper for ompl::base::OptimizationObjective.
IntegratedQueue(const ompl::base::OptimizationObjectivePtr &opt, const DistanceFunc &distanceFunc, const NeighbourhoodFunc &nearSamplesFunc, const NeighbourhoodFunc &nearVerticesFunc, const VertexHeuristicFunc &lowerBoundHeuristicVertex, const VertexHeuristicFunc ¤tHeuristicVertex, const EdgeHeuristicFunc &lowerBoundHeuristicEdge, const EdgeHeuristicFunc ¤tHeuristicEdge, const EdgeHeuristicFunc ¤tHeuristicEdgeTarget)
Construct an integrated queue.
Definition: IntegratedQueue.cpp:50
std::pair< unsigned int, unsigned int > prune(const VertexPtr &pruneStartPtr, const VertexPtrNNPtr &vertexNN, const VertexPtrNNPtr &freeStateNN, std::vector< VertexPtr > *recycledVertices)
Prune the vertex queue of vertices whose their lower-bound heuristic is greater then the threshold...
Definition: IntegratedQueue.cpp:430
ompl::base::Cost currentHeuristicVertex(const VertexConstPtr &vertex) const
Calculates a heuristic estimate of the cost of a solution constrained to pass through a vertex...
Definition: BITstar.cpp:1676
void removeEdgesFrom(const VertexPtr &pVertex)
Erase all edges in the edge queue that leave from the given vertex.
Definition: IntegratedQueue.cpp:270
bool vertexPruneCondition(const VertexPtr &vertex) const
The condition used to prune vertices out of the queue. Compares lowerBoundHeuristicVertex to the give...
Definition: IntegratedQueue.cpp:642
ompl::base::Cost frontVertexValue()
Get the value of the best vertex on the queue without incrementing the vertex queue.
Definition: IntegratedQueue.cpp:149
void removeEdgesTo(const VertexPtr &cVertex)
Erase all edges in the edge queue that lead to the given vertex.
Definition: IntegratedQueue.cpp:232
void listEdges(std::vector< std::pair< VertexConstPtr, VertexConstPtr > > *edgeQueue)
Get a copy of the edge queue. This is expensive and is only meant for animations/debugging.
Definition: IntegratedQueue.cpp:869
void insertVertex(const VertexPtr &newVertex)
Insert a vertex into the vertex expansion queue. Vertices remain in the vertex queue until pruned or ...
Definition: IntegratedQueue.cpp:87
std::function< unsigned int(const VertexPtr &, std::vector< VertexPtr > *)> NeighbourhoodFunc
A std::function definition for the neighbourhood of a vertex .
Definition: IntegratedQueue.h:111
bool getDelayedRewiring() const
Get whether BIT* is delaying rewiring until a solution is found.
Definition: IntegratedQueue.cpp:1681
bool isReset() const
Returns true if the queue is reset. This means that no edges have been expanded and the vertex expans...
Definition: IntegratedQueue.cpp:802
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition: Cost.h:47
void finish()
Finish the queue, clearing all the edge containers and moving the vertex expansion token to the end...
Definition: IntegratedQueue.cpp:586