Debian Codegraph @

Source/Reasoner/Realizer/COptimizedRepresentativeKPSetIntersectionCombinationIterator.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_REALIZER_COptimizedRepresentativeKPSetIntersectionCombinationIterator_H
22 #define KONCLUDE_REASONER_REALIZER_COptimizedRepresentativeKPSetIntersectionCombinationIterator_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "RealizerSettings.h"
29 #include "COptimizedKPSetConceptInstancesItem.h"
30 #include "COptimizedRepresentativeKPSetConceptSetCacheLabelItemInstancesData.h"
31
32
33 // Other includes
34 #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheItemIndividualAssociationMapIterator.h"
35 #include "Reasoner/Kernel/Cache/CBackendRepresentativeMemoryLabelCacheItemIndividualAssociationMapExtensionData.h"
36
37 #include "Reasoner/Realization/CRealizationIndividualSorting.h"
38 #include "Reasoner/Realization/CRealizationIndividualInstanceItemReference.h"
39 #include "Reasoner/Realization/CRealizationIndividualInstanceItemReferenceIterator.h"
40
41 // Logger includes
42 #include "Logger/CLogger.h"
43
44
45 namespace Konclude {
46
47 namespace Reasoner {
48
49 using namespace Kernel::Cache;
50 using namespace Realization;
51
52 namespace Realizer {
53
54
55 /*!
56 *
57 * \class COptimizedRepresentativeKPSetIntersectionCombinationIterator
58 * \author Andreas Steigmiller
59 * \version 0.1
60 * \brief TODO
61 *
62 */
63 class COptimizedRepresentativeKPSetIntersectionCombinationIterator : public CRealizationIndividualInstanceItemReferenceIterator {
64 // public methods
65 public:
66 //! Constructor
67 COptimizedRepresentativeKPSetIntersectionCombinationIterator(QList<CRealizationIndividualInstanceItemReferenceIterator*> iteratorList);
68 virtual ~COptimizedRepresentativeKPSetIntersectionCombinationIterator();
69
70
71 virtual bool requiresInitialization();
72 virtual bool begin();
73
74
75
76 bool atEnd();
77 virtual CRealizationRemainingInstancesEstimation remainingInstancesEstimation();
78
79 bool moveNext();
80 virtual bool moveTo(const CRealizationIndividualInstanceItemReference& indiInstItemRef, bool moveOver = true);
81
82 CRealizationIndividualInstanceItemReference currentIndividualInstanceItemReference();
83 virtual bool isCurrentInstancePossible();
84 virtual bool isCurrentInstanceCertain();
85
86 virtual CRealizationIndividualInstanceItemReferenceIterator* getCopy();
87
88 virtual CRealizationIndividualSorting getSorting();
89
90 QList<CRealizationIndividualInstanceItemReferenceIterator*>* getCombinedIteratorList();
91
92 // protected methods
93 protected:
94 class CRealizationIteratorData {
95 public:
96 CRealizationIteratorData(CRealizationIndividualInstanceItemReferenceIterator* iterator) {
97 mIterator = iterator;
98 }
99
100 CRealizationIndividualInstanceItemReferenceIterator* mIterator;
101 };
102
103
104 bool moveToValidPosition();
105 bool init();
106
107
108 // protected variables
109 protected:
110 QList<CRealizationIndividualInstanceItemReferenceIterator*> mIteratorList;
111 QList<CRealizationIteratorData*> mIteratorDataList;
112
113 CRealizationIteratorData* mIteratingIteratorData;
114 QMap<cint64, CRealizationIteratorData*> mCurrentIndiIdIterationDataMap;
115
116
117 cint64 mVisitedIterationCount;
118 cint64 mIntersectionIterationCount;
119
120 bool mIterateAscending;
121
122
123 // private methods
124 private:
125
126 // private variables
127 private:
128
129 };
130
131 }; // end namespace Realizer
132
133 }; // end namespace Reasoner
134
135 }; // end namespace Konclude
136
137 #endif // KONCLUDE_REASONER_REALIZER_COptimizedRepresentativeKPSetIntersectionCombinationIterator_H