Debian Codegraph @

Source/Reasoner/Answerer/COptimizedComplexCompositionAnsweringHandler.h

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 #ifndef KONCLUDE_REASONER_ANSWERER_COPTIMIZEDCOMPLEXCOMPOSITIONANSWERINGHANDLER_H
22 #define KONCLUDE_REASONER_ANSWERER_COPTIMIZEDCOMPLEXCOMPOSITIONANSWERINGHANDLER_H
23
24 // Libraries includes
25 #include <QList>
26
27 // Namespace includes
28 #include "AnswererSettings.h"
29 #include "CAnsweringHandler.h"
30 #include "CAnswererContext.h"
31 #include "CAnsweringHandlingStatistics.h"
32 #include "CAnsweringCalculationStatisticsCollectionStrings.h"
33 #include "CAnsweringStatisticsCollectionStrings.h"
34 #include "CAnsweringMessageDataCalculationCompleted.h"
35 #include "CAnsweringMessageDataCalculationAdapter.h"
36 #include "COptimizedComplexCompositionOntologyAnsweringItem.h"
37 #include "CComplexQueryCompositionProcessingData.h"
38
39
40 // Other includes
41
42
43
44 #include "Context/CContextBase.h"
45
46 #include "Reasoner/Revision/COntologyRevision.h"
47
48 #include "Reasoner/Ontology/CConcreteOntology.h"
49
50 #include "Reasoner/Query/CComplexAnsweringCompositionQuery.h"
51 #include "Reasoner/Query/CQueryUnspecifiedStringError.h"
52
53 #include "Reasoner/Generator/CSatisfiableCalculationJobGenerator.h"
54
55
56
57
58 #include "Config/CConfigDataReader.h"
59
60
61 #include "KoncludeSettings.h"
62
63 // Logger includes
64 #include "Logger/CLogger.h"
65 #include "Logger/CLogIdentifier.h"
66
67 #include <iostream>
68
69 using namespace std;
70
71
72 namespace Konclude {
73
74 using namespace Config;
75 using namespace Context;
76
77 namespace Reasoner {
78
79 using namespace Revision;
80 using namespace Ontology;
81 using namespace Generator;
82 using namespace Query;
83
84
85 namespace Answerer {
86
87
88 /*!
89 *
90 * \class COptimizedComplexCompositionAnsweringHandler
91 * \author Andreas Steigmiller
92 * \version 0.1
93 * \brief TODO
94 *
95 */
96 class COptimizedComplexCompositionAnsweringHandler : public CAnsweringHandler, public CLogDomain {
97 // public methods
98 public:
99 //! Constructor
100 COptimizedComplexCompositionAnsweringHandler(COptimizedComplexCompositionOntologyAnsweringItem* ontoAnsweringItem);
101
102 //! Destructor
103 virtual ~COptimizedComplexCompositionAnsweringHandler();
104
105
106 virtual bool addAnsweringComplexQuery(CComplexAnsweringQuery* complexAnsweringQuery, CCallbackData* callback = nullptr);
107 virtual bool canAnsweringComplexQuery(CComplexAnsweringQuery* complexAnsweringQuery);
108 virtual bool canAnsweringComplexQuery(bool composedQuery);
109
110
111 virtual bool initializeProcessing(CAnswererContext* answererContext);
112 virtual bool prepareProcessing(CAnswererContext* answererContext);
113
114 virtual bool continueCalculationCreation(CAnswererContext* answererContext);
115
116
117
118 virtual bool processCalculationMessage(CAnsweringMessageData* message, CAnswererContext* answererContext);
119 virtual bool processRequirementMessage(CAnsweringMessageData* message, CAnswererContext* answererContext);
120
121
122 virtual bool isAnsweringFinished(CAnswererContext* answererContext);
123
124 virtual CAnsweringProgress* getAnsweringProgress();
125
126 virtual CAnsweringHandler* addAnsweringStatistics(CAnsweringStatistics* stats, bool lastStoredDiff);
127 virtual CAnsweringHandler* storeAnsweringStatistics();
128
129 // protected methods
130 protected:
131 virtual COptimizedComplexCompositionAnsweringHandler* initializeQueryProcessing(CComplexQueryCompositionProcessingData* queryData, CAnswererContext* answererContext);
132
133
134
135 // protected variables
136 protected:
137 COptimizedComplexCompositionOntologyAnsweringItem* mOntoAnsweringItem;
138 QList<CComplexQueryCompositionProcessingData*> mPendingQueryProcessingList;
139
140 cint64 mTotalPossibleInstancesCount = 0;
141 cint64 mTestedPossibleInstancesCount = 0;
142 CAnsweringProgress mAnsweringProgress;
143 QTime mAnsweringStartTime;
144
145 CAnswererContext* mAnswererContext;
146
147
148
149 // private methods
150 private:
151
152 // private variables
153 private:
154
155 };
156
157 }; // end namespace Answerer
158
159 }; // end namespace Reasoner
160
161 }; // end namespace Konclude
162
163 #endif // KONCLUDE_REASONER_ANSWERER_COPTIMIZEDCOMPLEXCOMPOSITIONANSWERINGHANDLER_H