Class FuzzyEngine
java.lang.Object
org.episteme.core.mathematics.logic.fuzzy.FuzzyEngine
Fuzzy engine implementation.
- Version:
- 0.0.1
- Author:
- Levent Bayindir
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intDefuzzification method: Center of Maximum (CoM). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters a Linguistic Variable (LV) with the engine.Parses and registers a new rule from its string representation.Registers an existing FuzzyRule object with the engine.voidevaluateRule(String rule) Evaluates a single rule provided as a string.voidevaluateRule(FuzzyRule rule) Evaluates a pre-parsed FuzzyRule object.voidDOCUMENT ME!Retrieves a registered Linguistic Variable by its name.intReturns the number of rules currently registered in the engine.
-
Field Details
-
DEFUZZIFICATION_CENTER_OF_MAXIMUM
public static int DEFUZZIFICATION_CENTER_OF_MAXIMUMDefuzzification method: Center of Maximum (CoM). Calculates the center of the area of the maximum membership values.
-
-
Constructor Details
-
FuzzyEngine
public FuzzyEngine()Creates a new FuzzyEngine object.
-
-
Method Details
-
evaluateRule
Evaluates a single rule provided as a string. The rule string is parsed, executed, and the results affect the associated linguistic variables.- Parameters:
rule- the string representation of the fuzzy rule- Throws:
RuleParsingException- if the rule syntax is invalid
-
evaluateRule
Evaluates a pre-parsed FuzzyRule object.- Parameters:
rule- the fuzzy rule to evaluate
-
evaluateRules
public void evaluateRules()DOCUMENT ME! -
addRule
Parses and registers a new rule from its string representation.- Parameters:
rule- the rule string- Returns:
- the created FuzzyRule object
- Throws:
RuleParsingException- if the rule format is incorrect
-
addRule
-
addLinguisticVariable
Registers a Linguistic Variable (LV) with the engine. LVs represent concepts like "Temperature" or "Speed" with associated fuzzy sets.- Parameters:
lv- the linguistic variable to add
-
getLinguisticVariable
Retrieves a registered Linguistic Variable by its name.- Parameters:
lv- the name of the variable (e.g., "Pressure")- Returns:
- the variable object, or null if not found
-
getNumRules
public int getNumRules()Returns the number of rules currently registered in the engine.- Returns:
- the rule count
-