This section describes various components of the fuzzy rule language and how to enter them.
A comment may appear in only two places: on a line by itself or
at the end of a line containing a fuzzy rule language
statement. Comments may be delimited by a beginning
//
(slash-slash) or a beginning
;
(semicolon). There is no terminating
delimiter. The following lines all demonstrate valid comments:
//------------------------------------ // These comments are on lines by // themselves. //------------------------------------ ;Comment using semicolon. a = b ; Comments at the ends c Is d // of lines.Return to top
White space (blanks, tabs, newlines, etc.) may be sprinkled freely throughout a source file. They are all ignored. The following two fuzzy rules are parsed identically:
rule_001: if Temperature is slightly elevated then Pressure is positively moderate rule_002 : if Temperature is slightly elevated then Pressure is positively moderateReturn to top
All rule language keywords are not case sensitive. For example, the keyword true may be entered as any of true, True, tRue, TRUE, and so on.
Some of the longer keywords may be abbreviated. The following table identifies those keywords that may be abbreviated along with their acceptable abbreviations.
Keywords and their Abbreviations | |
---|---|
Complement | Comp |
InputVariables | InputVars, InputVar, Input |
OutputVariables | OutputVars, OutputVar, Output |
SetDefinitions | SetDefs, SetDef |
All identifiers (that is, names of variables, fuzzy sets, and rules defined by you) are case sensitive. For example, if you define a continuous variable with the name of myVar you cannot later refer to that variable as MYvar as the latter name is taken to refer to a completely different variable that might even be of a different type (if it exists at all).
Identifiers can be composed of alphabetics (a-zA-Z), numerics (0-9), and the characters . (dot), _ (underscore), and $ (dollar). Note, however, that neither numerics nor the dot character can be used to begin an identifier. The following are all valid identifiers:
this.IsVar_1 this_Is.var.2 foo$ $foo
The following are examples of illegal identifiers:
.IsVar_1 // Begins with a dot 9foo // Begins with a numberReturn to top
Numbers may be entered with a leading +
(plus) or -
(minus) sign. Numbers between -1
and +1 must be entered with a leading zero before the decimal
point. The following are all valid:
0.55 -0.55 +0.55 100 -100 +100 +100.00 0.001 -36.99
The following are examples of illegal numbers:
.56 // No zero before the decimal point -.05 // No zero before the decimal pointReturn to top
Most lists can be entered with each element separated by one or more blanks, a comma, or both. The following are all valid:
myContinuousVar is positively very very Hot myContinuousVar is positively very, very Hot myContinuousVar is positively very,very Hot myContinuousVar is positively, very, very, Hot mySymbolicVar Symbolic(a 9 d 4.7 F) mySymbolicVar Symbolic(a,9,d,4.7,F) mySymbolicVar Symbolic(a, 9, d, 4.7, F) mySymbolicVar Symbolic( // List on multiple lines a, 9, d, 4.7, F )Return to top