FuzzyLite Language

The FuzzyLite Language fll is a new format designed to describe fuzzy logic controllers. It is simpler and better than most state-of-the-art formats such as the Fuzzy Control Language fcl and the Fuzzy Inference System fis. Furthermore, it provides additional functionality that is not available in the standards of fcl and fis. The FuzzyLite Language is the preferred format to save and load your fuzzy logic controllers using QtFuzzyLite.

The format of an Engine expressed in fll is the following.

Definition Example
#Comments: indent="  ", separator="\n"  
Engine: string
description: text
InputVariable: string
  description: text
  enabled: boolean
  range: scalar scalar
  lock-range: boolean
  term: string Term [parameters]
OutputVariable: string
  description: text
  enabled: boolean
  range: scalar scalar
  lock-range: boolean
  aggregation: SNorm|none
  defuzzifier: [Defuzzifier [parameter]]|none
  default: scalar
  lock-previous: boolean
  term: string Term [parameters]
RuleBlock: string
  description: text
  enabled: boolean
  conjunction: TNorm|none
  disjunction: SNorm|none
  implication: TNorm|none
  activation: [Activation [parameter]]|none
  rule: if antecedent then consequent with weight
#from examples/mamdani/ObstacleAvoidance.fll"  
Engine: ObstacleAvoidance
description: An engine for obstacle avoidance
InputVariable: obstacle
  description: direction of the obstacle
  enabled: true
  range: 0.000 1.000
  lock-range: false
  term: left Ramp 1.000 0.000
  term: right Ramp 0.000 1.000
OutputVariable: mSteer
  description: steering direction of the vehicle
  enabled: true
  range: 0.000 1.000
  lock-range: false
  aggregation: Maximum
  defuzzifier: Centroid 100
  default: nan
  lock-previous: false
  term: left Ramp 1.000 0.000
  term: right Ramp 0.000 1.000
RuleBlock: mamdani
  description: Mamdani inference for steering
  enabled: true
  conjunction: none
  disjunction: none
  implication: AlgebraicProduct
  activation: General
  rule: if obstacle is left then mSteer is right
  rule: if obstacle is right then mSteer is left

Comments start with # at any location. Indentation is not mandatory and does not provide any additional information. The statements are separated by line breaks \n. However, the fll format is flexible and both indentation and separator can be changed. For example, for indentation   and separator ;, the engine is expressed in a single line separated by semicolons, but then comments would only make sense at the end of the line.

The elements in fll are described as follows.

Components of the FuzzyLite Language Description
Blocks
Engine: Keyword to indicate start of Engine
InputVariable: Keyword to indicate start of InputVariable
OutputVariable: Keyword to indicate start of OutputVariable
RuleBlock: Keyword to indicate start of RuleBlock
Properties
enabled: property to determine whether the input|output variable or rule block is enabled during Engine::process()
range: property to define the range of the input|output variable
term: property to add a term to the input|output variable
aggregation:
accumulation
property to define the S-Norm which accumulates the modified consequents of an output variable
defuzzifier: property to define the defuzzification method over the accumulated modified consequents
default: when the output variable is disabled or no rules are activated, the property determines the output value from the defuzzification of the variable
lock-previous: when the output variable is disabled or no rules are activated, the property determines whether the output value obtained from the defuzzification of the variable is a valid output value from a previous defuzzification or else the value given by default property
lock-range: property to enforce the values of input variables and output variables to always be within the range of the variable
conjunction: property to define the T-Norm of conjunction used by the fuzzy logic operator and in the antecedent of a rule
disjunction: property to define the S-Norm of disjunction used by the fuzzy logic operator or in the antecedent of a rule
implication:
activation
property to define the T-Norm used to modify the consequents of a rule after its implication
activation: property to define the activation method to use to activate and trigger the rules in the rule block
rule: property to add a rule to the rule block
Types
string A string of characters without spaces or special symbols
text Any string of characters in a single line, possibly empty
identifier A non-empty string of characters that uniquely identifies the block with the following characters A-Z a-z _ .
boolean Accepts true or false
scalar A floating-point number or nan inf -inf (i.e. not-a-number, positive infinity and negative infinity, respectively)
none Some properties support a value none to leave the property empty
parameter A single parameter value
parameters Multiple parameter values separated by whitespaces
Term Name of a class that implements Term and is registered in the TermFactory of FactoryManager
TNorm Name of a class that implements TNorm and is registered in the TNormFactory of FactoryManager
SNorm Name of a class that implements SNorm and is registered in the SNormFactory of FactoryManager
Activation Name of an activation method registered in the ActivationFactory of Factory manager
Defuzzifier Name of a class that implements Defuzzifier and is registered in the DefuzzifierFactory of FactoryManager
antecedent ‘variable is [hedge] term [and|or variable is [hedge] term]‘, where elements in bold are rule keywords, within [brackets] are optional, and -marked may appear zero or more times
consequent ‘variable is [hedge] term [and variable is [hedge] term] [with scalar]?‘, where elements in bold are rule keywords, within [brackets] are optional, -marked may appear zero or more times, and ?-marked may appear once or not at all

FuzzyLite Dataset

The FuzzyLite Dataset fld is a text-delimited format that describes the operation of a fuzzy logic controller according to its inputs and outputs. The format of the operation of an Engine expressed in fld is as follows.

inputVariable1 inputVariable2 ... inputVariableP outputVariable1 outputVariable2 ... outputVariableQ #Variable names
inputValue1a inputValue2a ... inputValuePa outputValue1a outputValue2a ... outputValueQa #Variable values
.
.
.
inputValue1z inputValue2z ... inputValuePz outputValue1z outputValue2z ... outputValueQz #Variable values

Leave a Reply