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

Class for normal noise handling. More...

#include <NormalNoiseSource.h>

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

Public Member Functions

 NormalNoiseSource (RandomnessGenerator< RealType > const &rg, RealType normalNoiseMean=0.0, RealType normalNoiseStdev=1.0)
 Create a NormalNoiseSource using received RandomnessGenerator. More...
 
 NormalNoiseSource (std::string const &seed, RealType normalNoiseMean=0.0, RealType normalNoiseStdev=1.0)
 Create a NormalNoiseSource using received seed. More...
 
 NormalNoiseSource (RealType normalNoiseMean=0.0, RealType normalNoiseStdev=1.0)
 Create default NormalNoiseSource. More...
 
RealType getMean ()
 Obtain the current mean for normal noise generation. More...
 
NormalNoiseSourcesetMean (RealType mean)
 Set the current mean for normal noise generation. More...
 
RealType getStdev ()
 Obtain the current standard deviation for normal noise generation. More...
 
NormalNoiseSourcesetStdev (RealType stdev)
 Set the current standard deviation for normal noise generation. More...
 
NormalNoiseSourceconfigureNormalNoise (RealType mean, RealType stdev)
 Configure normal noise. More...
 
std::string getRandomNoiseType () override
 
RealType noiseFunction () override
 Compute next normal nosie value from current random normal 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 normalNoiseMean = 0.0
 The mean for the normal noise computation.
 
RealType normalNoiseStdev = 1.0
 the standard deviation for hte normal noise computation
 
- 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, NormalNoiseSource< _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 NormalNoiseSource< RealType >

Class for normal 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

◆ NormalNoiseSource() [1/3]

template<typename RealType>
NormalNoiseSource< RealType >::NormalNoiseSource ( RandomnessGenerator< RealType > const &  rg,
RealType  normalNoiseMean = 0.0,
RealType  normalNoiseStdev = 1.0 
)
inlineexplicit

Create a NormalNoiseSource using received RandomnessGenerator.

Parameters
rgRandomnessGenerator used to generate normal noise
See also
normalNoiseMean
normalNoiseStdev

◆ NormalNoiseSource() [2/3]

template<typename RealType>
NormalNoiseSource< RealType >::NormalNoiseSource ( std::string const &  seed,
RealType  normalNoiseMean = 0.0,
RealType  normalNoiseStdev = 1.0 
)
inlineexplicit

Create a NormalNoiseSource using received seed.

Parameters
seedSeed to build the normal noise generator
See also
normalNoiseMean
normalNoiseStdev

◆ NormalNoiseSource() [3/3]

template<typename RealType>
NormalNoiseSource< RealType >::NormalNoiseSource ( RealType  normalNoiseMean = 0.0,
RealType  normalNoiseStdev = 1.0 
)
inlineexplicit

Member Function Documentation

◆ configureNormalNoise()

template<typename RealType >
NormalNoiseSource< RealType > & NormalNoiseSource< RealType >::configureNormalNoise ( RealType  mean,
RealType  stdev 
)

Configure normal noise.

Parameters
meanThe mean for the normal noise
stdevThe standard deviation for the normal noise
Returns
The NormalNoiseSource reference in a fluent programming fashion

◆ getMean()

template<typename RealType>
RealType NormalNoiseSource< RealType >::getMean ( )
inline

Obtain the current mean for normal noise generation.

Returns
Current mean for normal noise generation

◆ getRandomNoiseType()

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

◆ getStdev()

template<typename RealType>
RealType NormalNoiseSource< RealType >::getStdev ( )
inline

Obtain the current standard deviation for normal noise generation.

Returns
Current standard deviation for normal noise generation

◆ noiseFunction()

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

Compute next normal nosie value from current random normal distribution.

Returns
Normal noise value

Implements NoiseSource< RealType >.

◆ setMean()

template<typename RealType>
NormalNoiseSource& NormalNoiseSource< RealType >::setMean ( RealType  mean)
inline

Set the current mean for normal noise generation.

NOTICE this will update the normal random distribution used to generate noise. USE WITH CAUTION If updating both mean and standard deviation at the same time is desired, it is strongly recommended to use the configureNormalNoise function directly instead

Parameters
meanNew mean for normal noise generation
Returns
The NormalNoiseSource reference in a fluent programming fashion
See also
configureNormalNoise

◆ setStdev()

template<typename RealType>
NormalNoiseSource& NormalNoiseSource< RealType >::setStdev ( RealType  stdev)
inline

Set the current standard deviation for normal noise generation.

NOTICE this will update the normal random distribution used to generate noise. USE WITH CAUTION If updating both mean and standard deviation at the same time is desired, it is strongly recommended to use the configureNormalNoise function directly instead

Parameters
stdevNew standard deviation for normal noise generation
Returns
The NormalNoiseSource reference in fluent programming fashion
See also
configureNormalNoise

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