| 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 "CSatisfiableTaskRepresentativeBackendUpdatingAdapter.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Kernel { |
| 29 |
|
| 30 |
namespace Task { |
| 31 |
|
| 32 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter::CSatisfiableTaskRepresentativeBackendUpdatingAdapter(CIndividualPrecomputationCoordinationHash* indiComCoordHash, bool *unstatFlagPointer, bool *expansionLimitReachedFlagPointer) { |
| 33 |
mIndiCompCoordHash = indiComCoordHash; |
| 34 |
mUnstatFlagPointer = unstatFlagPointer; |
| 35 |
mExpansionLimitReachedFlagPointer = expansionLimitReachedFlagPointer; |
| 36 |
mExpansionPropagationCutted = false; |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
CIndividualPrecomputationCoordinationHash* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::getIndividualComputationCoordinationHash() { |
| 42 |
return mIndiCompCoordHash; |
| 43 |
} |
| 44 |
|
| 45 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::setIndividualComputationCoordinationHash(CIndividualPrecomputationCoordinationHash* indiComCoordHash) { |
| 46 |
mIndiCompCoordHash = indiComCoordHash; |
| 47 |
return this; |
| 48 |
} |
| 49 |
|
| 50 |
|
| 51 |
cint64 CSatisfiableTaskRepresentativeBackendUpdatingAdapter::getFirstIndividualRecomputationId() { |
| 52 |
return mFirstIndividualID; |
| 53 |
} |
| 54 |
|
| 55 |
cint64 CSatisfiableTaskRepresentativeBackendUpdatingAdapter::getRepresentativeCacheRecomputationId() { |
| 56 |
return mRepCacheCompID; |
| 57 |
} |
| 58 |
|
| 59 |
cint64 CSatisfiableTaskRepresentativeBackendUpdatingAdapter::getIndividualComputationCount() { |
| 60 |
return mIndiComputationList.count(); |
| 61 |
} |
| 62 |
|
| 63 |
cint64 CSatisfiableTaskRepresentativeBackendUpdatingAdapter::getAdditionalIndividualComputationSize() { |
| 64 |
return mAdditionalIndividualComputationCount; |
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::setAdditionalIndividualComputationSize(cint64 size) { |
| 69 |
mAdditionalIndividualComputationCount = size; |
| 70 |
return this; |
| 71 |
} |
| 72 |
|
| 73 |
|
| 74 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::setFirstIndividualRecomputationId(cint64 id) { |
| 75 |
mFirstIndividualID = id; |
| 76 |
return this; |
| 77 |
} |
| 78 |
|
| 79 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::setRepresentativeCacheRecomputationId(cint64 id) { |
| 80 |
mRepCacheCompID = id; |
| 81 |
return this; |
| 82 |
} |
| 83 |
|
| 84 |
QList<CIndividualReference>* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::getIndividualComputationList() { |
| 85 |
return &mIndiComputationList; |
| 86 |
} |
| 87 |
|
| 88 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::addIndividualComputations(QList<CIndividualReference>& indiRefList) { |
| 89 |
if (mIndiComputationList.isEmpty()) { |
| 90 |
mIndiComputationList = indiRefList; |
| 91 |
} else { |
| 92 |
mIndiComputationList.append(indiRefList); |
| 93 |
} |
| 94 |
return this; |
| 95 |
} |
| 96 |
|
| 97 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::setAllAssertionIndividualId(cint64 id) { |
| 98 |
mAllAssertionIndiID = id; |
| 99 |
return this; |
| 100 |
} |
| 101 |
|
| 102 |
cint64 CSatisfiableTaskRepresentativeBackendUpdatingAdapter::getAllAssertionIndividualId() { |
| 103 |
return mAllAssertionIndiID; |
| 104 |
} |
| 105 |
|
| 106 |
|
| 107 |
bool CSatisfiableTaskRepresentativeBackendUpdatingAdapter::hasUnsatisfiableComputed() { |
| 108 |
if (mUnstatFlagPointer) { |
| 109 |
return *mUnstatFlagPointer; |
| 110 |
} |
| 111 |
return false; |
| 112 |
} |
| 113 |
|
| 114 |
|
| 115 |
bool CSatisfiableTaskRepresentativeBackendUpdatingAdapter::hasExpansionLimitReached() { |
| 116 |
if (mExpansionLimitReachedFlagPointer) { |
| 117 |
return *mExpansionLimitReachedFlagPointer; |
| 118 |
} |
| 119 |
return false; |
| 120 |
} |
| 121 |
|
| 122 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::setExpansionLimitReached() { |
| 123 |
if (mExpansionLimitReachedFlagPointer && !hasExpansionLimitReached()) { |
| 124 |
*mExpansionLimitReachedFlagPointer = true; |
| 125 |
} |
| 126 |
return this; |
| 127 |
} |
| 128 |
|
| 129 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::setUnsatisfiableComputed() { |
| 130 |
if (mUnstatFlagPointer && !hasUnsatisfiableComputed()) { |
| 131 |
*mUnstatFlagPointer = true; |
| 132 |
} |
| 133 |
return this; |
| 134 |
} |
| 135 |
|
| 136 |
bool CSatisfiableTaskRepresentativeBackendUpdatingAdapter::isExpansionPropagationCutted() { |
| 137 |
return mExpansionPropagationCutted; |
| 138 |
} |
| 139 |
|
| 140 |
CSatisfiableTaskRepresentativeBackendUpdatingAdapter* CSatisfiableTaskRepresentativeBackendUpdatingAdapter::setExpansionPropagationCutted(bool cutted) { |
| 141 |
mExpansionPropagationCutted = cutted; |
| 142 |
return this; |
| 143 |
} |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
}; // end namespace Task |
| 148 |
|
| 149 |
}; // end namespace Kernel |
| 150 |
|
| 151 |
}; // end namespace Reasoner |
| 152 |
|
| 153 |
}; // end namespace Konclude |