org.sazonov.fuzzy.engine
Class FuzzyState

java.lang.Object
  extended byorg.sazonov.fuzzy.engine.FuzzyState
All Implemented Interfaces:
org.sazonov.fuzzy.engine.Constants

public class FuzzyState
extends java.lang.Object
implements org.sazonov.fuzzy.engine.Constants

Contains the state of the fuzzy engine. State consists of the linguistic variable, the hedges, and the label weights that are applied to entire rules. Note: This class is not thread-safe.

Version:
2000 Original, v0.1, Edward S. Sazonov (esazonov@usa.com), 12/19/2003 Modifications, v0.2, Nazario Irizarry (naz-irizarry@excite.com)

Field Summary
static int AND
           
static int COMPLETE_EVALUATION
           
static int COMPLETE_EXECUTION
           
static int EVALUATION
           
static int EXCEPTION
           
static int EXECUTE
           
static int EXECUTION
           
static int HEDGE
           
static int HEDGE_READ
           
static int IF
           
static int IS
           
static int IS_READ
           
static int LABEL
           
static int LABEL_READ
           
static int LEFTP
           
static int LV
           
static int LV_READ
           
static int NOP
           
static int NOT_READ
           
static int OR
           
static int READY
           
static int RIGHTP
           
static int RULE
           
static int RULE_READ
           
static int SET
           
static int STORE_LABEL
           
static int THEN
           
static int UNDEFINED
           
static int WEIGHT
           
 
Method Summary
 void addHedge(Hedge hedge)
          Add a hedge (derived from engine.Hedge) to the engine
 RuleBlock createRuleExecutionSet(java.io.Reader reader)
          The reader sequence is read and parsed into rules.
 boolean isRuleFired()
          Returns "true" if a rule has fired during the last call to FuzzyEngine.evaluateRule(String).
 void register(LinguisticVariable function)
          Register a linguistic variable with the engine.
 void reset()
          Reset all previously fired rules.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IF

public static final int IF
See Also:
Constant Field Values

THEN

public static final int THEN
See Also:
Constant Field Values

IS

public static final int IS
See Also:
Constant Field Values

SET

public static final int SET
See Also:
Constant Field Values

AND

public static final int AND
See Also:
Constant Field Values

OR

public static final int OR
See Also:
Constant Field Values

LEFTP

public static final int LEFTP
See Also:
Constant Field Values

RIGHTP

public static final int RIGHTP
See Also:
Constant Field Values

NOP

public static final int NOP
See Also:
Constant Field Values

EXECUTE

public static final int EXECUTE
See Also:
Constant Field Values

HEDGE

public static final int HEDGE
See Also:
Constant Field Values

RULE

public static final int RULE
See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
See Also:
Constant Field Values

WEIGHT

public static final int WEIGHT
See Also:
Constant Field Values

LV

public static final int LV
See Also:
Constant Field Values

READY

public static final int READY
See Also:
Constant Field Values

LV_READ

public static final int LV_READ
See Also:
Constant Field Values

IS_READ

public static final int IS_READ
See Also:
Constant Field Values

NOT_READ

public static final int NOT_READ
See Also:
Constant Field Values

HEDGE_READ

public static final int HEDGE_READ
See Also:
Constant Field Values

EXCEPTION

public static final int EXCEPTION
See Also:
Constant Field Values

STORE_LABEL

public static final int STORE_LABEL
See Also:
Constant Field Values

COMPLETE_EVALUATION

public static final int COMPLETE_EVALUATION
See Also:
Constant Field Values

RULE_READ

public static final int RULE_READ
See Also:
Constant Field Values

LABEL_READ

public static final int LABEL_READ
See Also:
Constant Field Values

COMPLETE_EXECUTION

public static final int COMPLETE_EXECUTION
See Also:
Constant Field Values

LABEL

public static final int LABEL
See Also:
Constant Field Values

EVALUATION

public static final int EVALUATION
See Also:
Constant Field Values

EXECUTION

public static final int EXECUTION
See Also:
Constant Field Values
Method Detail

addHedge

public void addHedge(Hedge hedge)
Add a hedge (derived from engine.Hedge) to the engine

Parameters:
hedge - Implementation of a hedge

isRuleFired

public boolean isRuleFired()
Returns "true" if a rule has fired during the last call to FuzzyEngine.evaluateRule(String). If a block of rules has been evaluated, the function FuzzyBlockOfRules.isRuleFired() should be called instead.

Returns:
"True" if the last evaluated rules has fired, "false" if not.

register

public void register(LinguisticVariable function)
Register a linguistic variable with the engine. Any lingustic variable participating in fuzzy evaluations should be registered with the engine. The same lingustic variable cannot be registered with different engines if labels are used.

Parameters:
function - fuzzyEngine.LinguisticVariable to be registered with the engine.

reset

public void reset()
Reset all previously fired rules. Call to this function clears all rules and resets the engine to its initial state.


createRuleExecutionSet

public RuleBlock createRuleExecutionSet(java.io.Reader reader)
                                 throws RulesParsingException
The reader sequence is read and parsed into rules. The name of this method follows JSR 94 although this class does not yet fit the JSR 94 model.

Parameters:
reader - input sequence
Throws:
RulesParsingException