Helios++
Helios software for LiDAR simulations
|
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>
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... | |
![]() | |
ScanningPulseProcess (std::shared_ptr< Scanner > scanner) | |
Default constructor for scanning pulse process. | |
std::shared_ptr< Scanner > | getScanner () 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 | |
PulseTaskDropper & | dropper |
The task dropper used to handle job chunks. | |
PulseThreadPool & | pool |
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... | |
![]() | |
PulseTaskFactory | ptf |
The pulse task factory to build pulse tasks. More... | |
std::shared_ptr< Scanner > | scanner |
The scanner emitting the pulses. More... | |
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.
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.
dropper | The task dropper used to handle job chunks |
pool | Thread pool to be used to handle multi threading pulse computation |
randGen1 | First randomness generator for single thread |
randGen2 | Second randomness generator for single thread mode |
intersectionHandlingNoiseSource | Uniform noise source for single thread mode |
|
inlineoverridevirtual |
Implementation of handle pulse computation method for the pair budding task dropper and pulse thread pool.
Implements ScanningPulseProcess.
|
protectedvirtual |
Handle parallel computation of scanning pulses using a dynamic chunk-size based strategy.
|
protectedvirtual |
Handle a parallel computation of scanning pulse using a static chunk-size based strategy.
|
protectedvirtual |
Handle sequential computation of scanning pulses.
|
overridevirtual |
Handle closing of output file stream for budding metrics when it is called with -DBUDDING_METRICS=1.
Reimplemented from ScanningPulseProcess.
|
protected |
Alpha-Prime Matrix for sequential executions (either single thread or main thread workload)
|
protected |
Scan idle timer to work with thread pool idle time.
|
protected |
Uniform noise source for single thread mode.
|
protected |
First randomness generator for single thread mode.
|
protected |
Second randomness generator for single thread mode.