state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTMODIFIED); if(getRelevantAttributes().contains(type)) boolean affected = isAffected(type); boolean contains = mem.hasNodeMemory(this) && ((Collection)mem.getNodeMemory(this)).contains(object); boolean check = checkConstraints(object, state); propagateRemovalToObjectConsumers(object, state, mem, agenda); propagateAdditionToObjectConsumers(object, state, mem, agenda); propagateModificationToObjectConsumers(object, type, oldvalue, newvalue, state, mem, agenda); propagateModificationToObjectConsumers(object, type, oldvalue, newvalue, state, mem, agenda);
Collection oldmem = getNodeMemory(mem); Collection input = getObjectSource().getNodeMemory(mem); if(input!=null) boolean check = checkConstraints(object, state); propagateRemovalToObjectConsumers(object, state, mem, agenda); propagateAdditionToObjectConsumers(object, state, mem, agenda);
if(Arrays.equals(anode.getConstraintEvaluators(), evas)) node = new AlphaNode(context.getRootNode().getNextNodeId(), evas); connectRight(context.getLastAlphaNode(), node, context);
/** * Send a new object to this node. * @param object The object. */ public void addObject(Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { //System.out.println("Add object called: "+this+" "+object); // if(object.getClass().toString().indexOf("Order")!=-1) // System.out.println("here: "+object); // if(state.getType(object).getName().indexOf("goal")!=-1) // System.out.println("here: "+object); state.getProfiler().start(IProfiler.TYPE_NODE, this); state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTADDED); assert !mem.hasNodeMemory(this) || !((Collection)mem.getNodeMemory(this)).contains(object) : "New objects shouldn't be contained."; if(checkConstraints(object, state)) { ((Collection)mem.getNodeMemory(this)).add(object); //System.out.println("Object passed constraint check: "+this+" "+object); propagateAdditionToObjectConsumers(object, state, mem, agenda); } state.getProfiler().stop(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTADDED); state.getProfiler().stop(IProfiler.TYPE_NODE, this); }
IConstraintEvaluator[] evas = n.getConstraintEvaluators(); for(int i=0; evas!=null && i<evas.length; i++)
/** * Tell the condition system about a * new object in the state. * @param object The new object. */ public void addObject(Object id, OAVObjectType type, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { // if(type.getName().equals("goal")) // System.out.println("Value added: "+id+" "+type); // System.out.println("Value added: "+id+" "+type); state.getProfiler().start(IProfiler.TYPE_NODE, this); state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTADDED); Set tns = getTypeNodes(type); if(tns!=null) { for(Iterator it=tns.iterator(); it.hasNext(); ) ((AlphaNode)it.next()).addObject(id, state, mem, agenda); assert !check || checkConsistency(mem); } // else // System.out.println("No typenode(s) available for: "+type); state.getProfiler().stop(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTADDED); state.getProfiler().stop(IProfiler.TYPE_NODE, this); }
if(Arrays.equals(anode.getConstraintEvaluators(), evas)) node = new AlphaNode(context.getRootNode().getNextNodeId(), evas); connectRight(context.getLastAlphaNode(), node, context);
/** * Send a new object to this node. * @param object The object. */ public void addObject(Object object, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { //System.out.println("Add object called: "+this+" "+object); // if(object.getClass().toString().indexOf("Order")!=-1) // System.out.println("here: "+object); // if(state.getType(object).getName().indexOf("goal")!=-1) // System.out.println("here: "+object); state.getProfiler().start(IProfiler.TYPE_NODE, this); state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTADDED); assert !mem.hasNodeMemory(this) || !((Collection)mem.getNodeMemory(this)).contains(object) : "New objects shouldn't be contained."; if(checkConstraints(object, state)) { ((Collection)mem.getNodeMemory(this)).add(object); //System.out.println("Object passed constraint check: "+this+" "+object); propagateAdditionToObjectConsumers(object, state, mem, agenda); } state.getProfiler().stop(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTADDED); state.getProfiler().stop(IProfiler.TYPE_NODE, this); }
/** * Tell the condition system about a * new object in the state. * @param object The new object. */ public void addObject(Object id, OAVObjectType type, IOAVState state, ReteMemory mem, AbstractAgenda agenda) { // if(type.getName().equals("goal")) // System.out.println("Value added: "+id+" "+type); // System.out.println("Value added: "+id+" "+type); state.getProfiler().start(IProfiler.TYPE_NODE, this); state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTADDED); Set tns = getTypeNodes(type); if(tns!=null) { for(Iterator it=tns.iterator(); it.hasNext(); ) ((AlphaNode)it.next()).addObject(id, state, mem, agenda); assert !check || checkConsistency(mem); } // else // System.out.println("No typenode(s) available for: "+type); state.getProfiler().stop(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTADDED); state.getProfiler().stop(IProfiler.TYPE_NODE, this); }
state.getProfiler().start(IProfiler.TYPE_NODEEVENT, IProfiler.NODEEVENT_OBJECTMODIFIED); if(getRelevantAttributes().contains(type)) boolean affected = isAffected(type); boolean contains = mem.hasNodeMemory(this) && ((Collection)mem.getNodeMemory(this)).contains(object); boolean check = checkConstraints(object, state); propagateRemovalToObjectConsumers(object, state, mem, agenda); propagateAdditionToObjectConsumers(object, state, mem, agenda); propagateModificationToObjectConsumers(object, type, oldvalue, newvalue, state, mem, agenda); propagateModificationToObjectConsumers(object, type, oldvalue, newvalue, state, mem, agenda);
Collection oldmem = getNodeMemory(mem); Collection input = getObjectSource().getNodeMemory(mem); if(input!=null) boolean check = checkConstraints(object, state); propagateRemovalToObjectConsumers(object, state, mem, agenda); propagateAdditionToObjectConsumers(object, state, mem, agenda);