| 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 "CClassificationClassPseudoModelRoleData.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Classifier { |
| 29 |
|
| 30 |
CClassificationClassPseudoModelRoleData::CClassificationClassPseudoModelRoleData() { |
| 31 |
mLowerAtLeast = 0; |
| 32 |
mUpperAtLeast = 0; |
| 33 |
mLowerAtMost = 0; |
| 34 |
mUpperAtMost = 0; |
| 35 |
mSuccessorModel = 0; |
| 36 |
} |
| 37 |
|
| 38 |
cint64 CClassificationClassPseudoModelRoleData::getLowerAtLeastBound() { |
| 39 |
return mLowerAtLeast; |
| 40 |
} |
| 41 |
|
| 42 |
cint64 CClassificationClassPseudoModelRoleData::getUpperAtLeastBound() { |
| 43 |
return mUpperAtLeast; |
| 44 |
} |
| 45 |
|
| 46 |
|
| 47 |
cint64 CClassificationClassPseudoModelRoleData::getLowerAtMostBound() { |
| 48 |
return mLowerAtMost; |
| 49 |
} |
| 50 |
|
| 51 |
cint64 CClassificationClassPseudoModelRoleData::getUpperAtMostBound() { |
| 52 |
return mUpperAtMost; |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
bool CClassificationClassPseudoModelRoleData::setLowerAtLeastBound(cint64 bound) { |
| 57 |
bool diff = mLowerAtLeast != bound; |
| 58 |
mLowerAtLeast = bound; |
| 59 |
return diff; |
| 60 |
} |
| 61 |
|
| 62 |
bool CClassificationClassPseudoModelRoleData::setUpperAtLeastBound(cint64 bound) { |
| 63 |
bool diff = mUpperAtLeast != bound; |
| 64 |
mUpperAtLeast = bound; |
| 65 |
return diff; |
| 66 |
} |
| 67 |
|
| 68 |
bool CClassificationClassPseudoModelRoleData::setLowerAtMostBound(cint64 bound) { |
| 69 |
bool diff = mLowerAtMost != bound; |
| 70 |
mLowerAtMost = bound; |
| 71 |
return diff; |
| 72 |
} |
| 73 |
|
| 74 |
bool CClassificationClassPseudoModelRoleData::setUpperAtMostBound(cint64 bound) { |
| 75 |
bool diff = mUpperAtMost != bound; |
| 76 |
mUpperAtMost = bound; |
| 77 |
return diff; |
| 78 |
} |
| 79 |
|
| 80 |
cint64 CClassificationClassPseudoModelRoleData::getSuccessorModelID() const { |
| 81 |
return mSuccessorModel; |
| 82 |
} |
| 83 |
|
| 84 |
bool CClassificationClassPseudoModelRoleData::setSuccessorModelID(cint64 modelID) { |
| 85 |
bool diff = mSuccessorModel != modelID; |
| 86 |
mSuccessorModel = modelID; |
| 87 |
return diff; |
| 88 |
} |
| 89 |
|
| 90 |
bool CClassificationClassPseudoModelRoleData::isPossibleSubsumerOf(const CClassificationClassPseudoModelRoleData& possibleSubsumedData) const { |
| 91 |
if (mDeterministicFlag) { |
| 92 |
if (mLowerAtLeast > possibleSubsumedData.mUpperAtLeast) { |
| 93 |
return false; |
| 94 |
} |
| 95 |
if (mUpperAtMost < possibleSubsumedData.mLowerAtMost) { |
| 96 |
return false; |
| 97 |
} |
| 98 |
return true; |
| 99 |
} else { |
| 100 |
return true; |
| 101 |
} |
| 102 |
} |
| 103 |
|
| 104 |
}; // end namespace Classifier |
| 105 |
|
| 106 |
}; // end namespace Reasoner |
| 107 |
|
| 108 |
}; // end namespace Konclude |