Class LinguisticVariable

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

public class LinguisticVariable extends Object

Abstraction for fuzzy linguistic variables.

Version:
0.0.1
Author:
Levent Bayindir
  • Constructor Details

    • LinguisticVariable

      public LinguisticVariable(String name)
      Creates a new LinguisticVariable object.
      Parameters:
      name - the name of the variable (case-insensitive)
  • Method Details

    • addMembershipFunction

      public void addMembershipFunction(MembershipFunction<?> function)
      Adds a membership function to this variable.
      Parameters:
      function - the membership function to add
    • getMembershipFuncion

      public MembershipFunction<?> getMembershipFuncion(String name)
      Retrieves a membership function by name.
      Parameters:
      name - the name of the function (e.g. "Hot", "Cold")
      Returns:
      the membership function or null if not found
    • setName

      public void setName(String mName)
      Sets the name of this linguistic variable.
      Parameters:
      mName - the new name
    • getName

      public String getName()
      Gets the name of this linguistic variable.
      Returns:
      the name
    • defuzzify

      public double defuzzify() throws NoRulesFiredException
      Performs defuzzification on this variable to produce a single crisp output. Uses the Center of Gravity/Area method based on active rules.
      Returns:
      the crisp output value
      Throws:
      NoRulesFiredException - if no rules contributed to this variable's output
    • toString

      public String toString()
      Returns the name of the variable.
      Overrides:
      toString in class Object
      Returns:
      string representation
    • setFuzzificationInputValue

      public void setFuzzificationInputValue(double inputValue)
      Sets the input value for fuzzification (converting crisp input to fuzzy degrees).
      Parameters:
      inputValue - the crisp input value
    • getFuzzificationInputValue

      public double getFuzzificationInputValue()
      Gets the current fuzzification input value.
      Returns:
      the input value