AccumulateMemory am,
InternalWorkingMemory wm,
LeftTupleSets srcLeftTuples,
LeftTupleSets trgLeftTuples) {
Accumulate accumulate = accNode.getAccumulate();
BetaMemory bm = am.getBetaMemory();
LeftTupleMemory ltm = bm.getLeftTupleMemory();
RightTupleMemory rtm = bm.getRightTupleMemory();
ContextEntry[] contextEntry = bm.getContext();
BetaConstraints constraints = accNode.getRawConstraints();
boolean leftTupleMemoryEnabled = accNode.isLeftTupleMemoryEnabled();
if (leftTupleMemoryEnabled && srcLeftTuples.insertSize() > 32 && ltm instanceof AbstractHashTable) {
((AbstractHashTable) ltm).ensureCapacity(srcLeftTuples.insertSize());
}
for (LeftTuple leftTuple = srcLeftTuples.getInsertFirst(); leftTuple != null; ) {
LeftTuple next = leftTuple.getStagedNext();
boolean useLeftMemory = leftTupleMemoryEnabled || RuleNetworkEvaluator.useLeftMemory(accNode, leftTuple);
if (useLeftMemory) {
ltm.add(leftTuple);
}
PropagationContext context = leftTuple.getPropagationContext();
AccumulateContext accresult = new AccumulateContext();
leftTuple.setObject(accresult);
accresult.context = accumulate.createContext();
accumulate.init(am.workingMemoryContext,
accresult.context,
leftTuple,
wm);
constraints.updateFromTuple(contextEntry,