Loading...
Searching...
No Matches
ompl::base::InformedStateSampler Class Reference

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

#include <ompl/base/samplers/InformedStateSampler.h>

Inheritance diagram for ompl::base::InformedStateSampler:

Public Types

using GetCurrentCostFunc = std::function<Cost()>
 The definition of a function pointer for querying the current solution cost.

Public Member 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.
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.
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.
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.
Public Member Functions inherited from ompl::base::StateSampler
 StateSampler (const StateSampler &)=delete
StateSampleroperator= (const StateSampler &)=delete
 StateSampler (const StateSpace *space)
 Constructor.

Additional Inherited Members

Protected Attributes inherited from ompl::base::StateSampler
const StateSpacespace_
 The state space this sampler samples.
RNG rng_
 An instance of a random number generator.

Detailed Description

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

Definition at line 123 of file InformedStateSampler.h.

Member Typedef Documentation

◆ GetCurrentCostFunc

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

Definition at line 127 of file InformedStateSampler.h.

Constructor & Destructor Documentation

◆ InformedStateSampler() [1/2]

ompl::base::InformedStateSampler::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.

Definition at line 123 of file InformedStateSampler.cpp.

◆ InformedStateSampler() [2/2]

ompl::base::InformedStateSampler::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.

Definition at line 132 of file InformedStateSampler.cpp.

Member Function Documentation

◆ sampleGaussian()

void ompl::base::InformedStateSampler::sampleGaussian ( State * statePtr,
const State * mean,
double stdDev )
overridevirtual

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

Implements ompl::base::StateSampler.

Definition at line 178 of file InformedStateSampler.cpp.

◆ sampleUniform()

void ompl::base::InformedStateSampler::sampleUniform ( State * statePtr)
overridevirtual

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.

Implements ompl::base::StateSampler.

Definition at line 154 of file InformedStateSampler.cpp.

◆ sampleUniformNear()

void ompl::base::InformedStateSampler::sampleUniformNear ( State * statePtr,
const State * near,
double distance )
overridevirtual

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

Implements ompl::base::StateSampler.

Definition at line 171 of file InformedStateSampler.cpp.


The documentation for this class was generated from the following files: