|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.rules.AbleInferenceEngine
com.ibm.able.rules.AbleFuzzyInferenceEngine
This class provides the control code and inferencing algorithm for processing a set of conditional rules in a ruleblock containing Fuzzy linguistic variables and hedges using data-driven or forward chaining and fuzzy inferencing logic.
The AbleFuzzyInferenceEngine processes AbleAssertionRules and AbleConditionalRules and ignores all others.
The control parameter ARL.InferenceMethod can be used to specify several alternative fuzzy inference algorithms. These include:
The control parameter ARL.CorrelationMethod can be used to specify alternative correlation algorithms. These include:
The control parameter ARL.DefuzzifyMethod can be used to specify several alternative defuzzification algorithms. These include:
The major processing method is infer() which is called by the AbleRuleSet bean as part of the normal bean process() method.
Instances of this class are not directly constructed by the user but are dynamically created by the AbleRuleBlock init() method.
AbleRuleSet,
AbleRuleBlock,
AbleAssertionRule,
AbleConditionalRule,
Serialized Form| Field Summary | |
|---|---|
protected double |
myAlphaCut
Ruleset alphaCut is the default alphaCut for fuzzy sets. |
protected int |
myCorrelationMethod
Specifies the manner in which a rule's consequent is correlated with the truth values of the rule's antecedents. |
protected int |
myDefuzzifyMethod
Specifies the method used to turn a fuzzy value into a crisp number. |
protected int |
myFuzzyInferenceMethod
Specifies the inference (implication) used to process fuzzy rules Value is a DefuzzifyMethod constant. |
| Fields inherited from class com.ibm.able.rules.AbleInferenceEngine |
|---|
myDebugLevel, myRuleBlock, myRuleSet, myRulesFiredCount, myTracer, myWorkingMemory |
| Constructor Summary | |
|---|---|
AbleFuzzyInferenceEngine(AbleRuleSet theRuleSet,
AbleLogger theTracer,
AbleRuleBlock theRuleBlock)
Create a new inference engine. |
|
| Method Summary | |
|---|---|
protected void |
evalAssertionClause(AbleAssertionClause theClause)
Evaluate the specified assertion clause. |
protected void |
evaluateDoActions(AbleRule theRule,
java.util.BitSet theFactBase,
double theTruthValueMin)
|
double |
getAlphaCut()
Retrieve the current alphacut threshold. |
java.lang.Object |
getControlParameter(java.lang.String theControlParameter)
Returns the specified control parameter on the associated inference engine. |
int |
getCorrelationMethod()
Retrieve the current correlation method. |
int |
getDefuzzifyMethod()
Retrieve the current defuzzification method. |
int |
getFuzzyInferenceMethod()
Retrieve the current fuzzy inference method. |
void |
infer(AbleRuleBlock theRuleBlock)
Fire the rules in the ruleblock using fuzzy inferencing. |
boolean |
isRuleBlockValid(AbleRuleBlock theRuleBlock)
Make sure the current ruleblock is "executable" by this inference engine. |
void |
processRuleBlock(AbleRuleBlock theRuleBlock)
Fire all rules in the specified rule block in sequential order. |
void |
setAlphaCut(double theAlphaCut)
Set the alphacut threshold to the specified value. |
void |
setControlParameter(java.lang.String theControlParameter,
java.lang.Object theValue)
Set the specified control parameter on the associated inference engine. |
void |
setCorrelationMethod(int theCorrelationMethod)
Set the correlation method to the specified type. |
void |
setDefuzzifyMethod(int theDefuzzifyMethod)
Set the defuzzification method to the specified type. |
void |
setFuzzyInferenceMethod(int theInferenceMethod)
Set the inference method to the specified type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int myFuzzyInferenceMethod
protected double myAlphaCut
protected int myCorrelationMethod
protected int myDefuzzifyMethod
| Constructor Detail |
public AbleFuzzyInferenceEngine(AbleRuleSet theRuleSet,
AbleLogger theTracer,
AbleRuleBlock theRuleBlock)
theRuleSet - A ruleset whose context is used for inferencing
by this inference engine.
theTracer - A tracer object to which this inference engine can log
information. This may be null, in which case no
information is logged.
theRuleBlock - A ruleblock whose rules are to be used for inferencing
by this inference engine.
| Method Detail |
public boolean isRuleBlockValid(AbleRuleBlock theRuleBlock)
The ruleblock is invalid if any of the following are present in any ruleblock:
All reasons for validation failures are appended to the AbleRuleSet's myIsExReason variable. If validation fails, the inference engine must call myRuleSet.addIsExReason(java.lang.String) to append the reason. Reasons are accumulatve.
isRuleBlockValid in class AbleInferenceEngine
public void infer(AbleRuleBlock theRuleBlock)
throws AbleDataException
The infer() method is invoked by the AbleRuleSet process() code.
The order of processing is as follows:
infer in class AbleInferenceEnginetheRuleBlock - The ruleblock object to process.
AbleDataException - When any error occurs.
public void processRuleBlock(AbleRuleBlock theRuleBlock)
throws AbleDataException
This method is called from a ruleset's invokeRuleBlock() method, and that method is called when a rule that uses the built-in invokeRuleBlock("name") call literal is evaluated.
processRuleBlock in class AbleInferenceEnginetheRuleBlock - The rule block from which rules are to be processed.
AbleDataException - when the data types are incompatible, or when the
relational operator is invalid for the current
situation or unrecognized.
protected void evaluateDoActions(AbleRule theRule,
java.util.BitSet theFactBase,
double theTruthValueMin)
throws AbleDataException
AbleDataException
protected void evalAssertionClause(AbleAssertionClause theClause)
throws AbleDataException
evalAssertionClause in class AbleInferenceEnginetheClause - an assertion clause to evaluate.
AbleDataException - when the clause's data objects are incompatible, or
when the relational operator is invalid for the
current situation or unrecognized.
public void setControlParameter(java.lang.String theControlParameter,
java.lang.Object theValue)
throws AbleDataException
setControlParameter in class AbleInferenceEngineAbleDataException
public java.lang.Object getControlParameter(java.lang.String theControlParameter)
throws AbleDataException
getControlParameter in class AbleInferenceEngineAbleDataExceptionpublic final double getAlphaCut()
public void setAlphaCut(double theAlphaCut)
throws AbleDataException
theAlphaCut - The new alphacut threshold.
AbleDataException - If the specified alphacut value is not between 0.0
(exclusive) and 1.0 (exclusive).public final int getCorrelationMethod()
public void setCorrelationMethod(int theCorrelationMethod)
throws AbleDataException
theCorrelationMethod - The new correlation method.
AbleDataException - If the specified correlation method is not recognised.public final int getDefuzzifyMethod()
public void setDefuzzifyMethod(int theDefuzzifyMethod)
throws AbleDataException
theDefuzzifyMethod - The new defuzzification method.
AbleDataException - If the specified defuzzification method is not
recognised.
public void setFuzzyInferenceMethod(int theInferenceMethod)
throws AbleDataException
theInferenceMethod - The new fuzzy inference method.
Fuzzy Inference methods are enumerated in this class.
AbleDataException - If the specified fuzzy inference method is not recognised.getFuzzyInferenceMethod()public final int getFuzzyInferenceMethod()
setFuzzyInferenceMethod(int)
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||