Variables are declared in the Variables( ... ) section of a ruleset; this section appears immediately after any ruleset option statements.
There are four types of variables that you can define. Of these, Boolean, Numeric, and Symbolic operate in the normal boolean way. Continuous is the fuzzy variable type over which fuzzy sets can be defined, and "pure" fuzzy rulesets will restrict themselves to the Continuous variable type only. However, if you understand the implications of mixing boolean logic with fuzzy logic, rulesets may use any of these variable types.
Boolean variables can have one of two values: either true or false. You must specify an initial value for the variable when you declare it.
<variableName> Boolean ( True | False )
isMale Boolean(True)Return to top
Continuous variables are defined over a domain of continuous numbers. Within this range of numbers, one or more fuzzy sets must be defined; therefore, the SetDefinitions(...) statement with at least one fuzzy set definition is always required to follow a Continuous variable declaration.
The keyword "to" is optional or it may be replaced with a comma.
<variableName> Continuous (<low> [to | ,] <high> ) SetDefinitions( <fuzzySetDeclarations>+ )
Percent_Complete Continuous(0 to 100) SetDefinitions( ... ) Percent_Complete Continuous(0,100) SetDefinitions( ... ) Percent_Complete Continuous(0 100) SetDefinitions( ... )Return to top
Numeric variables can be assigned any numeric value; internally, they are represented as Doubles.
<variableName> Numeric ( <initialValue> )
NumberOf_Enrollees Numeric(50) PercentComplete Numeric( 0.34 ) decrementAmount Numeric(-5.0) incrementAmount Numeric(+10 )Return to top
Symbolic variables essentially hold string data. However, these variables may not be assigned any arbitrary string; they must be assigned a value from a predefined list of values that you declare along with the variable. While you can declare numbers in the list of symbols, numbers are treated as strings. This means that the numbers 1 and 1.0, for example, are two different symbols and they do not compare equally.
You must define at least one symbol for a symbolic variable. The initial value of a symbolic variable is Fs_NULL_Fs. However, you may not test for this value, or assign this value unless you explicitly declare it in the symbol list for the variable.
<variableName> Symbolic ( <symbols>+ )
Color Symbolic( black, green, green.and.black, orange.and.black ) Legs Symbolic( 6, 8 ) Shape Symbolic( elongated, round )Return to top