Helios++
Helios software for LiDAR simulations
RandomNoiseSource< RealType > Class Template Referenceabstract

Abstract class for random noise handling. More...

#include <RandomNoiseSource.h>

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

Public Member Functions

 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.
 
virtual std::string getRandomNoiseType ()=0
 Obtain the random noise type. More...
 
- 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...
 
virtual RealType noiseFunction ()=0
 Function which computes noise values. More...
 

Protected Attributes

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, RandomNoiseSource< _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 RandomNoiseSource< RealType >

Abstract class for random noise handling.

Author
Alberto M. Esmoris Pena
Version
1.0
Template Parameters
RealTypeType for the noise.

Constructor & Destructor Documentation

◆ RandomNoiseSource() [1/2]

template<typename RealType>
RandomNoiseSource< RealType >::RandomNoiseSource ( RandomnessGenerator< RealType > const &  rg)
inlineexplicit

Create a RandomNoiseSource using received RandomnessGenerator.

Parameters
rgRandomnessGenerator used to generate noise

◆ RandomNoiseSource() [2/2]

template<typename RealType>
RandomNoiseSource< RealType >::RandomNoiseSource ( std::string const &  seed)
inlineexplicit

Create a RandomNoiseSource using received seed.

Parameters
seedSeed to build the RandomnessGenerator
See also
RandomnessGenerator

Member Function Documentation

◆ getRandomNoiseType()

template<typename RealType>
virtual std::string RandomNoiseSource< RealType >::getRandomNoiseType ( )
pure virtual

Obtain the random noise type.

Returns
Noise type

Implemented in UniformNoiseSource< RealType >, UniformNoiseSource< double >, and NormalNoiseSource< RealType >.


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