| 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 |
#include "CCalculationTableauCompletionAlgorithmUpdateReader.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Test { |
| 27 |
|
| 28 |
namespace Analyse { |
| 29 |
|
| 30 |
namespace Reader { |
| 31 |
|
| 32 |
CCalculationTableauCompletionAlgorithmUpdateReader::CCalculationTableauCompletionAlgorithmUpdateReader(CCalculationTableauCompletionTaskHandleAlgorithm *algorithm) { |
| 33 |
alg = algorithm; |
| 34 |
|
| 35 |
atmostRuleCountValueDescription = 0; |
| 36 |
atleastRuleCountValueDescription = 0; |
| 37 |
orRuleCountValueDescription = 0; |
| 38 |
andRuleCountValueDescription = 0; |
| 39 |
someRuleCountValueDescription = 0; |
| 40 |
allRuleCountValueDescription = 0; |
| 41 |
rulesCountValueDescription = 0; |
| 42 |
|
| 43 |
|
| 44 |
if (alg) { |
| 45 |
atmostRuleCountValueDescription = new CAnalyseValueDescription(); |
| 46 |
atmostRuleCountValueDescription->setValueName(QString("Algorithm::AtmostAppliedCount")); |
| 47 |
atmostRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); |
| 48 |
|
| 49 |
atleastRuleCountValueDescription = new CAnalyseValueDescription(); |
| 50 |
atleastRuleCountValueDescription->setValueName(QString("Algorithm::AtleastAppliedCount")); |
| 51 |
atleastRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); |
| 52 |
|
| 53 |
orRuleCountValueDescription = new CAnalyseValueDescription(); |
| 54 |
orRuleCountValueDescription->setValueName(QString("Algorithm::OrAppliedCount")); |
| 55 |
orRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); |
| 56 |
|
| 57 |
andRuleCountValueDescription = new CAnalyseValueDescription(); |
| 58 |
andRuleCountValueDescription->setValueName(QString("Algorithm::AndAppliedCount")); |
| 59 |
andRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); |
| 60 |
|
| 61 |
someRuleCountValueDescription = new CAnalyseValueDescription(); |
| 62 |
someRuleCountValueDescription->setValueName(QString("Algorithm::SomeAppliedCount")); |
| 63 |
someRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); |
| 64 |
|
| 65 |
allRuleCountValueDescription = new CAnalyseValueDescription(); |
| 66 |
allRuleCountValueDescription->setValueName(QString("Algorithm::AllAppliedCount")); |
| 67 |
allRuleCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); |
| 68 |
|
| 69 |
rulesCountValueDescription = new CAnalyseValueDescription(); |
| 70 |
rulesCountValueDescription->setValueName(QString("Algorithm::TotalRulesAppliedCount")); |
| 71 |
rulesCountValueDescription->setTemplateValue(new CIntegerAnalyseValue(0)); |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
CCalculationTableauCompletionAlgorithmUpdateReader::~CCalculationTableauCompletionAlgorithmUpdateReader() { |
| 76 |
if (alg) { |
| 77 |
delete atmostRuleCountValueDescription; |
| 78 |
delete atleastRuleCountValueDescription; |
| 79 |
delete orRuleCountValueDescription; |
| 80 |
delete andRuleCountValueDescription; |
| 81 |
delete someRuleCountValueDescription; |
| 82 |
delete allRuleCountValueDescription; |
| 83 |
delete rulesCountValueDescription; |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getAtmostRuleCountValueDescription() { |
| 90 |
return atmostRuleCountValueDescription; |
| 91 |
} |
| 92 |
|
| 93 |
CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getAtleastRuleCountValueDescription() { |
| 94 |
return atleastRuleCountValueDescription; |
| 95 |
} |
| 96 |
|
| 97 |
CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getOrRuleCountValueDescription() { |
| 98 |
return orRuleCountValueDescription; |
| 99 |
} |
| 100 |
|
| 101 |
CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getAndRuleCountValueDescription() { |
| 102 |
return andRuleCountValueDescription; |
| 103 |
} |
| 104 |
|
| 105 |
CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getAllRuleCountValueDescription() { |
| 106 |
return allRuleCountValueDescription; |
| 107 |
} |
| 108 |
|
| 109 |
CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getSomeRuleCountValueDescription() { |
| 110 |
return someRuleCountValueDescription; |
| 111 |
} |
| 112 |
|
| 113 |
CAnalyseValueDescription *CCalculationTableauCompletionAlgorithmUpdateReader::getRulesCountValueDescription() { |
| 114 |
return rulesCountValueDescription; |
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
CAnalyseValue *CCalculationTableauCompletionAlgorithmUpdateReader::getAnalyseValueUpdate(CAnalyseValueDescription *valueDes) { |
| 120 |
CAnalyseValue *val = 0; |
| 121 |
|
| 122 |
if (valueDes == atmostRuleCountValueDescription && alg) { |
| 123 |
val = new CIntegerAnalyseValue(alg->getAppliedATMOSTRuleCount()); |
| 124 |
} else if (valueDes == atleastRuleCountValueDescription && alg) { |
| 125 |
val = new CIntegerAnalyseValue(alg->getAppliedATLEASTRuleCount()); |
| 126 |
} else if (valueDes == orRuleCountValueDescription && alg) { |
| 127 |
val = new CIntegerAnalyseValue(alg->getAppliedORRuleCount()); |
| 128 |
} else if (valueDes == andRuleCountValueDescription && alg) { |
| 129 |
val = new CIntegerAnalyseValue(alg->getAppliedANDRuleCount()); |
| 130 |
} else if (valueDes == someRuleCountValueDescription && alg) { |
| 131 |
val = new CIntegerAnalyseValue(alg->getAppliedSOMERuleCount()); |
| 132 |
} else if (valueDes == allRuleCountValueDescription && alg) { |
| 133 |
val = new CIntegerAnalyseValue(alg->getAppliedALLRuleCount()); |
| 134 |
} else if (valueDes == rulesCountValueDescription && alg) { |
| 135 |
val = new CIntegerAnalyseValue(alg->getAppliedTotalRuleCount()); |
| 136 |
} |
| 137 |
return val; |
| 138 |
} |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
}; // end namespace Reader |
| 143 |
|
| 144 |
}; // end namespace Analyse |
| 145 |
|
| 146 |
}; // end namespace Test |
| 147 |
|
| 148 |
}; // end namespace Konclude |