RejectionInfSampler.cpp
45 RejectionInfSampler::RejectionInfSampler(const ProblemDefinitionPtr probDefn, unsigned int maxNumberCalls)
54 OMPL_WARN("RejectionInfSampler: The optimization objective does not have a cost-to-go heuristic defined. Informed sampling will likely have little to no effect.");
69 bool RejectionInfSampler::sampleUniform(State *statePtr, const Cost &minCost, const Cost &maxCost)
91 foundSample = InformedSampler::opt_->isCostEquivalentTo(minCost, sampledCost) || InformedSampler::opt_->isCostBetterThan(minCost, sampledCost);
110 double RejectionInfSampler::getInformedMeasure(const Cost &/*minCost*/, const Cost &/*maxCost*/) const
117 bool RejectionInfSampler::sampleUniform(State *statePtr, const Cost &maxCost, unsigned int *iterPtr)
123 // Make numIters_ attempts at finding a sample whose heuristic estimate of solution cost through the sample is better than maxCost by sampling the entire planning domain
124 for (/* Provided iteration counter */; *iterPtr < InformedSampler::numIters_ && foundSample == false; ++(*iterPtr))
130 foundSample = InformedSampler::opt_->isCostBetterThan(InformedSampler::heuristicSolnCost(statePtr), maxCost);
virtual double getInformedMeasure(const Cost &) const
The measure of the subset of the state space defined by the current solution cost that is being searc...
Definition: RejectionInfSampler.cpp:105
A shared pointer wrapper for ompl::base::ProblemDefinition.
virtual Cost heuristicSolnCost(const State *statePtr) const
A helper function to calculate the heuristic estimate of the solution cost for a given state using th...
Definition: InformedStateSampler.cpp:79
OptimizationObjectivePtr opt_
A copy of the optimization objective.
Definition: InformedStateSampler.h:99
An abstract class for the concept of using information about the state space and the current solution...
Definition: InformedStateSampler.h:61
virtual bool hasInformedMeasure() const
Whether the sampler can provide a measure of the informed subset.
Definition: RejectionInfSampler.cpp:100
RejectionInfSampler(const ProblemDefinitionPtr probDefn, unsigned int maxNumberCalls)
Construct a rejection sampler that only generates states with a heuristic solution estimate that is l...
Definition: RejectionInfSampler.cpp:45
unsigned int numIters_
The number of iterations I'm allowed to attempt.
Definition: InformedStateSampler.h:103
virtual bool sampleUniform(State *statePtr, const Cost &maxCost)
Sample uniformly in the subset of the state space whose heuristic solution estimates are less than th...
Definition: RejectionInfSampler.cpp:59
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition: Cost.h:47