| 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 "CBackendNeighbourExpansionQueueDataLinker.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Kernel { |
| 29 |
|
| 30 |
namespace Process { |
| 31 |
|
| 32 |
CBackendNeighbourExpansionQueueDataLinker::CBackendNeighbourExpansionQueueDataLinker(CProcessContext* processContext) { |
| 33 |
setData(this); |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
CBackendNeighbourExpansionQueueDataLinker* CBackendNeighbourExpansionQueueDataLinker::initQueueData(CBackendNeighbourExpansionQueueDataLinker* queueData) { |
| 38 |
if (queueData) { |
| 39 |
mRole = queueData->mRole; |
| 40 |
mConcept = queueData->mConcept; |
| 41 |
mConNegation = queueData->mConNegation; |
| 42 |
mConceptNondeterministic = queueData->mConceptNondeterministic; |
| 43 |
mBaseIndiNode = queueData->mBaseIndiNode; |
| 44 |
mBackendSyncDataIndiNode = queueData->mBackendSyncDataIndiNode; |
| 45 |
mLastExpandedNeighbourId = queueData->mLastExpandedNeighbourId; |
| 46 |
mNeighbourVisitingCursor = queueData->mNeighbourVisitingCursor; |
| 47 |
mNeighbourArrayId = queueData->mNeighbourArrayId; |
| 48 |
mForceExpansion = queueData->mForceExpansion; |
| 49 |
mPropagationCutExpansion = queueData->mPropagationCutExpansion; |
| 50 |
mLabel = queueData->mLabel; |
| 51 |
mMissingNondeterministicExpansionPropagation = queueData->mMissingNondeterministicExpansionPropagation; |
| 52 |
} else { |
| 53 |
mRole = nullptr; |
| 54 |
mConcept = nullptr; |
| 55 |
mConNegation = false; |
| 56 |
mConceptNondeterministic = false; |
| 57 |
mBaseIndiNode = nullptr; |
| 58 |
mBackendSyncDataIndiNode = nullptr; |
| 59 |
mLastExpandedNeighbourId = -1; |
| 60 |
mNeighbourVisitingCursor = 0; |
| 61 |
mNeighbourArrayId = -1; |
| 62 |
mForceExpansion = false; |
| 63 |
mPropagationCutExpansion = false; |
| 64 |
mLabel = nullptr; |
| 65 |
mMissingNondeterministicExpansionPropagation = false; |
| 66 |
} |
| 67 |
return this; |
| 68 |
} |
| 69 |
|
| 70 |
CBackendNeighbourExpansionQueueDataLinker* CBackendNeighbourExpansionQueueDataLinker::initQueueData(cint64 neighbourArrayId, CRole* role, CConcept* concept, bool conNegation, bool nondeterministic, bool forceExpansion, CIndividualProcessNode* baseIndiNode, CIndividualProcessNode* backendSyncDataIndiNode, cint64 lastExpandedNeighbourId, cint64 neighbourVisitingCoursor, bool propagationCutExpansion, bool missingNondeterministicExpansionPropagation) { |
| 71 |
mRole = role; |
| 72 |
mConcept = concept; |
| 73 |
mConNegation = conNegation; |
| 74 |
mConceptNondeterministic = nondeterministic; |
| 75 |
mBaseIndiNode = baseIndiNode; |
| 76 |
mBackendSyncDataIndiNode = backendSyncDataIndiNode; |
| 77 |
mLastExpandedNeighbourId = lastExpandedNeighbourId; |
| 78 |
mNeighbourVisitingCursor = neighbourVisitingCoursor; |
| 79 |
mNeighbourArrayId = neighbourArrayId; |
| 80 |
mForceExpansion = forceExpansion; |
| 81 |
mLabel = nullptr; |
| 82 |
mPropagationCutExpansion = propagationCutExpansion; |
| 83 |
mMissingNondeterministicExpansionPropagation = missingNondeterministicExpansionPropagation; |
| 84 |
return this; |
| 85 |
} |
| 86 |
|
| 87 |
CBackendRepresentativeMemoryLabelCacheItem* CBackendNeighbourExpansionQueueDataLinker::getExpandingLabel() { |
| 88 |
return mLabel; |
| 89 |
} |
| 90 |
|
| 91 |
CBackendNeighbourExpansionQueueDataLinker* CBackendNeighbourExpansionQueueDataLinker::setExpandingLabel(CBackendRepresentativeMemoryLabelCacheItem* label) { |
| 92 |
mLabel = label; |
| 93 |
return this; |
| 94 |
} |
| 95 |
|
| 96 |
|
| 97 |
CBackendNeighbourExpansionQueueDataLinker* CBackendNeighbourExpansionQueueDataLinker::updateNeighbourExpansionCursor(cint64 lastExpandedNeighbourId, cint64 neighbourVisitingCoursor) { |
| 98 |
mLastExpandedNeighbourId = lastExpandedNeighbourId; |
| 99 |
mNeighbourVisitingCursor = neighbourVisitingCoursor; |
| 100 |
return this; |
| 101 |
} |
| 102 |
|
| 103 |
cint64 CBackendNeighbourExpansionQueueDataLinker::getNeighbourArrayId() { |
| 104 |
return mNeighbourArrayId; |
| 105 |
} |
| 106 |
|
| 107 |
bool CBackendNeighbourExpansionQueueDataLinker::isForceExpansion() { |
| 108 |
return mForceExpansion; |
| 109 |
} |
| 110 |
|
| 111 |
bool CBackendNeighbourExpansionQueueDataLinker::isPropagationCutExpansion() { |
| 112 |
return mPropagationCutExpansion; |
| 113 |
} |
| 114 |
|
| 115 |
|
| 116 |
CRole* CBackendNeighbourExpansionQueueDataLinker::getRole() { |
| 117 |
return mRole; |
| 118 |
} |
| 119 |
|
| 120 |
CConcept* CBackendNeighbourExpansionQueueDataLinker::getConcept() { |
| 121 |
return mConcept; |
| 122 |
} |
| 123 |
|
| 124 |
bool CBackendNeighbourExpansionQueueDataLinker::getConceptNegation() { |
| 125 |
return mConNegation; |
| 126 |
} |
| 127 |
|
| 128 |
bool CBackendNeighbourExpansionQueueDataLinker::getConceptNondeterministic() { |
| 129 |
return mConceptNondeterministic; |
| 130 |
} |
| 131 |
|
| 132 |
CIndividualProcessNode* CBackendNeighbourExpansionQueueDataLinker::getBaseIndividualNode() { |
| 133 |
return mBaseIndiNode; |
| 134 |
} |
| 135 |
|
| 136 |
CIndividualProcessNode* CBackendNeighbourExpansionQueueDataLinker::getBackendSyncDataIndividualNode() { |
| 137 |
return mBackendSyncDataIndiNode; |
| 138 |
} |
| 139 |
|
| 140 |
cint64 CBackendNeighbourExpansionQueueDataLinker::getLastExpandedNeighbourId() { |
| 141 |
return mLastExpandedNeighbourId; |
| 142 |
} |
| 143 |
|
| 144 |
cint64 CBackendNeighbourExpansionQueueDataLinker::getNeighbourVisitingCursor() { |
| 145 |
return mNeighbourVisitingCursor; |
| 146 |
} |
| 147 |
|
| 148 |
|
| 149 |
bool CBackendNeighbourExpansionQueueDataLinker::isMissingNondeterministicExpansionPropagation() { |
| 150 |
return mMissingNondeterministicExpansionPropagation; |
| 151 |
} |
| 152 |
|
| 153 |
CBackendNeighbourExpansionQueueDataLinker* CBackendNeighbourExpansionQueueDataLinker::setMissingNondeterministicExpansionPropagation(bool missingProp) { |
| 154 |
mMissingNondeterministicExpansionPropagation = missingProp; |
| 155 |
return this; |
| 156 |
} |
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
}; // end namespace Process |
| 161 |
|
| 162 |
}; // end namespace Kernel |
| 163 |
|
| 164 |
}; // end namespace Reasoner |
| 165 |
|
| 166 |
}; // end namespace Konclude |