/** * Create a pattern matcher instance for a given state. */ public IPatternMatcherState createMatcherState(IOAVState state, AbstractAgenda agenda) { return new RetePatternMatcherState(node, state, new ReteMemory(state), agenda); }
/** * Initialize the pattern matcher. * Called before the agenda is accessed * to perform any initialization, if necessary. */ public void init() { // Initialize initial fact node, if any. if(node.getInitialFactNode()!=null) node.getInitialFactNode().init(state, retemem, agenda); // Add initial objects. for(Iterator objects=state.getDeepObjects(); objects.hasNext(); ) { Object object = objects.next(); objectAdded(object, state.getType(object), false); // Hack!!! Should check if root? } state.addStateListener(this, true); // state.addStateListener(this, false); }
final ReteMemory mem = ((RetePatternMatcherState)system.getMatcherState()).getReteMemory(); this.g = new DirectedSparseGraph(); buildGraph(g, root);
/** * Initialize the pattern matcher. * Called before the agenda is accessed * to perform any initialization, if necessary. */ public void init() { // Initialize initial fact node, if any. if(node.getInitialFactNode()!=null) node.getInitialFactNode().init(state, retemem, agenda); // Add initial objects. for(Iterator objects=state.getDeepObjects(); objects.hasNext(); ) { Object object = objects.next(); objectAdded(object, state.getType(object), false); // Hack!!! Should check if root? } state.addStateListener(this, true); // state.addStateListener(this, false); }
System.out.println("Rete memory: "+((RetePatternMatcherState)system.getMatcherState()).getReteMemory());
/** * Create a pattern matcher instance for a given state. */ public IPatternMatcherState createMatcherState(IOAVState state, AbstractAgenda agenda) { return new RetePatternMatcherState(node, state, new ReteMemory(state), agenda); }