boolean check = checkConstraints(object, state);
boolean check = checkConstraints(object, state);
/** * 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); }
/** * 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); }
boolean check = checkConstraints(object, state);
boolean check = checkConstraints(object, state);