nrc.fuzzy.jess
Class FuzzyRete

java.lang.Object
  |
  +--jess.Rete
        |
        +--nrc.fuzzy.jess.FuzzyRete
All Implemented Interfaces:
java.util.EventListener, jess.JessListener, java.io.Serializable

public class FuzzyRete
extends jess.Rete
implements java.io.Serializable

The reasoning engine, extended to support fuzzy reasoning. Executes the built Rete network, and coordinates many other activities.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class jess.Rete
ACTIVATE, EVERY_TIME, INSTALL
 
Constructor Summary
FuzzyRete()
           
FuzzyRete(java.applet.Applet a)
           
 
Method Summary
protected  void aboutToFire(jess.Activation a)
          Records the current activation during a rule firing.
 int doPreAssertionProcessing(jess.Fact f)
          Special preprocessing when asserting a fact with fuzzy values in it.
protected  jess.Activation getCurrentActivation()
          Get the current rule activation.
 nrc.fuzzy.FuzzyRule getCurrentActivationFuzzyRule()
          Get the current FuzzyRule in the activation.
 nrc.fuzzy.jess.GlobalContributionOperator getFuzzyGlobalContributionOperator()
          Gets the current GlobalContributionOperator object that implements the execute method to do global contribution.
 java.util.Vector getFuzzyMatchesInActivation(jess.Activation a)
          Finds any Fuzzy matches (antecedent/input pairs) that were made on the LHS of the rule.
protected  void justFired(jess.Activation a)
          Clears the current activation when a rule finishes firing.
 boolean setFuzzyGlobalContributionOperator(nrc.fuzzy.jess.GlobalContributionOperator op)
          Sets the type of global contribution to do.
 
Methods inherited from class jess.Rete
addDeffacts, addDefglobal, addDefmodule, addDefmodule, addDefrule, addDeftemplate, addInputRouter, addJessListener, addOutputRouter, addUserfunction, addUserpackage, assert, assert, assertFact, assertFact, assertString, assertString, bload, bsave, clear, clearFocusStack, clearStorage, defclass, definstance, definstance, eventHappened, executeCommand, executeCommand, fetch, findClass, findDeffacts, findDefglobal, findDefrule, findDeftemplate, findFactByFact, findFactByID, findUserfunction, getActivationSemaphore, getApplet, getAppObjectClass, getCurrentModule, getErrStream, getEvalSalience, getEventMask, getFactory, getFocus, getGlobalContext, getInputMode, getInputRouter, getOutputRouter, getOutStream, getResetGlobals, getStrategy, getSupportedFacts, getSupportingTokens, getThisActivation, getThisRuleName, halt, importClass, importPackage, javaClassForDefclass, listActivations, listActivations, listDefclasses, listDeffacts, listDefglobals, listDefinstances, listDefrules, listDeftemplates, listFacts, listFocusStack, listFunctions, listJessListeners, listModules, modify, modify, popFocus, ppFacts, ppFacts, removeInputRouter, removeJessListener, removeOutputRouter, reset, resolveName, retract, retractString, run, run, runQuery, runUntilHalt, setApplet, setAppObject, setCurrentModule, setEvalSalience, setEventMask, setFactory, setFocus, setPendingFact, setResetGlobals, setStrategy, store, store, toString, undefinstance, unDefrule, unwatch, unwatchAll, updateObject, verifyModule, waitForActivations, watch, watchAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FuzzyRete

public FuzzyRete()

FuzzyRete

public FuzzyRete(java.applet.Applet a)
Parameters:
a -
Method Detail

getFuzzyMatchesInActivation

public java.util.Vector getFuzzyMatchesInActivation(jess.Activation a)
Finds any Fuzzy matches (antecedent/input pairs) that were made on the LHS of the rule. When a fuzzy match was made (fuzzy-match function) the pairs were stored in the appropriate token (in the special extensionData slot) which ultimately was linked in the m_token slot of the activation.

Parameters:
a - The rule activation to be searched for Fuzzy matches.
Returns:
A Vector with the fuzzy match pairs or null if no match pairs

doPreAssertionProcessing

public int doPreAssertionProcessing(jess.Fact f)
                             throws jess.JessException
Special preprocessing when asserting a fact with fuzzy values in it. Some special additions for dealing with fuzzy facts and fuzzy inferencing. In particular the FuzzyValues in the asserted fact will be modified if there are fuzzy matches on the LHS of the rule and if there exists an equivalent fact with fuzzy values already, that fact and the new one are combined (fuzzy global contribution).

Overrides:
doPreAssertionProcessing in class jess.Rete
Parameters:
f - the fact being asserted
Returns:
int
Throws:
jess.JessException

getCurrentActivation

protected jess.Activation getCurrentActivation()
Get the current rule activation.


getCurrentActivationFuzzyRule

public nrc.fuzzy.FuzzyRule getCurrentActivationFuzzyRule()
Get the current FuzzyRule in the activation.


aboutToFire

protected void aboutToFire(jess.Activation a)
Records the current activation during a rule firing.

Overrides:
aboutToFire in class jess.Rete

justFired

protected void justFired(jess.Activation a)
Clears the current activation when a rule finishes firing.

Overrides:
justFired in class jess.Rete

setFuzzyGlobalContributionOperator

public boolean setFuzzyGlobalContributionOperator(nrc.fuzzy.jess.GlobalContributionOperator op)
Sets the type of global contribution to do. Wil normally be one of:
a UnionGlobalContributionOperator - do a fuzzy union of FuzzyValues
a SumGlobalContributionOperator - do a fuzzy Sum of FuzzyValues
null - do no global contribution (replace with new FuzzyValues)

Parameters:
op - the GlobalContributionOperator that provides the required execute method to combine the new and existing fuzzy values when global contribution is being done.
Returns:
true if successful else false (actually can't fail)

getFuzzyGlobalContributionOperator

public nrc.fuzzy.jess.GlobalContributionOperator getFuzzyGlobalContributionOperator()
Gets the current GlobalContributionOperator object that implements the execute method to do global contribution. Will normally be one of:
a UnionGlobalContributionOperator - do a fuzzy union of FuzzyValues
a SumGlobalContributionOperator - do a fuzzy Sum of FuzzyValues
null - do no global contribution (replace with new FuzzyValues)

Returns:
an GlobalContributionOperator object or null.