|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.ai.expertsystem.AbstractRuleBase
public abstract class AbstractRuleBase
A generic rule base of Jeops. Objects of this class represent rule bases that can be treated generically by any knowledge base.
| Constructor Summary | |
|---|---|
AbstractRuleBase(AbstractKnowledgeBase knowledgeBase)
Class constructor. |
|
| Method Summary | |
|---|---|
abstract boolean |
checkCondForDeclaration(int ruleIndex,
int declIndex)
Checks whether all the conditions of a rule which reference only the elements declared up to the given index are true. |
abstract boolean |
checkCondition(int ruleIndex,
int condIndex)
Checks whether a condition of some rule in this rule base is satisfied. |
abstract boolean |
checkConditionsOnlyOf(int ruleIndex,
int declIndex)
Checks whether all conditions of some rule that depend only on the given object are satisfied, not counting the local declarations. |
java.lang.Object |
clone()
Creates a copy of this object. |
boolean |
equals(java.lang.Object obj)
|
void |
fireRule(int ruleIndex)
Fires one of the rules in this rule base. |
void |
flush()
Removes all the objects from this rule base. |
abstract java.lang.Class |
getDeclaredClass(int ruleIndex,
int declarationIndex)
Returns the class of an object declared in a rule. |
abstract java.lang.String |
getDeclaredClassName(int ruleIndex,
int declarationIndex)
Returns the class name of an object declared in a rule. |
abstract java.lang.String[] |
getDeclaredIdentifiers(int ruleIndex)
Returns the identifiers declared in a given rule. |
abstract int[] |
getNumberOfConditions()
Returns the number of conditions of the rules in this rule base. |
abstract int[] |
getNumberOfDeclarations()
Returns the number of declarations of the rules in this rule base. |
abstract int |
getNumberOfRules()
Returns the number of rules in this base. |
abstract java.lang.Object |
getObject(int ruleIndex,
int declarationIndex)
Returns an object that represents a declaration of some rule. |
abstract java.lang.Object[] |
getObjects(int ruleIndex)
Returns all variables bound to the declarations of some rule. |
int |
getRuleIndex()
Returns the index of the rule that has the focus. |
abstract java.lang.String[] |
getRuleNames()
Returns the name of the rules in this rule base. |
int |
hashCode()
|
void |
insert(java.lang.Object obj)
Adds an object into this rule base. |
protected abstract void |
internalFireRule(int ruleIndex)
Fires one of the rules in this rule base. |
void |
modified(java.lang.Object obj)
Tells this base that an object was modified, so that the rules can be retested against the object. |
void |
retract(java.lang.Object obj)
Removes an object from this rule base. |
abstract void |
setObject(int ruleIndex,
int declarationIndex,
java.lang.Object value)
Sets an object that represents a declaration of some rule. |
abstract void |
setObjects(int ruleIndex,
java.lang.Object[] objects)
Defines all variables bound to the declarations of some rule. |
void |
setRuleIndex(int value)
Defines the index of the rule that has the focus. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractRuleBase(AbstractKnowledgeBase knowledgeBase)
knowledgeBase - the knowledge base that contains this rule base.| Method Detail |
|---|
public void insert(java.lang.Object obj)
obj - the object to be inserted into this base.
public abstract boolean checkConditionsOnlyOf(int ruleIndex,
int declIndex)
ruleIndex - the index of the rule to be checkeddeclIndex - the index of the declaration to be checked
true if all corresponding conditions for
the given rule are satisfied;
false otherwise.
public abstract boolean checkCondForDeclaration(int ruleIndex,
int declIndex)
ruleIndex - the index of the rule to be checkeddeclIndex - the index of the declaration to be checked
true if all the conditions of a rule which
reference only the elements declared up to the given index
are satisfied; false otherwise.
public abstract boolean checkCondition(int ruleIndex,
int condIndex)
ruleIndex - the index of the rule to be checkedcondIndex - the index of the condition to be checked
true if the corresponding condition for the
given rule is satisfied. false otherwise.
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException - if the class Object doesn't
support cloning; it should not happen.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void fireRule(int ruleIndex)
ruleIndex - the index of the rule to be fired.public void flush()
public abstract java.lang.Class getDeclaredClass(int ruleIndex,
int declarationIndex)
ruleIndex - the index of the ruledeclarationIndex - the index of the declaration.
public abstract java.lang.String getDeclaredClassName(int ruleIndex,
int declarationIndex)
ruleIndex - the index of the ruledeclarationIndex - the index of the declaration.
public abstract java.lang.String[] getDeclaredIdentifiers(int ruleIndex)
ruleIndex - the index of the rule.
public abstract int[] getNumberOfDeclarations()
public abstract int[] getNumberOfConditions()
public abstract int getNumberOfRules()
public abstract java.lang.Object getObject(int ruleIndex,
int declarationIndex)
ruleIndex - the index of the ruledeclarationIndex - the index of the declaration in the rule
public abstract java.lang.Object[] getObjects(int ruleIndex)
ruleIndex - the index of the rule
public int getRuleIndex()
public abstract java.lang.String[] getRuleNames()
public int hashCode()
hashCode in class java.lang.Objectprotected abstract void internalFireRule(int ruleIndex)
ruleIndex - the index of the rule to be fired.public void modified(java.lang.Object obj)
obj - the object that was modified.public void retract(java.lang.Object obj)
obj - the object to be removed from this base.
public abstract void setObject(int ruleIndex,
int declarationIndex,
java.lang.Object value)
ruleIndex - the index of the ruledeclarationIndex - the index of the declaration in the rulevalue - the value of the object being set.
public abstract void setObjects(int ruleIndex,
java.lang.Object[] objects)
ruleIndex - the index of the ruleobjects - an an object array of the variables bound to the
declarations of some rule.public void setRuleIndex(int value)
value - the index of the rule that has the focus.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||