Implements the sampler components that relies on uniform sampling. More...
#include <trajectory_bias.h>
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. |
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.
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.
state_sample_out | A pointer to the state that will be returned. This variable can be set to, e.g., the address of a null pointer. |
Implements smp::sampler_base< typeparams >.
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.
bias_probability_in | Probability that a given sample will be biased around the trajectory |
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.
dispersion_in | New dispersion for biased sampling. |
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.
support_in | New support for the uniform sampling distribution. |
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.
edge_in | A pointer to deleted edge. |
Implements smp::sampler_base< typeparams >.
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.
vertex_in | A pointer to deleted vertex. |
Implements smp::sampler_base< typeparams >.
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.
edge_in | A pointer to the new edge. |
Implements smp::sampler_base< typeparams >.
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.
vertex_in | A pointer to the new vertex. |
Implements smp::sampler_base< typeparams >.
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.
trajectory_in | New trajectory for biased sampling. |