/** * Get the string representation. * @return The string representation. */ public String toString() { return rule.getName()+" needed: "+time; } }
/** * Create a string representation of the activation. */ public String toString() { return "Activation(rule="+rule.getName()+", values="+values+", priority="+priority+")"; // return "Activation(rule="+rule.getName()+" priority="+priority+" "+values.hashCode()+")"; } }
/** * Create a string representation of the activation. */ public String toString() { return "Activation(rule="+rule.getName()+", values="+values+", priority="+priority+")"; // return "Activation(rule="+rule.getName()+" priority="+priority+" "+values.hashCode()+")"; } }
/** * Get the string representation. * @return The string representation. */ public String toString() { return rule.getName()+" needed: "+time; } }
public void ruleRemoved(IRule rule) { rules.remove(rule.getName()); } };
public void ruleAdded(IRule rule) { rules.add(rule.getName()); }
/** * Get a rule with a given name. * @param name The rule name. * @return The rule. */ public IRule getRule(String name) { IRule ret = null; for(Iterator it=rules.iterator(); ret==null && it.hasNext(); ) { IRule rule = (IRule)it.next(); if(name.equals(rule.getName())) ret = rule; } if(ret==null) throw new RuntimeException("Unknown rule: "+name); return ret; }
/** * Add a rule. * @param rule The rule to add. */ public void addRule(IRule rule) { if(rules.contains(rule)) throw new RuntimeException("Rulebase already contains rule: "+rule.getName()); rules.add(rule); for(int i=0; i<listeners.size(); i++) ((IRulebaseListener)listeners.get(i)).ruleAdded(rule); }
/** * Add a rule. * @param rule The rule to add. */ public void addRule(IRule rule) { if(rules.contains(rule)) throw new RuntimeException("Rulebase already contains rule: "+rule.getName()); rules.add(rule); for(int i=0; i<listeners.size(); i++) ((IRulebaseListener)listeners.get(i)).ruleAdded(rule); }
/** * Get a rule with a given name. * @param name The rule name. * @return The rule. */ public IRule getRule(String name) { IRule ret = null; for(Iterator it=rules.iterator(); ret==null && it.hasNext(); ) { IRule rule = (IRule)it.next(); if(name.equals(rule.getName())) ret = rule; } if(ret==null) throw new RuntimeException("Unknown rule: "+name); return ret; }
/** * 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]); } } });
this.rules = new ArrayList(); for(Iterator it=rulebase.getRules().iterator(); it.hasNext(); ) rules.add(((IRule)it.next()).getName());
ret.put("Rule name:", n.getRule().getName()); ret.put("Rule:", n.getRule());
throw new RuntimeException("Cannot build constraints: "+context.getRule().getName()+", "+curcond);
throw new RuntimeException("Cannot build constraints: "+context.getRule().getName()+", "+curcond);
if(breakpoints.contains(rule.getName()))
if(breakpoints.contains(rule.getName()))
System.out.println("Warning: Assuming constant value '"+valuesource+"' in rule: "+context.getRule().getName());
System.out.println("Warning: Assuming constant value '"+valuesource+"' in rule: "+context.getRule().getName());