Helios++
Helios software for LiDAR simulations
WarehouseScanningPulseProcess.h
1 #pragma once
2 
3 #include <scanner/ScanningPulseProcess.h>
4 #include <PulseTaskDropper.h>
5 #include <PulseWarehouseThreadPool.h>
6 
7 #include <memory>
8 
19 #ifdef DATA_ANALYTICS
20 public:
21 #else
22 protected:
23 #endif
24  // *** ATTRIBUTES *** //
25  // ******************** //
40  std::function<void(SimulatedPulse const &sp)> handler;
41 
47  std::vector<std::vector<double>> apMatrix;
63 
64 public:
65  // *** CONSTRUCTION / DESTRUCTION *** //
66  // ************************************ //
79  std::shared_ptr<Scanner> scanner,
85  );
86  virtual ~WarehouseScanningPulseProcess() = default;
87 
88  // *** PULSE COMPUTATION *** //
89  // *************************** //
99  inline void handlePulseComputation(SimulatedPulse const &sp) override {
100  this->handler(sp);
101  }
106  void onLegComplete() override;
112  void onSimulationFinished() override;
113 
114 protected:
115  // *** INNER PULSE COMPUTATION *** //
116  // ********************************* //
122  virtual void handlePulseComputationSequential(SimulatedPulse const &sp);
129  virtual void handlePulseComputationParallel(SimulatedPulse const &sp);
130 };
Class implementing a task dropper to deal with pulse tasks.
Definition: PulseTaskDropper.h:27
Class implementing a warehouse thread pool to deal with pulse tasks.
Definition: PulseWarehouseThreadPool.h:23
Class defining the scanning pulse process interface.
Definition: ScanningPulseProcess.h:18
std::shared_ptr< Scanner > scanner
The scanner emitting the pulses.
Definition: ScanningPulseProcess.h:31
Class representing a simulated laser pulse.
Definition: SimulatedPulse.h:10
Class implementing a scanning pulse process which works with a pulse task dropper based on budding ta...
Definition: WarehouseScanningPulseProcess.h:18
RandomnessGenerator< double > & randGen2
Second randomness generator for single thread mode.
Definition: WarehouseScanningPulseProcess.h:57
PulseTaskDropper & dropper
The task dropper used to handle job chunks.
Definition: WarehouseScanningPulseProcess.h:29
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.
Definition: WarehouseScanningPulseProcess.cpp:7
std::function< void(SimulatedPulse const &sp)> handler
Pulse computation handling function. It will be configured at construction depending on thread pool s...
Definition: WarehouseScanningPulseProcess.h:40
UniformNoiseSource< double > & intersectionHandlingNoiseSource
Uniform noise source for single thread mode.
Definition: WarehouseScanningPulseProcess.h:62
void handlePulseComputation(SimulatedPulse const &sp) override
Implementation of handle pulse computation method for the pair budding task dropper and pulse warehou...
Definition: WarehouseScanningPulseProcess.h:99
virtual void handlePulseComputationParallel(SimulatedPulse const &sp)
Handle parallel computation of scanning pulses using a warehouse of task-chunks based strategy.
Definition: WarehouseScanningPulseProcess.cpp:76
virtual void handlePulseComputationSequential(SimulatedPulse const &sp)
Handle sequential computation of scanning pulses.
Definition: WarehouseScanningPulseProcess.cpp:63
void onSimulationFinished() override
Handle shutdown of warehouse thread pool (final join)
Definition: WarehouseScanningPulseProcess.cpp:57
PulseWarehouseThreadPool & pool
Thread pool to be used to handle multi threading pulse computation.
Definition: WarehouseScanningPulseProcess.h:34
void onLegComplete() override
Handle sequential computation of a chunk of pulses through task dropper.
Definition: WarehouseScanningPulseProcess.cpp:39
std::vector< std::vector< double > > apMatrix
Alpha-Prime Matrix for sequential executions (either single thread or main thread workload)
Definition: WarehouseScanningPulseProcess.h:47
RandomnessGenerator< double > & randGen1
First randomness generator for single thread mode.
Definition: WarehouseScanningPulseProcess.h:52