Helios++
Helios software for LiDAR simulations
WarehouseScanningPulseProcess Class Reference

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

#include <WarehouseScanningPulseProcess.h>

Inheritance diagram for WarehouseScanningPulseProcess:
Collaboration diagram for WarehouseScanningPulseProcess:

Public Member Functions

 WarehouseScanningPulseProcess (std::shared_ptr< Scanner > scanner, PulseTaskDropper &dropper, PulseWarehouseThreadPool &pool, RandomnessGenerator< double > &randGen1, RandomnessGenerator< double > &randGen2, UniformNoiseSource< double > &intersectionHandlingNoiseSource)
 Constructor for warehouse scanning pulse process. More...
 
void handlePulseComputation (SimulatedPulse const &sp) override
 Implementation of handle pulse computation method for the pair budding task dropper and pulse warehouse thread pool. More...
 
void onLegComplete () override
 Handle sequential computation of a chunk of pulses through task dropper.
 
void onSimulationFinished () override
 Handle shutdown of warehouse thread pool (final join) 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 handlePulseComputationParallel (SimulatedPulse const &sp)
 Handle parallel computation of scanning pulses using a warehouse of task-chunks based strategy. More...
 

Protected Attributes

PulseTaskDropperdropper
 The task dropper used to handle job chunks.
 
PulseWarehouseThreadPoolpool
 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...
 
- 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 warehouse thread pool based on an asynchronous warehouse thread pool.

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

Constructor & Destructor Documentation

◆ WarehouseScanningPulseProcess()

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

Constructor for warehouse 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 WarehouseScanningPulseProcess::handlePulseComputation ( SimulatedPulse const &  sp)
inlineoverridevirtual

◆ handlePulseComputationParallel()

void WarehouseScanningPulseProcess::handlePulseComputationParallel ( SimulatedPulse const &  sp)
protectedvirtual

Handle parallel computation of scanning pulses using a warehouse of task-chunks based strategy.

See also
WarehouseScanningPulseProcess::handlePulseComputation
WarehouseScanningPulseProcess::handlePulseComputationSequential

◆ handlePulseComputationSequential()

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

◆ onSimulationFinished()

void WarehouseScanningPulseProcess::onSimulationFinished ( )
overridevirtual

Handle shutdown of warehouse thread pool (final join)

See also
WarehouseThreadPool::finish
WarehouseThreadPool::finalJoin

Reimplemented from ScanningPulseProcess.

Member Data Documentation

◆ apMatrix

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

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

See also
MarquardtFitter::ALPHA_PRIME

◆ intersectionHandlingNoiseSource

UniformNoiseSource<double>& WarehouseScanningPulseProcess::intersectionHandlingNoiseSource
protected

Uniform noise source for single thread mode.

See also
Scanner::intersectionHandlingNoiseSource

◆ randGen1

RandomnessGenerator<double>& WarehouseScanningPulseProcess::randGen1
protected

First randomness generator for single thread mode.

See also
Scanner::randGen1

◆ randGen2

RandomnessGenerator<double>& WarehouseScanningPulseProcess::randGen2
protected

Second randomness generator for single thread mode.

See also
Scanner::randGen2

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