SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
conductor.h
Go to the documentation of this file.
1#ifndef CONDUCTOR_H
2#define CONDUCTOR_H
3
4#include <string>
5#include <map>
6#include <vector>
7#include <memory>
8
9#include "sourcesinkdata.h"
10#include "GA.h"
11#include "MCMC.h"
12#include "results.h"
13#include "analysishost.h"
14
15class QString;
16
39{
40public:
46 explicit Conductor(AnalysisHost* host);
47
70 bool Execute(const std::string& command, std::map<std::string, std::string> arguments);
71
76 SourceSinkData* Data() { return data; }
77
82 void SetData(SourceSinkData* _data) { data = _data; }
83
97 Results* GetResults() { return new Results(results); }
98
103 void SetWorkingFolder(const QString& wf) { workingfolder = wf; }
104
109 QString WorkingFolder() const { return workingfolder; }
110
125
137 bool CheckNegativeElements(std::map<std::string, std::vector<std::string>> negative_elements);
138
139private:
141 std::unique_ptr<CGA<SourceSinkData>> GA;
142 std::unique_ptr<CMCMC<SourceSinkData>> MCMC;
146
161 bool ExecuteGA(const std::map<std::string, std::string>& arguments);
162
176 bool ExecuteGA_FixedProfile(const std::map<std::string, std::string>& arguments);
177
191 bool ExecuteGA_NoTargets(const std::map<std::string, std::string>& arguments);
192
207 bool ExecuteLevenbergMarquardt(const std::map<std::string, std::string>& arguments);
208
222 bool ExecuteLevenbergMarquardtBatch(const std::map<std::string, std::string>& arguments);
223
238 bool ExecuteOMSizeCorrect(const std::map<std::string, std::string>& arguments);
239
256 bool ExecuteMLR(const std::map<std::string, std::string>& arguments);
257
269 bool ExecuteCovarianceMatrix(const std::map<std::string, std::string>& arguments);
270
287 bool ExecuteCorrelationMatrix(const std::map<std::string, std::string>& arguments);
288
306 bool ExecuteDFA(const std::map<std::string, std::string>& arguments);
307
324 bool ExecuteDFAOnevsRest(const std::map<std::string, std::string>& arguments);
341 bool ExecuteDFAM(const std::map<std::string, std::string>& arguments);
342
361 bool ExecuteSDFA(const std::map<std::string, std::string>& arguments);
362
381 bool ExecuteSDFAM(const std::map<std::string, std::string>& arguments);
382
400 bool ExecuteSDFAOnevsRest(const std::map<std::string, std::string>& arguments);
401
415 bool ExecuteKolmogorovSmirnov(const std::map<std::string, std::string>& arguments);
416
431 bool ExecuteKolmogorovSmirnovIndividual(const std::map<std::string, std::string>& arguments);
432
449 bool ExecuteCMBBayesian(const std::map<std::string, std::string>& arguments);
450
465 bool ExecuteCMBBayesianBatch(const std::map<std::string, std::string>& arguments);
466
483 bool ExecuteTestCMBBayesian(const std::map<std::string, std::string>& arguments);
484
503 bool ExecuteDistributionFitting(const std::map<std::string, std::string>& arguments);
504
521 bool ExecuteBracketingAnalysis(const std::map<std::string, std::string>& arguments);
522
539 bool ExecuteBracketingAnalysisBatch(const std::map<std::string, std::string>& arguments);
540
553 bool ExecuteBoxCox(const std::map<std::string, std::string>& arguments);
554
571 bool ExecuteOutlierAnalysis(const std::map<std::string, std::string>& arguments);
572
592 bool ExecuteEDP(const std::map<std::string, std::string>& arguments);
593
612 bool ExecuteEDPM(const std::map<std::string, std::string>& arguments);
613
635 bool ExecuteANOVA(const std::map<std::string, std::string>& arguments);
636
655 bool ExecuteErrorAnalysis(const std::map<std::string, std::string>& arguments);
656
674 bool ExecuteSourceVerify(const std::map<std::string, std::string>& arguments);
675
693 bool ExecuteAutoSelect(const std::map<std::string, std::string>& arguments);
694};
695
696#endif // CONDUCTOR_H
Abstract environment that an analysis runs inside.
Orchestrates execution of source apportionment analysis operations.
Definition conductor.h:39
bool ExecuteOutlierAnalysis(const std::map< std::string, std::string > &arguments)
Executes outlier detection analysis for a source/target group.
bool ExecuteTestCMBBayesian(const std::map< std::string, std::string > &arguments)
Executes MCMC test with a simple analytical model.
bool ExecuteCMBBayesian(const std::map< std::string, std::string > &arguments)
Executes Bayesian Chemical Mass Balance using MCMC sampling.
bool ExecuteDFAM(const std::map< std::string, std::string > &arguments)
Executes multi-way Discriminant Function Analysis across all groups.
bool ExecuteDFA(const std::map< std::string, std::string > &arguments)
Executes Discriminant Function Analysis between two groups.
bool ExecuteSDFAM(const std::map< std::string, std::string > &arguments)
Executes multi-way Stepwise Discriminant Function Analysis across all groups.
bool ExecuteBoxCox(const std::map< std::string, std::string > &arguments)
Calculates optimal Box-Cox transformation parameters.
bool ExecuteKolmogorovSmirnovIndividual(const std::map< std::string, std::string > &arguments)
Executes Kolmogorov-Smirnov test for a single constituent in a group.
bool CheckNegativeElements(SourceSinkData *data=nullptr)
Validates that all element concentrations are non-negative.
bool ExecuteCMBBayesianBatch(const std::map< std::string, std::string > &arguments)
Executes Bayesian Chemical Mass Balance across all target samples.
bool ExecuteAutoSelect(const std::map< std::string, std::string > &arguments)
Executes automatic element selection based on discriminant power.
bool ExecuteSDFA(const std::map< std::string, std::string > &arguments)
Executes Stepwise Discriminant Function Analysis between two groups.
Results * GetResults()
Creates and returns a heap-allocated copy of current results.
Definition conductor.h:97
bool ExecuteBracketingAnalysisBatch(const std::map< std::string, std::string > &arguments)
Executes bracketing analysis across all target samples.
void SetWorkingFolder(const QString &wf)
Sets the working directory for output files.
Definition conductor.h:103
bool ExecuteANOVA(const std::map< std::string, std::string > &arguments)
Executes Analysis of Variance (ANOVA) for element discrimination.
AnalysisHost * host
Non-owning pointer to the running environment.
Definition conductor.h:145
QString workingfolder
Output directory path.
Definition conductor.h:144
std::unique_ptr< CGA< SourceSinkData > > GA
Genetic Algorithm optimizer (owned)
Definition conductor.h:141
bool ExecuteGA_NoTargets(const std::map< std::string, std::string > &arguments)
Executes Genetic Algorithm disregarding target constraints.
bool ExecuteGA(const std::map< std::string, std::string > &arguments)
Executes Genetic Algorithm optimization.
bool ExecuteSourceVerify(const std::map< std::string, std::string > &arguments)
Executes source verification analysis.
bool ExecuteGA_FixedProfile(const std::map< std::string, std::string > &arguments)
Executes Genetic Algorithm with fixed elemental profiles.
void SetData(SourceSinkData *_data)
Sets the SourceSinkData for analysis.
Definition conductor.h:82
bool ExecuteMLR(const std::map< std::string, std::string > &arguments)
Executes multiple linear regression versus organic matter and particle size.
bool ExecuteDistributionFitting(const std::map< std::string, std::string > &arguments)
Executes distribution fitting analysis for a constituent.
bool ExecuteLevenbergMarquardtBatch(const std::map< std::string, std::string > &arguments)
Executes Levenberg-Marquardt optimization across all target samples.
bool ExecuteKolmogorovSmirnov(const std::map< std::string, std::string > &arguments)
Executes Kolmogorov-Smirnov goodness-of-fit test for a source/target group.
bool ExecuteErrorAnalysis(const std::map< std::string, std::string > &arguments)
Executes bootstrap error analysis for uncertainty quantification.
SourceSinkData * Data()
Returns pointer to the current SourceSinkData.
Definition conductor.h:76
SourceSinkData * data
Non-owning pointer to analysis data.
Definition conductor.h:140
bool ExecuteSDFAOnevsRest(const std::map< std::string, std::string > &arguments)
Executes Stepwise Discriminant Function Analysis for one group versus all others.
bool Execute(const std::string &command, std::map< std::string, std::string > arguments)
Executes a specified analysis command with given parameters.
Definition conductor.cpp:17
bool ExecuteBracketingAnalysis(const std::map< std::string, std::string > &arguments)
Executes bracketing analysis for a single target sample.
bool ExecuteDFAOnevsRest(const std::map< std::string, std::string > &arguments)
Executes Discriminant Function Analysis for one group versus all others.
bool ExecuteCovarianceMatrix(const std::map< std::string, std::string > &arguments)
Calculates covariance matrix for a source or target group.
Results results
Current analysis results (cleared each Execute)
Definition conductor.h:143
QString WorkingFolder() const
Returns the current working directory path.
Definition conductor.h:109
bool ExecuteOMSizeCorrect(const std::map< std::string, std::string > &arguments)
Executes organic matter and particle size correction.
bool ExecuteLevenbergMarquardt(const std::map< std::string, std::string > &arguments)
Executes Levenberg-Marquardt nonlinear optimization.
bool ExecuteEDP(const std::map< std::string, std::string > &arguments)
Calculates two-way element discriminant power between two groups.
bool ExecuteEDPM(const std::map< std::string, std::string > &arguments)
Calculates multi-way element discriminant power across all groups.
bool ExecuteCorrelationMatrix(const std::map< std::string, std::string > &arguments)
Calculates correlation matrix for a source or target group.
std::unique_ptr< CMCMC< SourceSinkData > > MCMC
MCMC sampler (owned)
Definition conductor.h:142