Class InformedStateSampler

Inheritance Relationships

Base Type

Class Documentation

class InformedStateSampler : public ompl::base::StateSampler

A wrapper class that allows an InformedSampler to be used as a StateSampler.

Public Types

using GetCurrentCostFunc = std::function<Cost()>

The definition of a function pointer for querying the current solution cost.

Public Functions

InformedStateSampler(const ProblemDefinitionPtr &probDefn, unsigned int maxNumberCalls, const GetCurrentCostFunc &costFunc)

Construct a sampler that only generates states with a heuristic solution estimate that is less than the cost of the current solution using the default informed sampler for the current optimization objective. Requires a function pointer to a method to query the cost of the current solution.

InformedStateSampler(const ProblemDefinitionPtr &probDefn, const GetCurrentCostFunc &costFunc, const InformedSamplerPtr &infSampler)

Construct a sampler that only generates states with a heuristic solution estimate that is less than the cost of the current solution using the provided informed sampler. Requires a function pointer to a method to query the cost of the current solution.

~InformedStateSampler() override = default
virtual void sampleUniform(State *statePtr) override

Sample uniformly in the subset of the state space whose heuristic solution estimates are less than the current best cost (as defined by the pointer passed at construction). By default just calls sampleUniform(State*, Cost) with cost given by the member variable.

virtual void sampleUniformNear(State *statePtr, const State *near, double distance) override

By default sampleUniformNear throws. This can be overloaded by a specific informed sampler if desired.

virtual void sampleGaussian(State *statePtr, const State *mean, double stdDev) override

By default sampleGaussian throws. This can be overloaded by a specific informed sampler if desired.