jeops.engine
Class DefaultRuleSorter

java.lang.Object
  |
  +--jeops.engine.RuleSorter
        |
        +--jeops.engine.DefaultRuleSorter

public class DefaultRuleSorter
extends RuleSorter

The default rule sorter used in this inference engine. It will be the one used to choose the apropriate rule to be fired whenever no other sorter is provided by the user. This sorter won't specify any special ordering, and will return (probably - it can be changed later) the first fireable rule.

Version:
0.01 03 Dez 1998
Author:
Carlos Figueira Filho (csff@di.ufpe.br)
See Also:
ConflictSet

Constructor Summary
DefaultRuleSorter()
          Class constructor.
 
Method Summary
 void insertRule(Rule rule)
          Inserts a rule in this sorter.
 Rule nextRule()
          Returns the next rule to be fired.
 void ruleRemoved(java.lang.String ruleName)
          Callback method, used to inform this class that a rule was removed from this sorter.
 
Methods inherited from class jeops.engine.RuleSorter
flush, isEmpty, removeNonFireableRules, removeRule, removeRulesWith
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRuleSorter

public DefaultRuleSorter()
Class constructor.
Method Detail

insertRule

public void insertRule(Rule rule)
Inserts a rule in this sorter.
Overrides:
insertRule in class RuleSorter
Parameters:
rule - the rule to be inserted.

nextRule

public Rule nextRule()
              throws NoMoreRulesException
Returns the next rule to be fired. In the return of this method, the symbolic table of the table shall be correctly filled. Also, after this method has been called, the rule (along with the instanciation that made it fireable) is removed from the conflict set.
Overrides:
nextRule in class RuleSorter
Returns:
the rule to be fired, among those that have been inserted in this object, according to the policy defined in this class.

ruleRemoved

public void ruleRemoved(java.lang.String ruleName)
Callback method, used to inform this class that a rule was removed from this sorter. It won't be needed.
Parameters:
ruleName - the name of the removed rule.