public void evaluateNetwork(PathMemory pmem, LinkedList<StackEntry> outerStack, RuleExecutor executor, InternalWorkingMemory wm) {
SegmentMemory[] smems = pmem.getSegmentMemories();
int smemIndex = 0;
SegmentMemory smem = smems[smemIndex]; // 0
LeftInputAdapterNode liaNode = (LeftInputAdapterNode) smem.getRootNode();
Set<String> visitedRules;
if (pmem.getNetworkNode().getType() == NodeTypeEnums.QueryTerminalNode) {
visitedRules = new HashSet<String>();
} else {
visitedRules = Collections.emptySet();
}
LinkedList<StackEntry> stack = new LinkedList<StackEntry>();
NetworkNode node;
Memory nodeMem;
long bit = 1;
if (liaNode == smem.getTipNode()) {
// segment only has liaNode in it
// nothing is staged in the liaNode, so skip to next segment
smem = smems[++smemIndex]; // 1
node = smem.getRootNode();
nodeMem = smem.getNodeMemories().getFirst();
} else {
// lia is in shared segment, so point to next node
bit = 2;
node = liaNode.getSinkPropagator().getFirstLeftTupleSink();
nodeMem = smem.getNodeMemories().getFirst().getNext(); // skip the liaNode memory
}
LeftTupleSets srcTuples = smem.getStagedLeftTuples().takeAll(); // need to takeAll, as this is taken alpha network
if (log.isTraceEnabled()) {