| 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_CANSWERINGSPLITPROPAGATIONTESTINGVARIABLEDATA_H |
| 22 |
#define KONCLUDE_REASONER_ANSWERER_CANSWERINGSPLITPROPAGATIONTESTINGVARIABLEDATA_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "AnswererSettings.h" |
| 29 |
#include "CAnsweringSplitPropagationTestingVariableBindingData.h" |
| 30 |
|
| 31 |
|
| 32 |
// Other includes |
| 33 |
#include "Utilities/UtilitiesSettings.h" |
| 34 |
|
| 35 |
#include "Reasoner/Ontology/CVariable.h" |
| 36 |
#include "Reasoner/Ontology/CIndividualReference.h" |
| 37 |
|
| 38 |
#include "Parser/Expressions/CExpressionVariable.h" |
| 39 |
|
| 40 |
|
| 41 |
// Logger includes |
| 42 |
#include "Logger/CLogger.h" |
| 43 |
|
| 44 |
|
| 45 |
namespace Konclude { |
| 46 |
|
| 47 |
using namespace Utilities; |
| 48 |
using namespace Parser::Expression; |
| 49 |
|
| 50 |
namespace Reasoner { |
| 51 |
|
| 52 |
using namespace Ontology; |
| 53 |
|
| 54 |
namespace Answerer { |
| 55 |
|
| 56 |
|
| 57 |
/*! |
| 58 |
* |
| 59 |
* \class CAnsweringSplitPropagationTestingVariableData |
| 60 |
* \author Andreas Steigmiller |
| 61 |
* \version 0.1 |
| 62 |
* \brief TODO |
| 63 |
* |
| 64 |
*/ |
| 65 |
class CAnsweringSplitPropagationTestingVariableData { |
| 66 |
// public methods |
| 67 |
public: |
| 68 |
//! Constructor |
| 69 |
CAnsweringSplitPropagationTestingVariableData(cint64 variableDataId, CVariable* variable, CExpressionVariable* variableExpression, QSet<CIndividualReference>* bindingSet); |
| 70 |
|
| 71 |
QSet<CIndividualReference>* getVariableBindingIndividualSet(); |
| 72 |
|
| 73 |
CAnsweringSplitPropagationTestingVariableData* resetIntegrations(); |
| 74 |
CAnsweringSplitPropagationTestingVariableData* disableIntegrations(); |
| 75 |
CAnsweringSplitPropagationTestingVariableData* setVariableBindingsIntegrationLimit(cint64 limit); |
| 76 |
|
| 77 |
CAnsweringSplitPropagationTestingVariableData* addIntegrateableVariableBinding(const CIndividualReference& indiRef); |
| 78 |
CAnsweringSplitPropagationTestingVariableData* addIntegrateableVariableBindings(QSet<CIndividualReference>* bindingSet); |
| 79 |
bool visitIntegrateableVariableBindings(function<bool(const CIndividualReference& indiRef)> visitFunc); |
| 80 |
cint64 getIntegrateableVariableBindingCount(); |
| 81 |
|
| 82 |
|
| 83 |
cint64 getVariableDataId(); |
| 84 |
cint64 getVariableBindingsIntegrationCount(); |
| 85 |
cint64 getVariableBindingsIntegrationLimit(); |
| 86 |
cint64 getVariableBindingsRemainingIntegrationRequirementCount(); |
| 87 |
|
| 88 |
bool hasVariableBiningsIntegrationLimitReached(); |
| 89 |
|
| 90 |
|
| 91 |
CVariable* getVariable(); |
| 92 |
CExpressionVariable* getVariableExpression(); |
| 93 |
|
| 94 |
QHash<CIndividualReference, CAnsweringSplitPropagationTestingVariableBindingData>* getBindingIndividualDataHash(); |
| 95 |
|
| 96 |
bool canIntegrateBinding(const CIndividualReference& indiRef, cint64* integationCounter); |
| 97 |
CAnsweringSplitPropagationTestingVariableData* incVariableBindingsRemainingIntegrationRequirementCount(cint64 count); |
| 98 |
|
| 99 |
|
| 100 |
bool hasVariableDataIntegrationId(); |
| 101 |
cint64 getVariableDataIntegrationId(); |
| 102 |
CAnsweringSplitPropagationTestingVariableData* setVariableDataIntegrationId(cint64 id); |
| 103 |
|
| 104 |
|
| 105 |
cint64 getDisabledVariableBindingsCount(); |
| 106 |
bool hasAllVariableBindingsDisabled(); |
| 107 |
cint64 getLastVariableBindingsIntegrationCount(bool updateLast = true); |
| 108 |
|
| 109 |
// protected methods |
| 110 |
protected: |
| 111 |
|
| 112 |
// protected variables |
| 113 |
protected: |
| 114 |
cint64 mVariableDataIntegrationId; |
| 115 |
cint64 mVariableDataId; |
| 116 |
CVariable* mVariable; |
| 117 |
CExpressionVariable* mVariableExpression; |
| 118 |
bool mDynamicBindings; |
| 119 |
|
| 120 |
QSet<CIndividualReference>* mBindingSet; |
| 121 |
QHash<CIndividualReference, CAnsweringSplitPropagationTestingVariableBindingData> mBindingIndiDataHash; |
| 122 |
|
| 123 |
cint64 mDisabledBindingsCount; |
| 124 |
cint64 mLastIntegratedBindingsCount; |
| 125 |
cint64 mIntegratedBindingsCount; |
| 126 |
cint64 mIntegrationBindingsLimit; |
| 127 |
cint64 mRemainingIntegrationRequirementCount; |
| 128 |
|
| 129 |
CAnsweringSplitPropagationTestingVariableBindingData* mIntegratedDataLinker; |
| 130 |
|
| 131 |
// private methods |
| 132 |
private: |
| 133 |
|
| 134 |
// private variables |
| 135 |
private: |
| 136 |
|
| 137 |
}; |
| 138 |
|
| 139 |
}; // end namespace Answerer |
| 140 |
|
| 141 |
}; // end namespace Reasoner |
| 142 |
|
| 143 |
}; // end namespace Konclude |
| 144 |
|
| 145 |
#endif // KONCLUDE_REASONER_ANSWERER_CANSWERINGSPLITPROPAGATIONTESTINGVARIABLEDATA_H |