Helios++
Helios software for LiDAR simulations
UniformNoiseSource< RealType > Class Template Reference

Class for uniform noise handling. More...

#include <UniformNoiseSource.h>

Inheritance diagram for UniformNoiseSource< RealType >:
Collaboration diagram for UniformNoiseSource< RealType >:

Public Member Functions

 UniformNoiseSource (RandomnessGenerator< RealType > const &rg, RealType uniformNoiseMin=0.0, RealType uniformNoiseMax=1.0)
 Create a UniformNoiseSource using received RandomnessGenerator. More...
 
 UniformNoiseSource (std::string const &seed, RealType uniformNoiseMin=0.0, RealType uniformNoiseMax=1.0)
 Create a UniformNoiseSource using received seed. More...
 
 UniformNoiseSource (RealType uniformNoiseMin=0.0, RealType uniformNoiseMax=1.0)
 Create default UniformNoiseSource. More...
 
RealType getMin ()
 Obtain the current minimum for uniform noise generation. More...
 
UniformNoiseSourcesetMin (RealType min)
 Set the current minimum for uniform noise generation. More...
 
RealType getMax ()
 Obtain the current maximum for uniform noise generation. More...
 
UniformNoiseSourcesetMax (RealType max)
 Set the current maximum for uniform noise generation. More...
 
UniformNoiseSourceconfigureUniformNoise (RealType min, RealType max)
 Configure uniform noise. More...
 
std::string getRandomNoiseType () override
 
RealType noiseFunction () override
 Compute next uniform noise value from current random uniform distribution. More...
 
- Public Member Functions inherited from RandomNoiseSource< RealType >
 RandomNoiseSource (RandomnessGenerator< RealType > const &rg)
 Create a RandomNoiseSource using received RandomnessGenerator. More...
 
 RandomNoiseSource (std::string const &seed)
 Create a RandomNoiseSource using received seed. More...
 
 RandomNoiseSource ()
 Create a RandomNoiseSource using default RandomnessGenerator.
 
- Public Member Functions inherited from NoiseSource< RealType >
void build ()
 Common behavior for all NoiseSource constructors.
 
double getClipMin ()
 Obtain the clip min value. More...
 
NoiseSourcesetClipMin (RealType clipMin)
 Set the clip min value. More...
 
double getClipMax ()
 Obtain the clip max value. More...
 
NoiseSourcesetClipMax (RealType clipMax)
 Set the clip max value. More...
 
bool isClipEnabled ()
 Check if clipping is enabled or not. More...
 
NoiseSourcesetClipEnabled (bool clipEnabled)
 Enable clipping by setting it to true or disable it by setting to false. More...
 
bool isFixedValueEnabled ()
 Check if fixed value usage is enabled or not. More...
 
unsigned long getFixedLifespan ()
 Obtain the fixed value lifespan. More...
 
NoiseSourcesetFixedLifespan (unsigned long fixedLifespan)
 Set the fixed value lifespan. More...
 
unsigned long getFixedValueRemainingUses ()
 Obtain the remaining uses of current fixed value. More...
 
NoiseSourcesetFixedValueRemainingUses (unsigned long remainingUses)
 Update remaining uses count for current fixed value. More...
 
NoiseSourcefixedRenew ()
 Forces a renewal of fixed value and its remaining uses. More...
 
RealType next ()
 Obtain the next default noise value. More...
 

Protected Attributes

RealType uniformNoiseMin = 0.0
 The minimum value the uniform noise is configured to support.
 
RealType uniformNoiseMax = 1.0
 The maximum value the uniform noise is configured to support.
 
- Protected Attributes inherited from RandomNoiseSource< RealType >
RandomnessGenerator< RealType > rg
 RandomnessGenerator to be used to generate random noise.
 
- Protected Attributes inherited from NoiseSource< RealType >
RealType clipMin = 0.0
 All noise values which are less than clipMin will be clipped to clipMin if clipping is enabled. More...
 
RealType clipMax = 1.0
 All noise values which are greater than clipMax will be clipped to clipMaxx if clipping is enabled.
 
bool clipEnabled = false
 True when clipping is enabled, False otherwise.
 
unsigned long fixedLifespan = 1L
 Specify the how many times a fixed value can be used before being renewed. More...
 
unsigned long fixedRemainingUses = 0L
 How many remaining uses the fixed value has. More...
 
RealType fixedValue = 0
 The fixed value. More...
 

Friends

template<typename _RealType >
std::ostream & operator<< (std::ostream &out, UniformNoiseSource< _RealType > &ns)
 Output stream behavior.
 

Additional Inherited Members

- Protected Member Functions inherited from NoiseSource< RealType >
RealType clip (RealType v)
 If clipping is enabled, it will clip received value. If clipping is not enabled, received value will not be clipped. More...
 

Detailed Description

template<typename RealType>
class UniformNoiseSource< RealType >

Class for uniform noise handling.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
RealTypeType for the noise. Should be a decimal type, for instance float or double.

Constructor & Destructor Documentation

◆ UniformNoiseSource() [1/3]

template<typename RealType>
UniformNoiseSource< RealType >::UniformNoiseSource ( RandomnessGenerator< RealType > const &  rg,
RealType  uniformNoiseMin = 0.0,
RealType  uniformNoiseMax = 1.0 
)
inlineexplicit

Create a UniformNoiseSource using received RandomnessGenerator.

Parameters
rgRandomnessGenerator used to generate normal noise
See also
uniformNoiseMin
uniformNoiseMax

◆ UniformNoiseSource() [2/3]

template<typename RealType>
UniformNoiseSource< RealType >::UniformNoiseSource ( std::string const &  seed,
RealType  uniformNoiseMin = 0.0,
RealType  uniformNoiseMax = 1.0 
)
inlineexplicit

Create a UniformNoiseSource using received seed.

Parameters
seedSeed to build the normal noise generator
See also
uniformNoiseMin
uniformNoiseMax

◆ UniformNoiseSource() [3/3]

template<typename RealType>
UniformNoiseSource< RealType >::UniformNoiseSource ( RealType  uniformNoiseMin = 0.0,
RealType  uniformNoiseMax = 1.0 
)
inlineexplicit

Member Function Documentation

◆ configureUniformNoise()

template<typename RealType>
UniformNoiseSource< RealType > & UniformNoiseSource< RealType >::configureUniformNoise ( RealType  min,
RealType  max 
)

Configure uniform noise.

Parameters
minMin possible value for uniform noise
maxMax possible value for uniform noise
Returns
The UniformNoiseSource reference in a fluent programming fashion

◆ getMax()

template<typename RealType>
RealType UniformNoiseSource< RealType >::getMax ( )
inline

Obtain the current maximum for uniform noise generation.

Returns
Current maximum for uniform noise generation

◆ getMin()

template<typename RealType>
RealType UniformNoiseSource< RealType >::getMin ( )
inline

Obtain the current minimum for uniform noise generation.

Returns
Current minimum for uniform noise generation

◆ getRandomNoiseType()

template<typename RealType>
std::string UniformNoiseSource< RealType >::getRandomNoiseType ( )
inlineoverridevirtual

◆ noiseFunction()

template<typename RealType>
RealType UniformNoiseSource< RealType >::noiseFunction ( )
inlineoverridevirtual

Compute next uniform noise value from current random uniform distribution.

Returns
Uniform noise value

Implements NoiseSource< RealType >.

◆ setMax()

template<typename RealType>
UniformNoiseSource& UniformNoiseSource< RealType >::setMax ( RealType  max)
inline

Set the current maximum for uniform noise generation.

NOTICE this will update the uniform random distribution used to generate noise. USE WITH CAUTION. If updating both minimum and maximum at the same time is desired, it is strongly recommended to use the configureUniformNoise function directly instead

Parameters
maxNew maximum for uniform noise generation
Returns
The UniformNoiseSource refenrece in a fluent programming fashion
See also
configureUniformNoise

◆ setMin()

template<typename RealType>
UniformNoiseSource& UniformNoiseSource< RealType >::setMin ( RealType  min)
inline

Set the current minimum for uniform noise generation.

NOTICE this will update the uniform random distribution used to generate noise. USE WITH CAUTION. If updating both minimum and maximum at the same time is desired, it is strongly recommended to use the configureUniformNoise function directly instead

Parameters
minNew minimum for uniform noise generation
Returns
The UniformNoiseSource reference in a fluent programming fashion
See also
configureUniformNoise

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