Helios++
Helios software for LiDAR simulations
|
Class for normal noise handling. More...
#include <NormalNoiseSource.h>
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... | |
NormalNoiseSource & | setMean (RealType mean) |
Set the current mean for normal noise generation. More... | |
RealType | getStdev () |
Obtain the current standard deviation for normal noise generation. More... | |
NormalNoiseSource & | setStdev (RealType stdev) |
Set the current standard deviation for normal noise generation. More... | |
NormalNoiseSource & | configureNormalNoise (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... | |
![]() | |
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. | |
![]() | |
void | build () |
Common behavior for all NoiseSource constructors. | |
double | getClipMin () |
Obtain the clip min value. More... | |
NoiseSource & | setClipMin (RealType clipMin) |
Set the clip min value. More... | |
double | getClipMax () |
Obtain the clip max value. More... | |
NoiseSource & | setClipMax (RealType clipMax) |
Set the clip max value. More... | |
bool | isClipEnabled () |
Check if clipping is enabled or not. More... | |
NoiseSource & | setClipEnabled (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... | |
NoiseSource & | setFixedLifespan (unsigned long fixedLifespan) |
Set the fixed value lifespan. More... | |
unsigned long | getFixedValueRemainingUses () |
Obtain the remaining uses of current fixed value. More... | |
NoiseSource & | setFixedValueRemainingUses (unsigned long remainingUses) |
Update remaining uses count for current fixed value. More... | |
NoiseSource & | fixedRenew () |
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 | |
![]() | |
RandomnessGenerator< RealType > | rg |
RandomnessGenerator to be used to generate random noise. | |
![]() | |
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 | |
![]() | |
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... | |
Class for normal noise handling.
RealType | Type for the noise. Should be a decimal type, for instance float or double. |
|
inlineexplicit |
Create a NormalNoiseSource using received RandomnessGenerator.
rg | RandomnessGenerator used to generate normal noise |
|
inlineexplicit |
Create a NormalNoiseSource using received seed.
seed | Seed to build the normal noise generator |
|
inlineexplicit |
Create default NormalNoiseSource.
NormalNoiseSource< RealType > & NormalNoiseSource< RealType >::configureNormalNoise | ( | RealType | mean, |
RealType | stdev | ||
) |
Configure normal noise.
mean | The mean for the normal noise |
stdev | The standard deviation for the normal noise |
|
inline |
Obtain the current mean for normal noise generation.
|
inlineoverridevirtual |
Implements RandomNoiseSource< RealType >.
|
inline |
Obtain the current standard deviation for normal noise generation.
|
inlineoverridevirtual |
Compute next normal nosie value from current random normal distribution.
Implements NoiseSource< RealType >.
|
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
mean | New mean for normal noise generation |
|
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
stdev | New standard deviation for normal noise generation |