@Test public void testGetWmes() throws Exception { agent.getProductions().loadProduction("testGetWmes " + "(state <s> ^superstate nil)" + "-->" + "(<s> ^test <w>)" + "(<w> ^a 1 ^b 2 ^c 3 ^d 4)"); agent.runFor(1, RunType.DECISIONS); final Identifier id = agent.getSymbols().findIdentifier('S', 1); assertNotNull(id); final MatcherBuilder m = Wmes.matcher(agent); final Wme test = m.attr("test").find(id); assertNotNull(test); List<Wme> kids = new ArrayList<Wme>(); final Identifier testId = test.getValue().asIdentifier(); Iterators.addAll(kids, testId.getWmes()); assertEquals(4, kids.size()); assertNotNull(m.reset().attr("a").value(1).find(kids)); assertNotNull(m.reset().attr("b").value(2).find(kids)); assertNotNull(m.reset().attr("c").value(3).find(kids)); assertNotNull(m.reset().attr("d").value(4).find(kids)); }
@Override public Iterator<Wme> getWmes() { return Iterators.concat(new WmeIteratorSet(this)); }
IdentifierImpl extends SymbolImpl implements Identifier { @Override public Iterator<Wme> getWmes() { return Iterators.concat(new WmeIteratorSet(this)); } }
IdentifierImpl extends SymbolImpl implements Identifier { @Override public Iterator<Wme> getWmes() { return Iterators.concat(new WmeIteratorSet(this)); } IdentifierImpl(SymbolFactory factory, int hash_id, char name_letter, long name_number); }
IdentifierImpl extends SymbolImpl implements Identifier { @Override public Iterator<Wme> getWmes() { return Iterators.concat(new WmeIteratorSet(this)); } IdentifierImpl(SymbolFactory factory, int hash_id, char name_letter, long name_number); @Override char getNameLetter(); @Override long getNameNumber(); @Override Iterator<Wme> getWmes(); @Override Iterator<Wme> getWmes(EnumSet<WmeType> desired); @Override IdentifierImpl asIdentifier(); @Override boolean isSameTypeAs(SymbolImpl other); @Override char getFirstLetter(); @Override boolean isGoal(); @Override boolean isOperator(); WmeImpl getInputWmes(); void addInputWme(WmeImpl w); void removeInputWme(WmeImpl w); void removeAllInputWmes(); static void unmark(ListHead<IdentifierImpl> ids); void addSlot(Slot slot); void removeSlot(Slot slot); @Override void add_symbol_to_tc(Marker tc, ListHead<IdentifierImpl> id_list, ListHead<Variable> var_list); @Override boolean symbol_is_in_tc(Marker tc); @Override boolean numericLess(SymbolImpl other); @Override boolean numericLessOrEqual(SymbolImpl other); @Override boolean numericGreater(SymbolImpl other); @Override boolean numericGreaterOrEqual(SymbolImpl other); @Override String toString(); @Override void formatTo(Formatter formatter, int flags, int width, int precision); @Override Object getAdapter(Class<?> klass); }
IdentifierImpl extends SymbolImpl implements Identifier { @Override public Iterator<Wme> getWmes() { return Iterators.concat(new WmeIteratorSet(this)); } IdentifierImpl(SymbolFactory factory, int hash_id, char name_letter, long name_number); @Override char getNameLetter(); @Override long getNameNumber(); @Override Iterator<Wme> getWmes(); @Override Iterator<Wme> getWmes(EnumSet<WmeType> desired); @Override IdentifierImpl asIdentifier(); @Override boolean isSameTypeAs(SymbolImpl other); @Override char getFirstLetter(); @Override boolean isGoal(); @Override boolean isOperator(); WmeImpl getInputWmes(); void addInputWme(WmeImpl w); void removeInputWme(WmeImpl w); void removeAllInputWmes(); static void unmark(ListHead<IdentifierImpl> ids); void addSlot(Slot slot); void removeSlot(Slot slot); @Override void add_symbol_to_tc(Marker tc, ListHead<IdentifierImpl> id_list, ListHead<Variable> var_list); @Override boolean symbol_is_in_tc(Marker tc); @Override boolean numericLess(SymbolImpl other); @Override boolean numericLessOrEqual(SymbolImpl other); @Override boolean numericGreater(SymbolImpl other); @Override boolean numericGreaterOrEqual(SymbolImpl other); @Override String toString(); @Override void formatTo(Formatter formatter, int flags, int width, int precision); @Override Object getAdapter(Class<?> klass); public short isa_operator; public boolean could_be_a_link_from_below; public int level; public int promotion_level; public int link_count; public ListItem<IdentifierImpl> unknown_level; public Slot slots; public Marker tc_number; public SymbolImpl variablization; public GoalIdentifierInfo goalInfo; public int depth; public long smem_lti; public long smem_time_id; public long id_smem_valid; public long epmem_id; public long epmem_valid; }