Debian Codegraph @

Source/Control/Loader/CReasonerEvaluationLoadingTimesComparerLoader.cpp

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #include "CReasonerEvaluationLoadingTimesComparerLoader.h"
22
23
24 namespace Konclude {
25
26 namespace Control {
27
28 namespace Loader {
29
30
31 CReasonerEvaluationLoadingTimesComparerLoader::CReasonerEvaluationLoadingTimesComparerLoader() {
32 loaderConfig = nullptr;
33 }
34
35
36
37 CReasonerEvaluationLoadingTimesComparerLoader::~CReasonerEvaluationLoadingTimesComparerLoader() {
38 }
39
40
41 CLoader *CReasonerEvaluationLoadingTimesComparerLoader::init(CLoaderFactory *loaderFactory, CConfiguration *config) {
42 loaderConfig = config;
43 CConfigData *data = config->getLastConfigChange("Konclude.Test.Generator.InputDirectory");
44 if (data) {
45 mInputDir = data->getString();
46 }
47 if (!mInputDir.endsWith("/")) {
48 mInputDir += QString("/");
49 }
50
51 data = config->getLastConfigChange("Konclude.Test.Generator.OutputDirectory");
52 if (data) {
53 mOutputDir = data->getString();
54 }
55 if (!mOutputDir.endsWith("/")) {
56 mOutputDir += QString("/");
57 }
58 mOutputDirClassify = mOutputDir+"Classification/";
59
60 return this;
61 }
62
63
64
65 CLoader *CReasonerEvaluationLoadingTimesComparerLoader::load() {
66
67 CReasonerEvaluationLoadingTimeExtractor* loadTimeExtractor = new CReasonerEvaluationLoadingTimeExtractor(60000);
68 CReasonerEvaluationAvaragerSummarizer* avarageSummarize = new CReasonerEvaluationAvaragerSummarizer();
69
70 QStringList reasonerNameStringList = QStringList()
71 <<"HermiT 1.3.6"
72 <<"FaCT++ 1.5.3"
73 <<"Pellet 2.3.0"
74 <<"Konclude 0.3.7-620";
75 QStringList reasonerPathStringList = QStringList()
76 <<CReasonerEvaluationPathConverter::getCorrectedPathString("Evaluation/Responses/R-000/HermiT/$$_LATEST_STRING_$$/Config001/")
77 <<CReasonerEvaluationPathConverter::getCorrectedPathString("Evaluation/Responses/R-000/FaCT++/$$_LATEST_STRING_$$/Config001/")
78 <<CReasonerEvaluationPathConverter::getCorrectedPathString("Evaluation/Responses/R-000/Pellet/$$_LATEST_STRING_$$/Config001/")
79 <<CReasonerEvaluationPathConverter::getCorrectedPathString("Evaluation/Responses/R-000/Konclude/$$_LATEST_STRING_$$/Config001/");
80
81 QString outputDirectory = CReasonerEvaluationPathConverter::getCorrectedPathString("Evaluation/Analyses/R-000/A-$$_LATEST+1_$$/ReasonerLoadingComparison/");
82 QDir currDir(".");
83 currDir.mkpath(outputDirectory);
84
85
86 CReasonerEvaluationAnalyseContext* reasonerEvaluationContext = new CReasonerEvaluationAnalyseContext();
87 //reasonerEvaluationContext->getGNUPlotPlotter()->createReasonerOverviewPlot("Evaluation/Analyse/R-000/A-003/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/classification-time-separate-sorted-descending-table.dat","xyz",QStringList()<<"Min"<<"Max","Evaluation/Analyse/R-000/A-003/ReasonerComparison/TONES Repository/Incompatible Axioms Removed/Classification/xyz");
88 //reasonerEvaluationContext->getHighchartPlotter()->createReasonerComparisonPlot("Evaluation/Analyses/R-000/A-004/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/classification-time-sorted-descending-by-Average-split-from-0-to-16-table.csv","xyz",QStringList()<<"Min"<<"Max","Evaluation/Analyses/R-000/A-004/ReasonerClassificationComparison/TONES Repository/Incompatible Axioms Removed/Classification/xyz");
89
90
91 CReasonerEvaluationCollector* collector = new CReasonerEvaluationCollector(loadTimeExtractor,avarageSummarize);
92
93 CReasonerEvaluationDataValueGroupCollectionReasonerComparison* reasonerComp = new CReasonerEvaluationDataValueGroupCollectionReasonerComparison(reasonerNameStringList);
94
95 for (QStringList::const_iterator it1 = reasonerNameStringList.constBegin(), it2 = reasonerPathStringList.constBegin(), it1End = reasonerNameStringList.constEnd(), it2End = reasonerPathStringList.constEnd(); it1 != it1End && it2 != it2End; ++it1, ++it2) {
96 QString reasonerName(*it1);
97 QString reasonerPath(*it2);
98 LOG(INFO,"::Konclude::Test::Evaluation::ReasonerLoadingTimeComparer",logTr("Extracting loading times for '%1' reasoner from responses in directory '%2'.").arg(reasonerName).arg(reasonerPath),this);
99 collector->collectReasonerEvaluationDataValues(reasonerComp,reasonerName,reasonerPath);
100 }
101
102
103 LOG(INFO,"::Konclude::Test::Evaluation::ReasonerLoadingTimeComparer",logTr("Comparing loading times for '%1'.").arg(reasonerNameStringList.join(", ")),this);
104
105 CReasonerEvaluationGroupRequestSelector* selectors = nullptr;
106 CReasonerEvaluationExpressivitySelectorFactory expEvalSelFactory("Expressivity Grouped","Expressivity Grouped/","Evaluation/Infos/Expressivity/");
107 selectors = expEvalSelFactory.getSelectors(selectors);
108 CReasonerEvaluationDirectoryStructureSelectorFactory dirEvalSelFactory("Evaluation/Requests/","Evaluation/Requests/","Directory Grouped","Directory Grouped/");
109 selectors = dirEvalSelFactory.getSelectors(selectors);
110
111
112 CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser* analyser1 = new CReasonerEvaluationGroupRequestReasonerCSVComparisonAnalyser();
113 analyser1->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors);
114
115 CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser* analyser2 = new CReasonerEvaluationGroupRequestReasonerWithMeanMinMaxCSVComparisonAnalyser();
116 analyser2->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors);
117
118 CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser* analyser3 = new CReasonerEvaluationGroupReasonerWinnerCountCSVComparisonAnalyser();
119 analyser3->analyseEvaluationData(reasonerComp,reasonerEvaluationContext,outputDirectory,selectors);
120
121 LOG(INFO,"::Konclude::Test::Evaluation::ReasonerLoadingTimeComparer",logTr("Loading times for '%1' compared to '%2'.").arg(reasonerNameStringList.join(", ")).arg(outputDirectory),this);
122
123
124 return this;
125 }
126
127
128
129
130 CLoader *CReasonerEvaluationLoadingTimesComparerLoader::exit() {
131 return this;
132 }
133
134
135
136 }; // end namespace Loader
137
138 }; // end namespace Control
139
140 }; // end namespace Konclude