6 #include <SurveyPlayback.h>
8 #include <noise/RandomnessGenerator.h>
9 #include <PyPlatformWrapper.h>
10 #include <PySceneWrapper.h>
11 #include <PyHeliosOutputWrapper.h>
12 #include <PyHeliosException.h>
13 #include <XmlSurveyLoader.h>
14 #include <PyScannerWrapper.h>
28 std::shared_ptr<XmlSurveyLoader> xmlreader =
nullptr;
32 bool finished =
false;
33 size_t numThreads = 0;
34 size_t callbackFrequency = 0;
35 std::string surveyPath =
"NULL";
36 std::string assetsPath =
"NULL";
37 std::string outputPath =
"NULL";
38 std::shared_ptr<Survey> survey =
nullptr;
39 std::shared_ptr<SurveyPlayback> playback =
nullptr;
40 boost::thread * thread =
nullptr;
41 std::shared_ptr<PySimulationCycleCallback> callback =
nullptr;
42 std::string fixedGpsTimeStart =
"";
43 bool lasOutput =
false;
45 bool zipOutput =
false;
46 bool splitByChannel =
false;
47 double lasScale = 0.0001;
48 std::shared_ptr<PulseThreadPoolInterface> pulseThreadPool;
51 size_t kdtSAHLossNodes = 32;
52 int parallelizationStrategy = 1;
54 int warehouseFactor = 1;
56 bool finalOutput =
true;
57 bool exportToFile =
true;
72 std::string surveyPath,
73 std::string assetsPath =
"assets/",
74 std::string outputPath =
"output/",
75 size_t numThreads = 0,
76 bool lasOutput =
false,
78 bool zipOutput =
false,
79 bool splitByChannel =
false,
82 size_t kdtSAHLossNodes = 32,
83 int parallelizationStrategy = 1,
85 int warehouseFactor = 1
167 Leg &
getLeg(
int index) {
return *(survey->legs[index]);}
174 {survey->legs.erase(survey->legs.begin() + index);}
228 {this->callbackFrequency = callbackFrequency;}
233 {playback->setSimFrequency(simFrequency);}
248 playback->callback =
nullptr;
249 survey->scanner->cycleMeasurements =
nullptr;
250 survey->scanner->cycleMeasurementsMutex =
nullptr;
252 std::string getFixedGpsTimeStart(){
return fixedGpsTimeStart;}
253 void setFixedGpsTimeStart(std::string
const fixedGpsTimeStart)
254 {this->fixedGpsTimeStart = fixedGpsTimeStart;}
255 bool getLasOutput(){
return lasOutput;}
256 void setLasOutput(
double lasOutput_){
257 if(started)
throw PyHeliosException(
258 "Cannot modify LAS output flag for already started simulations."
260 this->lasOutput = lasOutput_;
263 bool getLas10(){
return las10;}
264 void setLas10(
double las10_){
265 if(started)
throw PyHeliosException(
266 "Cannot modify LAS v1.0 output flag for already started "
269 this->las10 = las10_;
272 bool getZipOutput(){
return zipOutput;}
273 void setZipOutput(
bool zipOutput_){
274 if(started)
throw PyHeliosException(
275 "Cannot modify ZIP output flag for already started simulations."
277 this->zipOutput = zipOutput_;
279 bool getSplitByChannel(){
return splitByChannel;}
280 void setSplitByChannel(
bool splitByChannel_){
281 if(started)
throw PyHeliosException(
282 "Cannot modify splitByChannel flag for already started "
285 this->splitByChannel = splitByChannel_;
288 double getLasScale(){
return lasScale;}
289 void setLasScale(
double const lasScale){
290 if(started)
throw PyHeliosException(
291 "Cannot modify LAS scale for already started simulations."
293 this->lasScale = lasScale;
296 int getKDTFactory(){
return kdtFactory;}
297 void setKDTFactory(
int kdtFactory){
298 if(started)
throw PyHeliosException(
299 "Cannot modify KDT factory for already started simulations."
301 this->kdtFactory = kdtFactory;
304 size_t getKDTJobs(){
return kdtJobs;}
305 void setKDTJobs(
size_t kdtJobs){
306 if(started)
throw PyHeliosException(
307 "Cannot modify KDT jobs for already started simulations."
309 this->kdtJobs = kdtJobs;
312 size_t getKDTSAHLossNodes(){
return kdtSAHLossNodes;}
313 void setKDTSAHLossNodes(
size_t kdtSAHLossNodes){
314 if(started)
throw PyHeliosException(
315 "Cannot modify KDT SAH loss nodes for already started simulations."
317 this->kdtSAHLossNodes = kdtSAHLossNodes;
320 int getParallelizationStrategy(){
return parallelizationStrategy;}
321 void setParallelizationStrategy(
int parallelizationStrategy){
322 if(started)
throw PyHeliosException(
323 "Cannot modify parallelization strategy for already started "
326 this->parallelizationStrategy = parallelizationStrategy;
329 int getChunkSize(){
return chunkSize;}
330 void setChunkSize(
int chunkSize){
331 if(started)
throw PyHeliosException(
332 "Cannot modify chunk size for already started simulations."
334 this->chunkSize = chunkSize;
337 int getWarehouseFactor(){
return warehouseFactor;}
338 void setWarehouseFactor(
int warehouseFactor){
339 if(started)
throw PyHeliosException(
340 "Cannot modify warehouse factor for already started simulations."
342 this->warehouseFactor = warehouseFactor;
372 PyHeliosOutputWrapper *
join();
386 bool legNoiseDisabled =
false,
387 bool rebuildScene =
false,
388 bool writeWaveform =
false,
389 bool calcEchowidth =
false,
390 bool fullWaveNoise =
false,
391 bool platformNoiseDisabled =
true
393 void addRotateFilter(
400 void addScaleFilter(
double scaleFactor, std::string partId);
401 void addTranslateFilter(
double x,
double y,
double z, std::string partId);
411 PyHeliosSimulation * copy();
Class representing a survey leg.
Definition: Leg.h:17
Class representing a Helios++ survey.
Definition: Survey.h:13
Definition: PyHeliosSimulation.h:24
std::string getAssetsPath()
Obtain the path to assets directory used by the simulation.
Definition: PyHeliosSimulation.h:132
PyScannerWrapper * getScanner()
Obtain the scanner used by the simulation.
Definition: PyHeliosSimulation.h:145
PyScanningStripWrapper * newScanningStrip(std::string const &stripId)
Create a new empty scanning strip (with no legs)
Definition: PyHeliosSimulation.cpp:79
Leg & getLeg(int index)
Obtain leg at given index.
Definition: PyHeliosSimulation.h:167
int getNumLegs()
Obtain the number of legs.
Definition: PyHeliosSimulation.h:161
bool isStarted()
Check if the simulation has been started or not.
Definition: PyHeliosSimulation.h:96
void resume()
Resume the simulation if possible. Otherwise, PyHeliosException will be thrown.
Definition: PyHeliosSimulation.cpp:189
bool isStopped()
Check if the simulation has been stopped or not.
Definition: PyHeliosSimulation.h:108
void loadSurvey(bool legNoiseDisabled=false, bool rebuildScene=false, bool writeWaveform=false, bool calcEchowidth=false, bool fullWaveNoise=false, bool platformNoiseDisabled=true)
Load a survey XML file.
Definition: PyHeliosSimulation.cpp:273
PyPlatformWrapper * getPlatform()
Obtain the platform used by the simulation.
Definition: PyHeliosSimulation.h:152
std::string getSurveyPath()
Obtain the survey path used by the simulation.
Definition: PyHeliosSimulation.h:126
void setSimFrequency(size_t const simFrequency)
Set the simulation frequency.
Definition: PyHeliosSimulation.h:232
bool isFinished()
Check if the simulation has finished or not.
Definition: PyHeliosSimulation.cpp:209
bool isRunning()
Check if the simulation is running or not.
Definition: PyHeliosSimulation.cpp:213
size_t getDynSceneStep()
Get the step interval for the dynamic scene. Notice this method will throw an exception if the scene ...
Definition: PyHeliosSimulation.h:212
void setDynSceneStep(size_t const stepInterval)
Set the step interval for the dynamic scene. Notice this method will throw an exception if the scene ...
Definition: PyHeliosSimulation.h:238
Leg & newLeg(int index)
Create a new empty leg.
Definition: PyHeliosSimulation.cpp:67
void buildPulseThreadPool()
Build the pulse thread pool to be used by the simulation.
Definition: PyHeliosSimulation.cpp:325
bool assocLegWithScanningStrip(Leg &leg, PyScanningStripWrapper *strip)
Associate given leg with given strip.
Definition: PyHeliosSimulation.cpp:87
PyHeliosOutputWrapper * join()
Cause caller thread to wait until simulation has finished.
Definition: PyHeliosSimulation.cpp:218
bool isPaused()
Check if the simulation has been paused or not.
Definition: PyHeliosSimulation.h:102
size_t getNumThreads()
Obtain the number of threads.
Definition: PyHeliosSimulation.h:219
void start()
Start the simulation if possible. Otherwise, PyHeliosException will be thrown.
Definition: PyHeliosSimulation.cpp:110
void removeLeg(int index)
Remove leg at given index.
Definition: PyHeliosSimulation.h:173
void clearCallback()
Clear simulation callback so it will no longer be invoked.
Definition: PyHeliosSimulation.h:247
std::shared_ptr< DynScene > _getDynScene()
Obtain scene as DynScene if possible.
Definition: PyHeliosSimulation.cpp:387
Survey & getSurvey()
Obtain the survey used by the simulation.
Definition: PyHeliosSimulation.h:139
void setCallbackFrequency(size_t const callbackFrequency)
Set the callback frequency.
Definition: PyHeliosSimulation.h:227
void stop()
Stop the simulation if possible. Otherwise, PyHeliosException will be thrown.
Definition: PyHeliosSimulation.cpp:174
size_t getSimFrequency()
Obtain simulation frequency.
Definition: PyHeliosSimulation.h:207
void setNumThreads(size_t numThreads)
Set the number of threads.
Definition: PyHeliosSimulation.h:223
size_t getCallbackFrequency()
Obtain callback frequency.
Definition: PyHeliosSimulation.h:202
void pause()
Pause the simulation if possible. Otherwise, PyHeliosException will be thrown.
Definition: PyHeliosSimulation.cpp:159
void setCallback(PyObject *pyCallback)
Set the simulation callback to specified python object functor.
Definition: PyHeliosSimulation.cpp:362
Wrapper for Scanner class.
Definition: PyScannerWrapper.h:28
Wrapper for ScanningStrip class.
Definition: PyScanningStripWrapper.h:17
Wrapper for Scene.
Definition: PySceneWrapper.h:26