The Xfuzzy 3 development environment

The system edition tool - Xfedit

The xfedit tool offers a graphical interface to ease the description of fuzzy systems, avoiding the need for an in depth knowledge of the XFL3 language. The tool is formed by a set of windows that allows the user to create and edit the operator sets, linguistic variable types, and rule bases included in the fuzzy system, as well as describing the hierarchical structure of the system under development. The tool can be executed directly from the command line with the expression "xfedit file.xfl", or from the environment's main window, using the System Edition option in the Design menu.

The figure shows the main window of xfedit. The File menu contains the following options: "Save", "Save As", "Load Package", "Edit XFL3 File" and "Close Edition". The options "Save" and "Save As" are used to save the present state of the system definition. The option "Load Package" is used to import new functions that can be assigned to the different fuzzy operators. The XFL3 file edition option opens a text window to edit the XFL3 description of the system. The last option is used to close the tool. The field Name under the menu bar is not editable. The name of the system under development can be changed by the Save As option. The body of the window is divided into three parts: the left one contains the lists of input and output global variables; the right part includes the lists of the defined operator sets, linguistic variable types and rule bases; finally, the central zone shows the hierarchical structure of the system.

The shortcuts of the different lists are the common ones of the environment: the Insert key creates a new element for each list; the Delete key is used to remove an element (when it has not been used); and the Enter key or a double click allows the element edition.

The creation of a fuzzy system in Xfuzzy usually starts with the definition of the operator sets. The figure shows the window for editing operator sets in xfedit. It has a simple behavior. The first field contains the identifier of the operator set. The remaining fields contain pulldown lists to assign functions to the different fuzzy operators. If the selected function needs the introduction of some parameters, a new window will ask for them. The functions available in each list are those defined in the loaded packages. It is not necessary to make a choice for every field. At the bottom of the window, a command bar presents four options: "Ok", "Apply", "Reload" and "Cancel". The first option saves the operator set and closes the window. The second one just saves the last changes. The third option actualizes the field with the last saved values. The last one closes the window rejecting the last changes.

The following step in the description of a fuzzy system is to create the linguistic variable types, by means of the Type Creation window shown below. A new type needs the introduction of its identifier and universe of discourse (minimum, maximum and cardinality). The window includes several predefined types corresponding to the most usual partitions of the universes. These predefined types contain homogeneous triangular, trapezoidal, bell-shaped and singleton partitions, shouldered-triangular and shouldered-bell partitions. Other predefined types are equal bells and singletons, which are commonly used as a first option for output variable types. When one of the previous predefined types is selected, the number of membership function of the partition must be introduced. The predefined types also include a blank option, which generates a type without any membership function, and the extension of an existing type (selected in the Parent field), that implements the inheritance mechanism of XFL3.

Once a type has been created, it can be edited using the Type Edition window. This window allows the modification of the type name and universe of discourse, for instance by adding, editing and removing the membership functions of the edited type. The window shows a graphical representation of the membership functions, where the selected membership function is represented in a different color. The bottom of the window presents a command bar with the usual buttons to save or reject the last changes, and to close the window. It is worth considering that the modifications on the definition of the universe of discourse can affect the membership functions. Hence, a validation of the membership function parameters is done before saving the modifications, and an error message appear whenever a membership function definition becomes invalid.

A membership function can be created or edited from the MF list with the usual accelerators (Insert key and Enter key or double click). The previous figure shows the window for editing a membership function. The window has fields to introduce the name of the linguistic label, to select the kind of membership function, and to introduce the parameter values. The right side of the window shows a graphical representation of all the membership functions, with the function being edited shown in a different color. The bottom of the window shows a command bar with three options: Set, to close the window saving the changes, Refresh, to repaint the graphical representation, and Cancel, to close the window without saving the modifications.

The third step in the definition of a fuzzy system is to describe the rule bases expressing the relationship among the system variables. Rule bases can be created, edited and removed from their list with the usual shortcuts (Insert key, Enter key or double click, and Delete key). The following window eases the edition of the rule bases.

The rule base edition window is divided into three zones: the left side has the fields to introduce the names of the rule base and the operator set used, and to introduce the lists of input and output variables; the right zone is dedicated to showing the contents of the rules included in the rule base; and the bottom part of the window contains the command bar with the usual buttons to save or reject the modifications, and to close the window.

The input and output variables can be created, edited, or removed with the common list bindkeys. The information required by a variable definition is the name and the type of the variable.

The contents of the rules can be displayed in three formats: free, tabular, and matricial. The free format uses three fields for each rule. The first one contains the confidence weight. The second field shows the antecedent of the rule. This is an auto-editable field, where changes can be made by selecting the term to modify (a "?" symbol means a blank term) and by using the buttons of the window. The third field of each rule contains the consequent description. This is also an auto-editable field that can be modified by clicking the "->" button. New rules can be generated by introducing values on the last row (marked with the "*" symbol).

The button bar at the bottom of the free form allows to create conjunction terms ("&" button), disjunction terms ("|" button), modified terms with the linguistic hedges not ("!" button), more or less ("~" button), slightly ("%" button), and strongly ("+" button), and single terms relating a variable and a label with the clauses equal to ("=="), not equal to ("!="), greater than (">"), smaller than ("<"), greater or equal to (">="), smaller or equal to ("<="), approximately equal to ("~="), strongly equal to ("+="), and slightly equal to ("%="). The "->" button is used to add a rule conclusion. The ">..<" button is used to remove a conjunction or disjunction term (e.g. a term "v == l & ?" is transformed into "v == l"). The free form allows the user to describe more complex relationships among the variables than the other forms.

The tabular format is useful to define rules whose antecedent use only the operators and and equal. Each rule has a field to introduce the confidence weight and a pulldown list per input and output variables. There is no need of selecting all the variables fields, but one input and one output variables have always to be selected. If a rule base contains a rule that cannot be expressed in the tabular format, the table form can not be opened and an error message appears instead.

The matricial format is specially designed to describe a 2-input 1-output rule base. This form shows the content of a rule base in a clear and compact way. The matrix form generates rules such as "if(x==X & y==Y) -> z=Z", i.e., rules with a 1.0 confidence weight and formed by the conjunction of two equalities. Those rule bases that do not have the proper number of variables, or that contain rules with a different format, can not be shown in this form.

Once the operator sets, variable types, and rule bases have been defined; the following step in a fuzzy system definition is to define the global input and output variables by using the Variable Properties window. The information required to create a variable is its name and type.

The final step in a fuzzy system definition is the description of its (possibly hierarchical) structure. The bindkey used to introduce a new module (a call to a rule base) in a hierarchy is the Insert key. To make links between the modules, the user must press the mouse over the node representing the origin variable and release the button over the destination variable node. To remove a link, the user must be select it by clicking on the destination variable node, and then press the Delete key. The tool does not allow to create a loop between modules.

The tool allows the individualized edition of the rules bases of a hierarchical system. To do this, it is necessary to display the system hierarchy in the main Xfuzzy window and double-click on the rule base to be edited, or to select the rule base and press the Insert key. When selecting a rule base, some of the tools in the Xfuzzy main menu are disabled. This is because the use of rule bases of hierarchical systems is limited to tasks of editing, tuning, graphical representation and synthesis.

In the xfedit window it is possible to add new operator sets, change the types of the output variables and modify the rules.

The options enabled in the editing window work in a similar way to those used when editing the complete system. As an observation, it is convenient to add that to change the name of a rule base, you have to access the rule base edit window and change the name there.

For comments, patches, bug reports, etc contact us at:   xfuzzy-team@imse-cnm.csic.es

©IMSE-CNM 2018