/** * 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; }
/** * 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)); }
/** * Send a removed object to this node. * @param object The object. */ public void removeObject(Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { //System.out.println("Remove object called: "+this+" "+object); state.getProfiler().start(IProfiler.TYPE_NODE, this); state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTREMOVED); if(mem.hasNodeMemory(this) && ((Collection)mem.getNodeMemory(this)).remove(object)) { //System.out.println("Object passed constraint check: "+this+" "+object); propagateRemovalToObjectConsumers(object, state, mem, agenda); } state.getProfiler().stop(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTREMOVED); state.getProfiler().stop(IProfiler.TYPE_NODE, this); }
/** * Send a removed object to this node. * @param object The object. */ public void removeObject(Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { //System.out.println("Remove object called: "+this+" "+object); state.getProfiler().start(IProfiler.TYPE_NODE, this); state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTREMOVED); if(mem.hasNodeMemory(this) && ((Collection)mem.getNodeMemory(this)).remove(object)) { //System.out.println("Object passed constraint check: "+this+" "+object); propagateRemovalToObjectConsumers(object, state, mem, agenda); } state.getProfiler().stop(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTREMOVED); state.getProfiler().stop(IProfiler.TYPE_NODE, this); }