![]() |
RobWorkProject
23.9.11-
|
a state sampler that will sample a finite set of states. The nr of samples is not necesdarilly finite since states are allowed to be sampled multiple times. More...
#include <FiniteStateSampler.hpp>
Inherits StateSampler.
Public Types | |
| enum | SamplerType { ORDERED_SAMPLING , RANDOM_SAMPLING } |
| type of sampling More... | |
Public Types inherited from StateSampler | |
| typedef rw::core::Ptr< StateSampler > | Ptr |
Public Member Functions | |
| FiniteStateSampler (const rw::kinematics::State &state, int n=1, SamplerType type=ORDERED_SAMPLING) | |
| constructor for sampling a single state More... | |
| FiniteStateSampler (const std::vector< rw::kinematics::State > &states, int n=1, SamplerType type=ORDERED_SAMPLING) | |
| constructor for sampling multiple states More... | |
| virtual | ~FiniteStateSampler () |
| destructor | |
| void | addState (const rw::kinematics::State &state) |
| add a single state to sample More... | |
| void | addStates (const std::vector< rw::kinematics::State > &states) |
| add states to be sampled More... | |
| void | setStates (const std::vector< rw::kinematics::State > &states) |
| set the states that you want sampled More... | |
| bool | sample (rw::kinematics::State &state) |
| Sample a state. More... | |
| bool | empty () const |
| Sample a state. More... | |
a state sampler that will sample a finite set of states. The nr of samples is not necesdarilly finite since states are allowed to be sampled multiple times.
| enum SamplerType |
| FiniteStateSampler | ( | const rw::kinematics::State & | state, |
| int | n = 1, |
||
| SamplerType | type = ORDERED_SAMPLING |
||
| ) |
constructor for sampling a single state
| state | [in] the state to sample |
| n | [in] number of allowed samples, if n<0 then a infinite number of samples is allowed |
| type | documentation missing ! |
| FiniteStateSampler | ( | const std::vector< rw::kinematics::State > & | states, |
| int | n = 1, |
||
| SamplerType | type = ORDERED_SAMPLING |
||
| ) |
constructor for sampling multiple states
| states | [in] states that are to be sampled |
| n | [in] number of allowed samples, if n<0 then a infinite number of samples is allowed |
| type | documentation missing ! |
| void addState | ( | const rw::kinematics::State & | state | ) |
add a single state to sample
| state | [in] state to sample |
| void addStates | ( | const std::vector< rw::kinematics::State > & | states | ) |
add states to be sampled
| states | [in] states to sample |
|
virtual |
Sample a state.
If sampling fails, the sampler may return the empty configuration. If empty() is true then the sampler has no more configurations. Otherwise sample() may (or may not) succeed if called a second time.
Implements StateSampler.
|
virtual |
Sample a state.
If sampling fails, the sampler may return the empty configuration. If empty() is true then the sampler has no more configurations. Otherwise sample() may (or may not) succeed if called a second time.
One of the states in the finite state list is choosen and returned
Implements StateSampler.
| void setStates | ( | const std::vector< rw::kinematics::State > & | states | ) |
set the states that you want sampled
| states | [in] the states to sample |