Simox  2.3.74.0
Saba::Sampler Class Referenceabstract

An interface class for custom sample algorithms. More...

Public Member Functions

 Sampler (unsigned int dimension)
 
virtual ~Sampler ()
 
virtual void sample (Eigen::VectorXf &stroreConfig, CSpacePtr space)=0
 
virtual void enableMetricWeights (const Eigen::VectorXf &weights)
 
virtual void disableMetricWeights ()
 

Protected Member Functions

void getUniformlyRandomConfig (Eigen::VectorXf &stroreConfig, CSpacePtr space)
 Returns a uniformly generated random configuration with nDimension components. More...
 
void getNormalRandomConfig (Eigen::VectorXf &stroreConfig, const Eigen::VectorXf &mean, const Eigen::MatrixXf &variance)
 
void getNormalRandomConfig (Eigen::VectorXf &stroreConfig, const Eigen::VectorXf &mean, float variance)
 

Protected Attributes

unsigned int dimension
 
Eigen::VectorXf metricWeights
 

Detailed Description

An interface class for custom sample algorithms.

Constructor & Destructor Documentation

◆ Sampler()

Saba::Sampler::Sampler ( unsigned int  dimension)

◆ ~Sampler()

Saba::Sampler::~Sampler ( )
virtualdefault

Member Function Documentation

◆ disableMetricWeights()

void Saba::Sampler::disableMetricWeights ( )
virtual

◆ enableMetricWeights()

void Saba::Sampler::enableMetricWeights ( const Eigen::VectorXf &  weights)
virtual

Enable metric weighting. This can be useful for different variance in each dimension. Standard: disabled

◆ getNormalRandomConfig() [1/2]

void Saba::Sampler::getNormalRandomConfig ( Eigen::VectorXf &  stroreConfig,
const Eigen::VectorXf &  mean,
const Eigen::MatrixXf &  variance 
)
protected

Returns a normal distributed random configuration with nDimension components. Note that we assume the covariance-matrix to be a diagonal matrix. This means, that the components of the configuration are uncorrelated. The result value is not checked against any boundaries of the configuration space.

◆ getNormalRandomConfig() [2/2]

void Saba::Sampler::getNormalRandomConfig ( Eigen::VectorXf &  stroreConfig,
const Eigen::VectorXf &  mean,
float  variance 
)
protected

Returns a normal distributed random configuration with nDimension components. This is a convenience function in case you want to apply the same variance in every dimension.

◆ getUniformlyRandomConfig()

void Saba::Sampler::getUniformlyRandomConfig ( Eigen::VectorXf &  stroreConfig,
CSpacePtr  space 
)
protected

Returns a uniformly generated random configuration with nDimension components.

◆ sample()

virtual void Saba::Sampler::sample ( Eigen::VectorXf &  stroreConfig,
CSpacePtr  space 
)
pure virtual

Field Documentation

◆ dimension

unsigned int Saba::Sampler::dimension
protected

◆ metricWeights

Eigen::VectorXf Saba::Sampler::metricWeights
protected