| 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_CANSWERINGSPLITPROPAGATIONTESTCONTROLLINGITEM_H |
| 22 |
#define KONCLUDE_REASONER_ANSWERER_CANSWERINGSPLITPROPAGATIONTESTCONTROLLINGITEM_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "AnswererSettings.h" |
| 29 |
#include "CAnsweringSplitPropagationTestingVariableData.h" |
| 30 |
#include "CAnsweringPropagationExtendedSteeringController.h" |
| 31 |
#include "COptimizedComplexVariableAbsorptionBasedHandlingQueryPartData.h" |
| 32 |
|
| 33 |
|
| 34 |
// Other includes |
| 35 |
#include "Utilities/UtilitiesSettings.h" |
| 36 |
|
| 37 |
// Logger includes |
| 38 |
#include "Logger/CLogger.h" |
| 39 |
|
| 40 |
|
| 41 |
namespace Konclude { |
| 42 |
|
| 43 |
using namespace Utilities; |
| 44 |
|
| 45 |
namespace Reasoner { |
| 46 |
|
| 47 |
namespace Answerer { |
| 48 |
|
| 49 |
|
| 50 |
/*! |
| 51 |
* |
| 52 |
* \class CAnsweringSplitPropagationTestControllingItem |
| 53 |
* \author Andreas Steigmiller |
| 54 |
* \version 0.1 |
| 55 |
* \brief TODO |
| 56 |
* |
| 57 |
*/ |
| 58 |
class CAnsweringSplitPropagationTestControllingItem : public CAnsweringPropagationExtendedSteeringController { |
| 59 |
// public methods |
| 60 |
public: |
| 61 |
//! Constructor |
| 62 |
CAnsweringSplitPropagationTestControllingItem(cint64 testingItemId, COptimizedComplexVariableAbsorptionBasedHandlingQueryPartData* absorptionData); |
| 63 |
|
| 64 |
~CAnsweringSplitPropagationTestControllingItem(); |
| 65 |
|
| 66 |
cint64 getTestingItemId(); |
| 67 |
|
| 68 |
CAnsweringSplitPropagationTestControllingItem* setIntegrationLimit(cint64 limit); |
| 69 |
CAnsweringSplitPropagationTestControllingItem* addVariableData(CAnsweringSplitPropagationTestingVariableData* varData, bool splittingBase); |
| 70 |
|
| 71 |
|
| 72 |
QList<CAnsweringSplitPropagationTestingVariableData*> getIntegrationOrderedVariableDataList(); |
| 73 |
CAnsweringSplitPropagationTestingVariableData* getBaseVariableData(); |
| 74 |
|
| 75 |
cint64 getExpectedIntegrationCount(); |
| 76 |
cint64 getTestActualIntegrationCount(); |
| 77 |
cint64 getIntendedIntegrationLimit(); |
| 78 |
|
| 79 |
bool reconfigureVariableIntegrationLimits(cint64 intededIntegrationLimit); |
| 80 |
bool disableCheckedVariableIntegrations(); |
| 81 |
|
| 82 |
bool hasCheckedAllVariableIntegrations(); |
| 83 |
|
| 84 |
|
| 85 |
virtual bool tryExtendVariableIntegrationLimits(CVariable** integrationExtendedVariable = nullptr); |
| 86 |
virtual bool canIntegrateVariableBinding(CVariable* var, const CIndividualReference& indiRef); |
| 87 |
virtual CAnsweringPropagationExtendedSteeringController* incVariableBindingsRemainingIntegrationRequirementCount(CVariable* var, cint64 count); |
| 88 |
|
| 89 |
|
| 90 |
virtual bool finalizeWithClashing(); |
| 91 |
virtual bool finalizeWithBindingExtraction(); |
| 92 |
|
| 93 |
virtual bool isPreparationBindingNominalIndividual(CVariable* variable, CIndividual* indi); |
| 94 |
virtual bool isPreparationBindingNominalIndividual(CVariable* variable, cint64 indiId); |
| 95 |
virtual bool isPreparationBindingAllIndividuals(CVariable* variable); |
| 96 |
|
| 97 |
|
| 98 |
CAnsweringSplitPropagationTestingVariableData* getVariableData(CVariable* var); |
| 99 |
|
| 100 |
cint64 getNextTestingId(); |
| 101 |
cint64 getNextVariableDataId(); |
| 102 |
|
| 103 |
CAnsweringSplitPropagationTestControllingItem* reset(); |
| 104 |
|
| 105 |
// protected methods |
| 106 |
protected: |
| 107 |
CAnsweringSplitPropagationTestControllingItem* updateIntegrationOrderedVariableDataList(); |
| 108 |
|
| 109 |
// protected variables |
| 110 |
protected: |
| 111 |
cint64 mTestingItemId; |
| 112 |
COptimizedComplexVariableAbsorptionBasedHandlingQueryPartData* mAbsorptionData; |
| 113 |
|
| 114 |
QHash<CVariable*, CAnsweringSplitPropagationTestingVariableData*> mVariableDataHash; |
| 115 |
QHash<CExpressionVariable*, CAnsweringSplitPropagationTestingVariableData*> mVariableExpressionDataHash; |
| 116 |
CAnsweringSplitPropagationTestingVariableData* mBaseSplittingVarData; |
| 117 |
|
| 118 |
QList<CAnsweringSplitPropagationTestingVariableData*> mVariableDataList; |
| 119 |
|
| 120 |
cint64 mIntegrationOrderedVariableDataCount; |
| 121 |
QList<CAnsweringSplitPropagationTestingVariableData*> mIntegrationOrderedVariableDataList; |
| 122 |
cint64 mNextIntegrationId; |
| 123 |
cint64 mNextTestingId; |
| 124 |
|
| 125 |
CAnsweringSplitPropagationTestingVariableData* mLastIntegrationTestedVarData; |
| 126 |
CVariable* mLastIntegrationTestedVar; |
| 127 |
|
| 128 |
cint64 mExpectedIntegrationCount; |
| 129 |
cint64 mTestActualIntegrationCount; |
| 130 |
cint64 mIntendedIntegrationLimit; |
| 131 |
|
| 132 |
bool mAllIntegrationTested; |
| 133 |
|
| 134 |
// private methods |
| 135 |
private: |
| 136 |
|
| 137 |
// private variables |
| 138 |
private: |
| 139 |
|
| 140 |
}; |
| 141 |
|
| 142 |
}; // end namespace Answerer |
| 143 |
|
| 144 |
}; // end namespace Reasoner |
| 145 |
|
| 146 |
}; // end namespace Konclude |
| 147 |
|
| 148 |
#endif // KONCLUDE_REASONER_ANSWERER_CANSWERINGSPLITPROPAGATIONTESTCONTROLLINGITEM_H |