|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jFuzzyLogic.rule.FuzzyRuleSet
public class FuzzyRuleSet
A set of fuzzy rules
Field Summary | |
---|---|
static boolean |
debug
Debug mode? |
(package private) RuleImplicationMethod |
ruleImplicationMethod
Rule implication method |
(package private) java.util.LinkedList<FuzzyRule> |
rules
A list of rules |
(package private) java.util.LinkedList<Variable> |
variables
Every variable is listed here |
Constructor Summary | |
---|---|
FuzzyRuleSet()
|
Method Summary | |
---|---|
FuzzyRuleSet |
add(FuzzyRule fuzzyRule)
Add a rule to this ruleSet |
void |
chart()
Show a chart for each variable in this ruleSet |
void |
evaluate()
Evaluate fuzzy rule set |
java.lang.String |
fclTree(antlr.collections.AST tree)
Buils rule set based on FCL tree (parsed from an FCL file) |
private Variable |
fclTreeDefuzzify(antlr.collections.AST tree)
Parse a tree for "Defuzzify" item |
private Variable |
fclTreeFuzzify(antlr.collections.AST tree)
Parse a tree for "Fuzzify" item |
private LinguisticTerm |
fclTreeFuzzifyTerm(antlr.collections.AST tree,
Variable variable)
Parse a tree for "Term" item |
private MembershipFunction |
fclTreeFuzzifyTermGauss(antlr.collections.AST tree)
Parse a tree for gaussian memebership function |
private MembershipFunction |
fclTreeFuzzifyTermGenBell(antlr.collections.AST tree)
Parse a tree for generilized bell memebership function |
private MembershipFunction |
fclTreeFuzzifyTermPieceWiseLinear(antlr.collections.AST tree)
Parse a tree for piece-wice linear memebership function |
private MembershipFunction |
fclTreeFuzzifyTermPieceWiseLinearPoints(antlr.collections.AST tree,
int numberOfPoints)
Parse a tree for piece-wice linear memebership function series of points |
private MembershipFunction |
fclTreeFuzzifyTermSigmoidal(antlr.collections.AST tree)
Parse a tree for sigmoidal memebership function |
private MembershipFunction |
fclTreeFuzzifyTermSingleton(antlr.collections.AST tree)
Parse a tree for piece-wice linear memebership function item |
private MembershipFunction |
fclTreeFuzzifyTermSingletons(antlr.collections.AST tree)
Parse a tree for singletons memebership function |
private MembershipFunction |
fclTreeFuzzifyTermSingletonsPoints(antlr.collections.AST tree,
int numberOfPoints)
Parse a tree for singletons memebership function series of points |
private MembershipFunction |
fclTreeFuzzifyTermTrapetzoidal(antlr.collections.AST tree)
Parse a tree for trapetzoidal memebership function |
private MembershipFunction |
fclTreeFuzzifyTermTriangular(antlr.collections.AST tree)
Parse a tree for traingular memebership function |
private void |
fclTreeRuleBlock(antlr.collections.AST tree)
|
private void |
fclTreeRuleBlockActivation(antlr.collections.AST tree)
Parse rule Implication Method (or rule activation method) |
private void |
fclTreeRuleBlockRule(antlr.collections.AST tree,
RuleConnectionMethod and,
RuleConnectionMethod or)
Parse rule Implication Method (or rule activation method) |
private FuzzyRuleExpression |
fclTreeRuleBlockRuleIf(antlr.collections.AST tree,
RuleConnectionMethod and,
RuleConnectionMethod or)
Parse rule 'IF' (or rule's weight) |
private void |
fclTreeRuleBlockRuleThen(antlr.collections.AST tree,
FuzzyRule fuzzyRule)
Parse rule 'THEN' (or rule's weight) |
private void |
fclTreeRuleBlockRuleWith(antlr.collections.AST tree,
FuzzyRule fuzzyRule)
Parse rule 'WITH' (or rule's weight) |
private void |
fclTreeVariables(antlr.collections.AST tree)
Parse a tree for "Variable" item (either input or output variables) |
RuleImplicationMethod |
getRuleImplicationMethod()
|
java.util.LinkedList |
getRules()
|
Variable |
getVariable(java.lang.String variableName)
Get Variable by name |
java.util.LinkedList<Variable> |
getVariables()
|
static boolean |
isDebug()
|
void |
reset()
Reset ruleset (should be done prior to each inference) Also create 'variables' list (if needed) |
static void |
setDebug(boolean debug)
|
void |
setRuleImplicationMethod(RuleImplicationMethod ruleImplicationMethod)
|
void |
setRules(java.util.LinkedList<FuzzyRule> rules)
|
FuzzyRuleSet |
setVariable(java.lang.String variableName,
double value)
Set a variable |
void |
setVariables(java.util.LinkedList<Variable> consequentVariables)
|
java.lang.String |
toString()
|
java.lang.String |
toStringFCL()
|
boolean |
varibleExists(java.lang.String variableName)
Does this variable exist in this ruleset? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean debug
RuleImplicationMethod ruleImplicationMethod
java.util.LinkedList<FuzzyRule> rules
java.util.LinkedList<Variable> variables
Constructor Detail |
---|
public FuzzyRuleSet()
Method Detail |
---|
public static boolean isDebug()
public static void setDebug(boolean debug)
public FuzzyRuleSet add(FuzzyRule fuzzyRule)
fuzzyRule
- : Rule to add
public void chart()
public void evaluate()
public java.lang.String fclTree(antlr.collections.AST tree)
tree
- : Tree to use
private Variable fclTreeDefuzzify(antlr.collections.AST tree)
tree
- : Tree to parse
private Variable fclTreeFuzzify(antlr.collections.AST tree)
tree
- : Tree to parse
private LinguisticTerm fclTreeFuzzifyTerm(antlr.collections.AST tree, Variable variable)
tree
- : Tree to parse
private MembershipFunction fclTreeFuzzifyTermGauss(antlr.collections.AST tree)
tree
- : Tree to parse
private MembershipFunction fclTreeFuzzifyTermGenBell(antlr.collections.AST tree)
tree
- : Tree to parse
private MembershipFunction fclTreeFuzzifyTermPieceWiseLinear(antlr.collections.AST tree)
tree
- : Tree to parse
private MembershipFunction fclTreeFuzzifyTermPieceWiseLinearPoints(antlr.collections.AST tree, int numberOfPoints)
tree
- : Tree to parsenumberOfPoints
- : Number of points in this function
private MembershipFunction fclTreeFuzzifyTermSigmoidal(antlr.collections.AST tree)
tree
- : Tree to parse
private MembershipFunction fclTreeFuzzifyTermSingleton(antlr.collections.AST tree)
tree
- : Tree to parse
private MembershipFunction fclTreeFuzzifyTermSingletons(antlr.collections.AST tree)
tree
- : Tree to parse
private MembershipFunction fclTreeFuzzifyTermSingletonsPoints(antlr.collections.AST tree, int numberOfPoints)
tree
- : Tree to parsenumberOfPoints
- : Number of points in this function
private MembershipFunction fclTreeFuzzifyTermTrapetzoidal(antlr.collections.AST tree)
tree
- : Tree to parse
private MembershipFunction fclTreeFuzzifyTermTriangular(antlr.collections.AST tree)
tree
- : Tree to parse
private void fclTreeRuleBlock(antlr.collections.AST tree)
private void fclTreeRuleBlockActivation(antlr.collections.AST tree)
tree
- : Tree to parseprivate void fclTreeRuleBlockRule(antlr.collections.AST tree, RuleConnectionMethod and, RuleConnectionMethod or)
tree
- : Tree to parseprivate FuzzyRuleExpression fclTreeRuleBlockRuleIf(antlr.collections.AST tree, RuleConnectionMethod and, RuleConnectionMethod or)
tree
- : Tree to parseprivate void fclTreeRuleBlockRuleThen(antlr.collections.AST tree, FuzzyRule fuzzyRule)
tree
- : Tree to parseprivate void fclTreeRuleBlockRuleWith(antlr.collections.AST tree, FuzzyRule fuzzyRule)
tree
- : Tree to parseprivate void fclTreeVariables(antlr.collections.AST tree)
tree
- public RuleImplicationMethod getRuleImplicationMethod()
public java.util.LinkedList getRules()
public Variable getVariable(java.lang.String variableName)
public java.util.LinkedList<Variable> getVariables()
public void reset()
public void setRuleImplicationMethod(RuleImplicationMethod ruleImplicationMethod)
public void setRules(java.util.LinkedList<FuzzyRule> rules)
public FuzzyRuleSet setVariable(java.lang.String variableName, double value)
variableName
- : Variable's namevalue
- : variable's value to be setted
public void setVariables(java.util.LinkedList<Variable> consequentVariables)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringFCL()
public boolean varibleExists(java.lang.String variableName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |