public void actionPerformed(ActionEvent e) { steppable.setStepmode(stepmode.isSelected()); step.setEnabled(steppable.isStepmode() && !system.getAgenda().isEmpty()); } });
next = system.getAgenda().getNextActivation();
/** * Dispose the panel and remove any listeners. */ public void dispose() { ap.dispose(); rulebasepanel.dispose(); system.getAgenda().removeAgendaListener(agendalistener); }
/** * Test if the component's execution is currently at one of the * given breakpoints. If yes, the component will be suspended by * the platform. * @param breakpoints An array of breakpoints. * @return True, when some breakpoint is triggered. */ public boolean isAtBreakpoint(String[] breakpoints) { // assert isAgentThread(); assert !getAgentAdapter().isExternalThread(); boolean isatbreakpoint = false; Object cs = state.getAttributeValue(ragent, OAVBDIRuntimeModel.agent_has_state); if(cs!=null && !OAVBDIRuntimeModel.AGENTLIFECYCLESTATE_TERMINATED.equals(cs)) { Set bps = new HashSet(Arrays.asList(breakpoints)); // Todo: cache set across invocations for speed? Iterator it = getRuleSystem().getAgenda().getActivations().iterator(); while(!isatbreakpoint && it.hasNext()) { IRule rule = ((Activation)it.next()).getRule(); isatbreakpoint = bps.contains(rule.getName()); } } // else still in init return isatbreakpoint; }
public void actionPerformed(ActionEvent e) { if(followact.isSelected()) { Activation act = system.getAgenda().getNextActivation(); if(act!=null && followact.isSelected()) { rulebasepanel.setSelectedBreakpoints(new String[]{act.getRule().getName()}); } } else { rulebasepanel.setSelectedBreakpoints(new String[0]); } } });
/** * Start monitoring the consequences. */ public void startMonitorConsequences() { if(microplansteps && getRuleSystem().isInited()) { monitor_consequences++; if(monitor_consequences==1) agenda_state = getRuleSystem().getAgenda().getState(); } }
/** * Fire all rules until quiescence. */ public void fireAllRules() { IAgenda agenda = getAgenda(); state.notifyEventListeners(); do { agenda.fireRule(); state.expungeStaleObjects(); state.notifyEventListeners(); } while(!agenda.isEmpty()); }
/** * Fire all rules until quiescence. */ public void fireAllRules() { IAgenda agenda = getAgenda(); state.notifyEventListeners(); do { agenda.fireRule(); state.expungeStaleObjects(); state.notifyEventListeners(); } while(!agenda.isEmpty()); }
tmp.add(np, BorderLayout.CENTER); tmp.add(buts, BorderLayout.SOUTH); this.ap = new AgendaPanel(system.getAgenda()); JPanel tmp3 = new JPanel(new BorderLayout()); final JCheckBox followact = new JCheckBox("Follow activation", true); step.setEnabled(steppable.isStepmode() && !system.getAgenda().isEmpty()); final JCheckBox stepmode = new JCheckBox("Step Mode", steppable.isStepmode()); stepmode.addActionListener(new ActionListener() system.getAgenda().addAgendaListener(agendalistener); followact.addActionListener(new ActionListener() if(followact.isSelected()) Activation act = system.getAgenda().getNextActivation(); if(act!=null && followact.isSelected())
Activation act = rulesystem.getAgenda().getLastActivation(); state.getProfiler().start(IProfiler.TYPE_RULE, act!=null?act.getRule():null); state.expungeStaleObjects(); state.getProfiler().stop(IProfiler.TYPE_RULE, act!=null?act.getRule():null); if(!rulesystem.getAgenda().isEmpty()) rulesystem.getAgenda().fireRule(); act = rulesystem.getAgenda().getLastActivation(); return !rulesystem.getAgenda().isEmpty();
if(agenda_state!=getRuleSystem().getAgenda().getState())