Helios++
Helios software for LiDAR simulations
BuddingScanningPulseProcess Class Reference

Class implementing a scanning pulse process which works with a pulse task dropper based on budding task dropper and a pulse thread pool based on an asynchronous resource thread pool. More...

#include <BuddingScanningPulseProcess.h>

Inheritance diagram for BuddingScanningPulseProcess:
Collaboration diagram for BuddingScanningPulseProcess:

Public Member Functions

 BuddingScanningPulseProcess (std::shared_ptr< Scanner > scanner, PulseTaskDropper &dropper, PulseThreadPool &pool, RandomnessGenerator< double > &randGen1, RandomnessGenerator< double > &randGen2, UniformNoiseSource< double > &intersectionHandlingNoiseSource)
 Constructor for budding scanning pulse process. More...
 
void handlePulseComputation (SimulatedPulse const &sp) override
 Implementation of handle pulse computation method for the pair budding task dropper and pulse thread pool. More...
 
void onLegComplete () override
 Handle sequential computation of a chunk of pulses through task dropper.
 
void onSimulationFinished () override
 Handle closing of output file stream for budding metrics when it is called with -DBUDDING_METRICS=1. More...
 
- Public Member Functions inherited from ScanningPulseProcess
 ScanningPulseProcess (std::shared_ptr< Scanner > scanner)
 Default constructor for scanning pulse process.
 
std::shared_ptr< ScannergetScanner () const
 Obtain the scanner. More...
 
bool isWriteWaveform () const
 Obtain the scanner's write waveform flag. More...
 
bool isCalcEchowidth () const
 Obtain the scanner's calc echowidth flag. More...
 
std::shared_ptr< std::vector< Measurement > > & getAllMeasurements () const
 Obtain the scanner's all measurements vector. More...
 
std::shared_ptr< std::mutex > & getAllMeasurementsMutex () const
 Obtain the scanner's all measurements mutex. More...
 
std::shared_ptr< std::vector< Measurement > > & getCycleMeasurements () const
 Obtain the scanner's cycle measurements vector. More...
 
std::shared_ptr< std::mutex > & getCycleMeasurementsMutex () const
 Obtain the scanner's cycle measurements mutex. More...
 

Protected Member Functions

virtual void handlePulseComputationSequential (SimulatedPulse const &sp)
 Handle sequential computation of scanning pulses. More...
 
virtual void handlePulseComputationParallelDynamic (SimulatedPulse const &sp)
 Handle parallel computation of scanning pulses using a dynamic chunk-size based strategy. More...
 
virtual void handlePulseComputationParallelStatic (SimulatedPulse const &sp)
 Handle a parallel computation of scanning pulse using a static chunk-size based strategy. More...
 

Protected Attributes

PulseTaskDropperdropper
 The task dropper used to handle job chunks.
 
PulseThreadPoolpool
 Thread pool to be used to handle multi threading pulse computation.
 
std::function< void(SimulatedPulse const &sp)> handler
 Pulse computation handling function. It will be configured at construction depending on thread pool size to assign sequential or parallel computing method as corresponds.
 
std::vector< std::vector< double > > apMatrix
 Alpha-Prime Matrix for sequential executions (either single thread or main thread workload) More...
 
RandomnessGenerator< double > & randGen1
 First randomness generator for single thread mode. More...
 
RandomnessGenerator< double > & randGen2
 Second randomness generator for single thread mode. More...
 
UniformNoiseSource< double > & intersectionHandlingNoiseSource
 Uniform noise source for single thread mode. More...
 
long lastIdleNanos = 0
 Length in nanoseconds of the last idle thread time interval.
 
long const idleTh = 100000
 Threshold so idle times which are below its value are not considered. Instead, they are discarded as a non trustable measurement. It is given in nanoseconds.
 
long const idleEps = 100000
 Tolerance so idle times differences below this threshold will not change sign of budding task dropper and neither last idle time. It is given in nanoseconds.
 
TimeWatcher idleTimer
 Scan idle timer to work with thread pool idle time. More...
 
- Protected Attributes inherited from ScanningPulseProcess
PulseTaskFactory ptf
 The pulse task factory to build pulse tasks. More...
 
std::shared_ptr< Scannerscanner
 The scanner emitting the pulses. More...
 

Detailed Description

Class implementing a scanning pulse process which works with a pulse task dropper based on budding task dropper and a pulse thread pool based on an asynchronous resource thread pool.

Author
Alberto M. Esmoris Pena
Version
1.0
See also
PulseTaskDropper
PulseThreadPool

Constructor & Destructor Documentation

◆ BuddingScanningPulseProcess()

BuddingScanningPulseProcess::BuddingScanningPulseProcess ( std::shared_ptr< Scanner scanner,
PulseTaskDropper dropper,
PulseThreadPool pool,
RandomnessGenerator< double > &  randGen1,
RandomnessGenerator< double > &  randGen2,
UniformNoiseSource< double > &  intersectionHandlingNoiseSource 
)

Constructor for budding scanning pulse process.

Parameters
dropperThe task dropper used to handle job chunks
poolThread pool to be used to handle multi threading pulse computation
randGen1First randomness generator for single thread
randGen2Second randomness generator for single thread mode
intersectionHandlingNoiseSourceUniform noise source for single thread mode
See also
ScanningPulseProcess::ScanningPulseProcess

Member Function Documentation

◆ handlePulseComputation()

void BuddingScanningPulseProcess::handlePulseComputation ( SimulatedPulse const &  sp)
inlineoverridevirtual

Implementation of handle pulse computation method for the pair budding task dropper and pulse thread pool.

See also
ScanningPulseProcess::handlePulseComputation
PulseTaskDropper
PulseThreadPool
BuddingScanningPulseProcess::handlePulseComputationSequential
BuddingScanningPulseProcess::handlePulseComputationParallel

Implements ScanningPulseProcess.

◆ handlePulseComputationParallelDynamic()

void BuddingScanningPulseProcess::handlePulseComputationParallelDynamic ( SimulatedPulse const &  sp)
protectedvirtual

◆ handlePulseComputationParallelStatic()

void BuddingScanningPulseProcess::handlePulseComputationParallelStatic ( SimulatedPulse const &  sp)
protectedvirtual

◆ handlePulseComputationSequential()

void BuddingScanningPulseProcess::handlePulseComputationSequential ( SimulatedPulse const &  sp)
protectedvirtual

◆ onSimulationFinished()

void BuddingScanningPulseProcess::onSimulationFinished ( )
overridevirtual

Handle closing of output file stream for budding metrics when it is called with -DBUDDING_METRICS=1.

See also
ofsBudding

Reimplemented from ScanningPulseProcess.

Member Data Documentation

◆ apMatrix

std::vector<std::vector<double> > BuddingScanningPulseProcess::apMatrix
protected

Alpha-Prime Matrix for sequential executions (either single thread or main thread workload)

See also
MarquardtFitter::ALPHA_PRIME

◆ idleTimer

TimeWatcher BuddingScanningPulseProcess::idleTimer
protected

Scan idle timer to work with thread pool idle time.

See also
PulseThreadPool::idleTimer

◆ intersectionHandlingNoiseSource

UniformNoiseSource<double>& BuddingScanningPulseProcess::intersectionHandlingNoiseSource
protected

Uniform noise source for single thread mode.

See also
Scanner::intersectionHandlingNoiseSource

◆ randGen1

RandomnessGenerator<double>& BuddingScanningPulseProcess::randGen1
protected

First randomness generator for single thread mode.

See also
Scanner::randGen1

◆ randGen2

RandomnessGenerator<double>& BuddingScanningPulseProcess::randGen2
protected

Second randomness generator for single thread mode.

See also
Scanner::randGen2

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