smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS > Class Template Reference

Implements the sampler components that relies on uniform sampling. More...

#include <trajectory_bias.h>

Inheritance diagram for smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >:
smp::sampler_base< typeparams >

List of all members.

Public Member Functions

int sm_update_insert_vertex (vertex_t *vertex_in)
 Update function for vertex insertion.
int sm_update_insert_edge (edge_t *edge_in)
 Update function for edge insertion.
int sm_update_delete_vertex (vertex_t *vertex_in)
 Update function for vertex deletion.
int sm_update_delete_edge (edge_t *edge_in)
 Update function for edge insertion.
int sample (state_t **state_sample_out)
 Provides a sample state from the state space.
int set_support (const region_t support_in)
 Sets the dimensions and position of the rectangular bounding box of the support.
int update_trajectory (trajectory_t *trajectory_in)
 Updates the trajectory around which the samples should be concentrated.
int set_sample_dispersion (double dispersion_in)
 Sample dispersion around the bias trajectory.
int set_bias_probability (double bias_probability_in)
 Sets the probability that the current sample is a trajectory bias.

Detailed Description

template<class typeparams, int NUM_DIMENSIONS>
class smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >

Implements the sampler components that relies on uniform sampling.

A sampler component that implements trajectory biased sampling. This sampler component either outputs a sample that is concentrated around the best trajectory in the tree, or it outputs a uniform sample. One of the two events is selected randomly.

Examples:

libbot_rrtstar_single_integrator_trajectory_biasing.cpp, libbot_rrtstar_single_integrator_trajectory_biasing_and_bnb.cpp, standalone_rrtstar_single_integrator_trajectory_biasing.cpp, and standalone_rrtstar_single_integrator_trajectory_biasing_and_bnb.cpp.


Member Function Documentation

template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::sample ( state_t **  state_sample_out) [virtual]

Provides a sample state from the state space.

This function creates (by allocating the memory) for a new state that is sampled (randomly or quasi-randomly) from the state space. It returns a pointer to the new state.

Parameters:
state_sample_outA pointer to the state that will be returned. This variable can be set to, e.g., the address of a null pointer.
Returns:
Returns 1 for success, a non-positive number for failure.

Implements smp::sampler_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::set_bias_probability ( double  bias_probability_in)

Sets the probability that the current sample is a trajectory bias.

Each sample returned by the trajectory biased sampling component is either a uniform sample over a ractangular support, or it is a sampled biased to be around a given trajectory. Before the sample is drawn, one of these two actions is selected random with a certain probability, which can be set using this function.

Parameters:
bias_probability_inProbability that a given sample will be biased around the trajectory
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::set_sample_dispersion ( double  dispersion_in)

Sample dispersion around the bias trajectory.

This function sets the maximum distance of the biased samples from the original trajectory.

Parameters:
dispersion_inNew dispersion for biased sampling.
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::set_support ( const region_t  support_in)

Sets the dimensions and position of the rectangular bounding box of the support.

Uniform sampling component of the trajectory biased sampling class uses a bounded support, which can be set using this function. This sampler function only draws samples from a rectangular box in the Euclidean space with dimensions NUM_DIMENSIONS, which is a template parameter to the uniform sampler class. If the support variable is not set, i.e., this function is never called, then the support is initialized to the unit cube centered at the origin by default.

Parameters:
support_inNew support for the uniform sampling distribution.
Returns:
Returns 1 for success, a non-positive number for failure.
template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::sm_update_delete_edge ( edge_t edge_in) [virtual]

Update function for edge insertion.

This function is called by the planner whenever an edge is delete from the graph. A pointer to the edge is given as an argument.

Parameters:
edge_inA pointer to deleted edge.
Returns:
Return 1 for success, a non-positive value to indiacate error.

Implements smp::sampler_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::sm_update_delete_vertex ( vertex_t vertex_in) [virtual]

Update function for vertex deletion.

This function is called by the planner whenever a vertex is deleted from the graph. A pointer to the vertex is given as an argument.

Parameters:
vertex_inA pointer to deleted vertex.
Returns:
Return 1 if success, a non-positive value to indiacate error.

Implements smp::sampler_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::sm_update_insert_edge ( edge_t edge_in) [virtual]

Update function for edge insertion.

This function is called by the planner whenever a new edge is added to the graph. A pointer to the new edge is given as an argument.

Parameters:
edge_inA pointer to the new edge.
Returns:
Return 1 for success, a non-positive value to indiacate error.

Implements smp::sampler_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::sm_update_insert_vertex ( vertex_t vertex_in) [virtual]

Update function for vertex insertion.

This function is called by the planner whenever a new vertex is added to the graph. A pointer to the new vertex is given as an argument.

Parameters:
vertex_inA pointer to the new vertex.
Returns:
Return 1 if success, a non-positive value to indiacate error.

Implements smp::sampler_base< typeparams >.

template<class typeparams , int NUM_DIMENSIONS>
int smp::sampler_trajectory_bias< typeparams, NUM_DIMENSIONS >::update_trajectory ( trajectory_t trajectory_in)

Updates the trajectory around which the samples should be concentrated.

This function can be called by the user to modify the trajectory around which the samples should be concentrated.

Parameters:
trajectory_inNew trajectory for biased sampling.
Returns:
Returns 1 for success, a non-positive number for failure.

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