Class LinguisticVariable
java.lang.Object
org.episteme.core.mathematics.logic.fuzzy.LinguisticVariable
Abstraction for fuzzy linguistic variables.
- Version:
- 0.0.1
- Author:
- Levent Bayindir
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMembershipFunction(MembershipFunction<?> function) Adds a membership function to this variable.doublePerforms defuzzification on this variable to produce a single crisp output.doubleGets the current fuzzification input value.getMembershipFuncion(String name) Retrieves a membership function by name.getName()Gets the name of this linguistic variable.voidsetFuzzificationInputValue(double inputValue) Sets the input value for fuzzification (converting crisp input to fuzzy degrees).voidSets the name of this linguistic variable.toString()Returns the name of the variable.
-
Constructor Details
-
LinguisticVariable
Creates a new LinguisticVariable object.- Parameters:
name- the name of the variable (case-insensitive)
-
-
Method Details
-
addMembershipFunction
Adds a membership function to this variable.- Parameters:
function- the membership function to add
-
getMembershipFuncion
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
Sets the name of this linguistic variable.- Parameters:
mName- the new name
-
getName
-
defuzzify
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
-
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
-