/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? (Collection)mem.getNodeMemory(this) : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? (Collection)mem.getNodeMemory(this) : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? (Collection)mem.getNodeMemory(this) : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? (Collection)mem.getNodeMemory(this) : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? (Collection)mem.getNodeMemory(this) : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? (Collection)mem.getNodeMemory(this) : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? (Collection)mem.getNodeMemory(this) : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? (Collection)mem.getNodeMemory(this) : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { Collection ret = null; if(mem.hasNodeMemory(this)) { // todo: can storage be optimized?! -> flattened multi-collection ret = new ArrayList(); for(Iterator it=((Map)mem.getNodeMemory(this)).values().iterator(); it.hasNext(); ) ret.addAll((Collection)it.next()); } return ret; }
/** * Check if a match is contained. */ protected boolean isMatchContained(IOAVState state, Tuple left, Object right, ReteMemory mem) { boolean ret = false; if(mem.hasNodeMemory(this)) { NotMemory nomem = (NotMemory)mem.getNodeMemory(this); Set mappings = nomem.getMappings(left); ret = mappings!=null && mappings.contains(right); } return ret; }
/** * Check if a match is contained. */ protected boolean isMatchContained(IOAVState state, Tuple left, Object right, ReteMemory mem) { boolean ret = false; if(mem.hasNodeMemory(this)) { NotMemory nomem = (NotMemory)mem.getNodeMemory(this); Set mappings = nomem.getMappings(left); ret = mappings!=null && mappings.contains(right); } return ret; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? ((BetaMemory)mem.getNodeMemory(this)).getResultMemory() : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? ((BetaMemory)mem.getNodeMemory(this)).getResultMemory() : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? ((CollectMemory)mem.getNodeMemory(this)).getResultMemory() : null; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { return mem.hasNodeMemory(this) ? ((CollectMemory)mem.getNodeMemory(this)).getResultMemory() : null; }
/** * Check if a match is contained. */ protected boolean isMatchContained(IOAVState state, Tuple left, Object right, ReteMemory mem) { return mem.hasNodeMemory(this) && ((BetaMemory)mem.getNodeMemory(this)).getResultMemory() .contains(mem.getTuple(state, left, right)); }
/** * Check if a match is contained. */ protected boolean isMatchContained(IOAVState state, Tuple left, Object right, ReteMemory mem) { return mem.hasNodeMemory(this) && ((BetaMemory)mem.getNodeMemory(this)).getResultMemory() .contains(mem.getTuple(state, left, right)); }
/** * Add a match to the node memory and propagate if necessary. */ protected void addMatch(Tuple left, Object right, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { Tuple result = mem.getTuple(state, left, right); BetaMemory bmem = (BetaMemory)mem.getNodeMemory(this); if(bmem.addResultTuple(result)) { ITupleConsumerNode[] tcs = tconsumers; for(int j=0; tcs!=null && j<tcs.length; j++) tcs[j].addTuple(result, state, mem, agenda); } }
/** * Add a match to the node memory and propagate if necessary. */ protected void addMatch(Tuple left, Object right, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { Tuple result = mem.getTuple(state, left, right); BetaMemory bmem = (BetaMemory)mem.getNodeMemory(this); if(bmem.addResultTuple(result)) { ITupleConsumerNode[] tcs = tconsumers; for(int j=0; tcs!=null && j<tcs.length; j++) tcs[j].addTuple(result, state, mem, agenda); } }
/** * Add a match to the node memory and propagate if necessary. */ protected void addMatch(Tuple left, Object right, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { // if(getNodeId()==1137) // System.out.println(this+".addMatch: "+left+", "+right); NotMemory nomem = (NotMemory)mem.getNodeMemory(this); nomem.addMapping(state, left, right); if(!nomem.isDelay() && nomem.removeResultTuple(left)) { ITupleConsumerNode[] tcs = tconsumers; for(int j=0; tcs!=null && j<tcs.length; j++) tcs[j].removeTuple(left, state, mem, agenda); } }