Class FuzzyEngine

java.lang.Object
org.episteme.core.mathematics.logic.fuzzy.FuzzyEngine

public class FuzzyEngine extends Object

Fuzzy engine implementation.

Version:
0.0.1
Author:
Levent Bayindir
  • Field Details

    • DEFUZZIFICATION_CENTER_OF_MAXIMUM

      public static int DEFUZZIFICATION_CENTER_OF_MAXIMUM
      Defuzzification 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

      public void evaluateRule(String rule) throws RuleParsingException
      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

      public void evaluateRule(FuzzyRule rule)
      Evaluates a pre-parsed FuzzyRule object.
      Parameters:
      rule - the fuzzy rule to evaluate
    • evaluateRules

      public void evaluateRules()
      DOCUMENT ME!
    • addRule

      public FuzzyRule addRule(String rule) throws RuleParsingException
      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

      public FuzzyRule addRule(FuzzyRule rule)
      Registers an existing FuzzyRule object with the engine.
      Parameters:
      rule - the rule to add
      Returns:
      the added rule
    • addLinguisticVariable

      public void addLinguisticVariable(LinguisticVariable lv)
      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

      public LinguisticVariable getLinguisticVariable(String lv)
      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