@Test public void testAddAndRemoveInputWme() throws Exception { final InputWme[] wme = { null }; agent.getEvents().addListener(InputEvent.class, new SoarEventListener() { @Override public void onEvent(SoarEvent event) { if(wme[0] == null) { InputBuilder builder = InputBuilder.create(agent.getInputOutput()); builder.add("location", "ann arbor").markWme("wme"); wme[0] = builder.getWme("wme"); } else { wme[0].remove(); } }}); sourceTestFile("testAddAndRemoveInputWme.soar"); agent.runFor(1, RunType.DECISIONS); assertEquals(1, match.calls.size()); assertEquals("added", match.calls.get(0).get(0).toString()); agent.runFor(1, RunType.DECISIONS); assertEquals(2, match.calls.size()); assertEquals("removed", match.calls.get(1).get(0).toString()); }
@Override public SoarEventManager getEvents() { return context.getEvents(); }
InputOutputImpl implements InputOutput, WmeFactory<InputWme> { @Override public SoarEventManager getEvents() { return context.getEvents(); } }
InputOutputImpl implements InputOutput, WmeFactory<InputWme> { @Override public SoarEventManager getEvents() { return context.getEvents(); } InputOutputImpl(Agent context); }
InputOutputImpl implements InputOutput, WmeFactory<InputWme> { @Override public SoarEventManager getEvents() { return context.getEvents(); } InputOutputImpl(Agent context); void initialize(); @Override WmeFactory<InputWme> asWmeFactory(); @Override InputWme addWme(Identifier id, Symbol attr, Symbol value); @Override SymbolFactory getSymbols(); @Override SoarEventManager getEvents(); void init_agent_memory(); @Override Identifier getInputLink(); @Override Identifier getOutputLink(); @Override InputWme addInputWme(Identifier id, Symbol attr, Symbol value); WmeImpl addInputWmeInternal(Identifier id, Symbol attr, Symbol value); void removeInputWmeInternal(WmeImpl w); @Override List<Wme> getPendingCommands(); @Override List<Wme> getRemovingCommands(); @Override void asynchronousInputReady(); void do_input_cycle(); void inform_output_module_of_wm_changes(ListHead<WmeImpl> wmes_being_added, ListHead<WmeImpl> wmes_being_removed); void do_output_cycle(); boolean isOutputLinkChanged(); }
InputOutputImpl implements InputOutput, WmeFactory<InputWme> { @Override public SoarEventManager getEvents() { return context.getEvents(); } InputOutputImpl(Agent context); void initialize(); @Override WmeFactory<InputWme> asWmeFactory(); @Override InputWme addWme(Identifier id, Symbol attr, Symbol value); @Override SymbolFactory getSymbols(); @Override SoarEventManager getEvents(); void init_agent_memory(); @Override Identifier getInputLink(); @Override Identifier getOutputLink(); @Override InputWme addInputWme(Identifier id, Symbol attr, Symbol value); WmeImpl addInputWmeInternal(Identifier id, Symbol attr, Symbol value); void removeInputWmeInternal(WmeImpl w); @Override List<Wme> getPendingCommands(); @Override List<Wme> getRemovingCommands(); @Override void asynchronousInputReady(); void do_input_cycle(); void inform_output_module_of_wm_changes(ListHead<WmeImpl> wmes_being_added, ListHead<WmeImpl> wmes_being_removed); void do_output_cycle(); boolean isOutputLinkChanged();  }