Class BITstar::CostHelper

Nested Relationships

This class is a nested type of Class BITstar.

Class Documentation

class CostHelper

A helper class to handle the various heuristic functions in one place.

Short Description

A header-only class that consolidates all the various heuristic calculations for vertices/edges in a graph into one place. Most of these functions are simply combinatorial pass-throughs to the OptimizationObjective.

Public Functions

CostHelper() = default

Construct the heuristic helper, must be setup before use.

virtual ~CostHelper() = default
inline void setup(const ompl::base::OptimizationObjectivePtr &opt, ImplicitGraph *graph)

Setup the CostHelper, must be called before use.

inline void reset()

Reset the CostHelper, returns to state at construction.

inline ompl::base::OptimizationObjectivePtr getOptObj() const

Get the underling OptimizationObjective.

inline ompl::base::Cost lowerBoundHeuristicVertex(const VertexConstPtr &vertex) const

Calculates a heuristic estimate of the cost of a solution constrained to pass through a vertex, independent of the current cost-to-come. I.e., combines the heuristic estimates of the cost-to-come and cost-to-go.

inline ompl::base::Cost currentHeuristicVertex(const VertexConstPtr &vertex) const

Calculates a heuristic estimate of the cost of a solution constrained to pass through a vertex, dependent on the current cost-to-come. I.e., combines the current cost-to-come with a heuristic estimate of the cost-to-go.

inline ompl::base::Cost lowerBoundHeuristicEdge(const VertexConstPtrPair &edgePair) const

Calculates a heuristic estimate of the cost of a solution constrained to go through an edge, independent of the cost-to-come of the parent state. I.e., combines the heuristic estimates of the cost-to-come, edge cost, and cost-to-go.

inline ompl::base::Cost currentHeuristicEdge(const VertexConstPtrPair &edgePair) const

Calculates a heuristic estimate of the cost of a solution constrained to go through an edge, dependent on the cost-to-come of the parent state. I.e., combines the current cost-to-come with heuristic estimates of the edge cost, and cost-to-go.

inline ompl::base::Cost lowerBoundHeuristicToTarget(const VertexConstPtrPair &edgePair) const

Calculates a heuristic estimate of the cost of a path to the target of an edge, independent of the current cost-to-come of the parent state. I.e., combines heuristics estimates of the cost-to-come and the edge cost.

inline ompl::base::Cost currentHeuristicToTarget(const VertexConstPtrPair &edgePair) const

Calculates a heuristic estimate of the cost of a path to the target of an edge, dependent on the cost-to-come of the parent state. I.e., combines the current cost-to-come with heuristic estimates of the edge cost.

inline ompl::base::Cost costToComeHeuristic(const VertexConstPtr &vertex) const

Calculate a heuristic estimate of the cost-to-come for a Vertex.

inline ompl::base::Cost edgeCostHeuristic(const VertexConstPtrPair &edgePair) const

Calculate a heuristic estimate of the cost of an edge between two Vertices.

inline ompl::base::Cost costToGoHeuristic(const VertexConstPtr &vertex) const

Calculate a heuristic estimate of the cost-to-go for a Vertex.

inline ompl::base::Cost trueEdgeCost(const VertexConstPtrPair &edgePair) const

The true cost of an edge, including constraints.

template<typename ...Costs>
inline ompl::base::Cost combineCosts(const ompl::base::Cost &cost, const Costs&... costs) const

Combine multiple costs.

inline ompl::base::Cost inflateCost(const ompl::base::Cost &cost, double factor) const

Inflate a cost by a given factor.

inline bool isCostWorseThan(const ompl::base::Cost &a, const ompl::base::Cost &b) const

Compare whether cost a is worse than cost b by checking whether b is better than a.

inline bool isCostNotEquivalentTo(const ompl::base::Cost &a, const ompl::base::Cost &b) const

Compare whether cost a and cost b are not equivalent by checking if either a or b is better than the other.

inline bool isCostBetterThanOrEquivalentTo(const ompl::base::Cost &a, const ompl::base::Cost &b) const

Compare whether cost a is better or equivalent to cost b by checking that b is not better than a.

inline bool isCostWorseThanOrEquivalentTo(const ompl::base::Cost &a, const ompl::base::Cost &b) const

Compare whether cost a is worse or equivalent to cost b by checking that a is not better than b.

inline double fractionalChange(const ompl::base::Cost &newCost, const ompl::base::Cost &oldCost) const

Calculate the fractional change of cost “newCost” from “oldCost” relative to “oldCost”, i.e., (newCost - oldCost)/oldCost.

inline double fractionalChange(const ompl::base::Cost &newCost, const ompl::base::Cost &oldCost, const ompl::base::Cost &refCost) const

Calculate the fractional change of cost “newCost” from “oldCost” relative to “refCost”, i.e., (newCost - oldCost)/refCost.

inline bool isSatisfied(const ompl::base::Cost &a) const
inline bool isFinite(const ompl::base::Cost &a) const
inline bool isCostEquivalentTo(const ompl::base::Cost &a, const ompl::base::Cost &b) const
inline bool isCostBetterThan(const ompl::base::Cost &a, const ompl::base::Cost &b) const
inline ompl::base::Cost betterCost(const ompl::base::Cost &a, const ompl::base::Cost &b) const
inline ompl::base::Cost combineCosts(const ompl::base::Cost &a, const ompl::base::Cost &b) const
inline ompl::base::Cost infiniteCost() const
inline ompl::base::Cost identityCost() const
inline ompl::base::Cost motionCostHeuristic(const ompl::base::State *a, const ompl::base::State *b) const
inline ompl::base::Cost motionCost(const ompl::base::State *a, const ompl::base::State *b) const