Debian Codegraph @

Source/Reasoner/Classifier/CNodeBottomUpTraversalClassificationItem.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_CLASSIFIER_CNODEBOTTOMUPTRAVERSALCLASSIFICATIONITEM_H
22 #define KONCLUDE_REASONER_CLASSIFIER_CNODEBOTTOMUPTRAVERSALCLASSIFICATIONITEM_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "ClassifierSettings.h"
29 #include "CClassifierStatistics.h"
30 #include "CNodeBlockedClassificationItem.h"
31
32 // Other includes
33 #include "Reasoner/Ontology/CConcreteOntology.h"
34
35 #include "Reasoner/Taxonomy/CTaxonomy.h"
36
37 // Logger includes
38 #include "Logger/CLogger.h"
39
40
41 namespace Konclude {
42
43 namespace Reasoner {
44
45 using namespace Ontology;
46 using namespace Taxonomy;
47
48 namespace Classifier {
49
50
51 /*!
52 *
53 * \class CNodeBottomUpTraversalClassificationItem
54 * \author Andreas Steigmiller
55 * \version 0.1
56 * \brief TODO
57 *
58 */
59 class CNodeBottomUpTraversalClassificationItem : public CNodeBlockedClassificationItem {
60 // public methods
61 public:
62 //! Constructor
63 CNodeBottomUpTraversalClassificationItem(CHierarchyNode *node, QList<CHierarchyNode *> &branchNodes, QList<CNodeBottomUpTraversalClassificationItem *> *lockedReleaseProcessingList);
64
65 //! Destructor
66 virtual ~CNodeBottomUpTraversalClassificationItem();
67
68
69 CNodeBlockedClassificationItem *releaseBlockedResumeProcessing();
70 CNodeBlockedClassificationItem *releaseTestingBlockedResumeProcessing(CConcept *subsumerConcept, CConcept *subsumedConcept, bool testingResult);
71
72
73 CHierarchyNode *getTraversalNode();
74
75 QList<CHierarchyNode *> *getTestingNodeList();
76 CNodeBottomUpTraversalClassificationItem *appendTestingNodeList(QList<CHierarchyNode *> &nodeList);
77 CNodeBottomUpTraversalClassificationItem *appendTestingNode(CHierarchyNode *node);
78
79 QList<CHierarchyNode *> *getChildNodeList();
80 CNodeBottomUpTraversalClassificationItem *appendChildNodeList(QList<CHierarchyNode *> &nodeList);
81 CNodeBottomUpTraversalClassificationItem *appendChildNode(CHierarchyNode *parentNode);
82
83 QList<CHierarchyNode *> *getBranchLockedNodeList();
84 CNodeBottomUpTraversalClassificationItem *appendBranchLockedNodeList(QList<CHierarchyNode *> &nodeList);
85 CNodeBottomUpTraversalClassificationItem *appendBranchLockedNode(CHierarchyNode *branchNode);
86
87 bool hasNextTestingNode();
88 CHierarchyNode *takeNextTestingNode();
89 CHierarchyNode *getTestingNode();
90 CNodeBottomUpTraversalClassificationItem *clearTestingNode();
91 bool getTestingResult();
92
93 bool hasDirectBranchLockedNode();
94 CHierarchyNode *getDirectBranchLockedNode();
95 CNodeBottomUpTraversalClassificationItem *setDirectBranchLockedNode(CHierarchyNode *parentLockedNode);
96
97 QList<CHierarchyNode *> *getNewBranchNodeList();
98 CNodeBottomUpTraversalClassificationItem *appendNewBranchNodeList(QList<CHierarchyNode *> &nodeList);
99 CNodeBottomUpTraversalClassificationItem *appendNewBranchNode(CHierarchyNode *branchNode);
100
101 bool hasAllSilbingBranchTested();
102 CNodeBottomUpTraversalClassificationItem *setAllSilbingBranchTested(bool allSilbingsTested = true);
103 qint64 getSilbingBranchTestNodeCount();
104 CNodeBottomUpTraversalClassificationItem *decSilbingBranchTestNodeCount();
105
106 bool isChildNodeAddedContinueBlocking();
107 QList<CHierarchyNode*> getChildNodeAddedContinueBlockingList();
108 CNodeBottomUpTraversalClassificationItem* setChildNodeAddedContinueBlocking(bool addedChildNode);
109 CNodeBottomUpTraversalClassificationItem* addChildNodeAddedContinueBlocking(CHierarchyNode* continueBlocking);
110
111
112 // protected methods
113 protected:
114
115 // protected variables
116 protected:
117 CHierarchyNode *traversalNode;
118 CHierarchyNode *parLockNode;
119 CHierarchyNode *testNode;
120
121 QList<CHierarchyNode *> testingNodeList;
122 QList<CHierarchyNode *> branchLockedNodeList;
123 QList<CHierarchyNode *> newBranchNodeList;
124 QSet<CHierarchyNode *> newBranchNodeSet;
125 QList<CHierarchyNode *> childNodeList;
126
127 QList<CHierarchyNode *> childNodeContinueBlockingList;
128
129
130 QList<CNodeBottomUpTraversalClassificationItem *> *lockedReleaseProcList;
131
132
133 bool subSumTestingResult;
134 bool mChildNodeAdded;
135
136 qint64 silbingBranchTestNodeCount;
137 bool allSilbingBranchTested;
138
139
140
141 // private methods
142 private:
143
144 // private variables
145 private:
146
147 };
148
149 }; // end namespace Classifier
150
151 }; // end namespace Reasoner
152
153 }; // end namespace Konclude
154
155 #endif // KONCLUDE_REASONER_CLASSIFIER_CNODEBOTTOMUPTRAVERSALCLASSIFICATIONITEM_H