Helios++
Helios software for LiDAR simulations
|
Class for uniform noise handling. More...
#include <UniformNoiseSource.h>
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... | |
UniformNoiseSource & | setMin (RealType min) |
Set the current minimum for uniform noise generation. More... | |
RealType | getMax () |
Obtain the current maximum for uniform noise generation. More... | |
UniformNoiseSource & | setMax (RealType max) |
Set the current maximum for uniform noise generation. More... | |
UniformNoiseSource & | configureUniformNoise (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... | |
![]() | |
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 | 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. | |
![]() | |
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, UniformNoiseSource< _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 uniform noise handling.
RealType | Type for the noise. Should be a decimal type, for instance float or double. |
|
inlineexplicit |
Create a UniformNoiseSource using received RandomnessGenerator.
rg | RandomnessGenerator used to generate normal noise |
|
inlineexplicit |
Create a UniformNoiseSource using received seed.
seed | Seed to build the normal noise generator |
|
inlineexplicit |
Create default UniformNoiseSource.
UniformNoiseSource< RealType > & UniformNoiseSource< RealType >::configureUniformNoise | ( | RealType | min, |
RealType | max | ||
) |
Configure uniform noise.
min | Min possible value for uniform noise |
max | Max possible value for uniform noise |
|
inline |
Obtain the current maximum for uniform noise generation.
|
inline |
Obtain the current minimum for uniform noise generation.
|
inlineoverridevirtual |
Implements RandomNoiseSource< RealType >.
|
inlineoverridevirtual |
Compute next uniform noise value from current random uniform distribution.
Implements NoiseSource< RealType >.
|
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
max | New maximum for uniform noise generation |
|
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
min | New minimum for uniform noise generation |