/** * Add a new tuple to this node. * @param tuple The tuple. */ public void addTuple(Tuple tuple, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { //System.out.println("Add tuple called: "+this+" "+tuple); state.getProfiler().start(IProfiler.TYPE_NODE, this); state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_TUPLEADDED); Collection tmem = (Collection)mem.getNodeMemory(this); if(!tmem.contains(tuple) && evaluator.evaluate(null, tuple, state)) { tmem.add(tuple); //System.out.println("Tuple passed constraint check: "+this+" "+object); propagateAdditionToTupleConsumers(tuple, state, mem, agenda); } state.getProfiler().stop(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_TUPLEADDED); state.getProfiler().stop(IProfiler.TYPE_NODE, this); }
/** * Add a new tuple to this node. * @param tuple The tuple. */ public void addTuple(Tuple tuple, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { //System.out.println("Add tuple called: "+this+" "+tuple); state.getProfiler().start(IProfiler.TYPE_NODE, this); state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_TUPLEADDED); Collection tmem = (Collection)mem.getNodeMemory(this); if(!tmem.contains(tuple) && evaluator.evaluate(null, tuple, state)) { tmem.add(tuple); //System.out.println("Tuple passed constraint check: "+this+" "+object); propagateAdditionToTupleConsumers(tuple, state, mem, agenda); } state.getProfiler().stop(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_TUPLEADDED); state.getProfiler().stop(IProfiler.TYPE_NODE, this); }
propagateAdditionToTupleConsumers(tuple, state, mem, agenda);
propagateAdditionToTupleConsumers(tuple, state, mem, agenda);