RuleEditor2 Plugin
Overview
Create and modify fuzzy rules.
RuleEditorManager Frame

SingleRuleEditor Frame

Help
General
FuzzyVariables are read from the FuzzyModel. They can be combined to FuzzyValues using modifiers as well as the operators "and" and "or". Bracketing is also possible.
Thus, a FuzzyValue consist of a FuzzyVariable and a linguistic expression. The linguistic expression is a string that may contain terms of the FuzzyVariable, modificators, "and", "or" and brackets.
FuzzyVariable: | temperature |
terms of the variable: | cold, medium, hot |
type: | input |
FuzzyVariable: | water |
terms of the variable: | little, medium, much |
type: | output |
FuzzyVariables: | temperature |
linguistic expression: | very hot or extremely medium |
type: | input |
FuzzyVariable: | water |
linguistic expression: | above medium or much |
type: | output |
A FuzzyRule can be assigned an arbitrary number of condition-FuzzyValues (antecedent, type: input) and conclusion-FuzzyValues (conclusion, type: output). The condition-FuzzyValues are combined with the AntecedentCombineOperator. The FuzzyJ-library offers three possibilities: the MinimumAntecedentCombineOperator, the ProductAntecedentCombineOperator and the CompensatoryAndAntecedentCombineOperator. Note here, that the last operator has a gamma argument that can be adjusted.
In conlusion, a FuzzyRule consists of a collection of Condition-FuzzyValues, a collection of conclusion-FuzzyValues, an AntecedentCombineOperator, an InterfaceStrategy and a name.
User Interface
The main view of the RuleEditor consists of a list of all existing FuzzyRules.

RuleEditor | main class of the plugin, implements all necessary interfaces |
RuleEditorView | panel of the main view including the event handling |
ValueParser | parser/tester for the correctness of FuzzyRules |
IRuleEditorStrings | inteface with all strings of the RuleEditor |
SingleRuleEditor
With the SingleRuleEditorView you can edit FuzzyRules. In consists of two parts: in the top the FuzzyRule-Editor and in the bottom the FuzzyValue Editor.
Name: | name of the FuzzyRule |
Antecedent: | Condition |
Add: | create a FuzzyValue - it can be viewed and edited in the FuzzyValue-Editor |
Remove: | remove a FuzzyValue |
CertainFactor: | certainity factor of the rule |
Conclusion: | conclusion |
FuzzyValueEditor
The FuzzyValueEditor shows the FuzzyValue to edit
Variable: | Selection of the FuzzyValue's FuzzyVariable. Only the terms of a FuzzyVariable can be combined. |
input / output: | depends on wheter a condition-FuzzyValue or an conclusion-FuzzyValue is edited |
available terms: | show the terms of a FuzzyVariable |
insert: | insert a selected term name |
Modififactors: | add corresponding modificator at current position |
ENTER: | parse the linguistic expression and insert in list (show error messages if necessary) |

SingleRuleEditor | View of the SingleRuleEditor including event handling |
SingleValueEditor | panel of the SingleValue editor including event handling, for bottom part of view |
ValueParser | parser / test for correctness of FuzzyRules, FuzzyValues and linguistic expressions |
IRuleEditorStrings | interface containing all strings of the RuleEditor |
Remarks
The views of the editors update automatically when the FuzzyModel changes. The correctness of the values is then checked. If errors occur, an exclamationmark(!) is shown in front of the FuzzyRule name respectively the FuzzyValue.
Classes in-depth
RuleEditor Overview
The rule editor consists of five classes and one interface, that contains all strings to be displayed.
RuleEditor | Main class, implements all interfaces that are necessary for the plugin. Provides methods to create InternalFrames and other plugin-wide methods. |
RuleEditorView | Main GUI, shows list of all rules |
SingleRuleEditor | View of the SingleRule editor, including all event handling. The top part of the Rule editing dialog. |
SingleValueEditor | Panel of the SingleValue editor, including all event handling. The bottom part of the Rule editing dialog. |
ValueParser | parser / tester for the correctness of FuzzyRules, FuzzyValues and linguistig expressions |
IRuleEditorStrings | interface containing all strings of the RuleEditor |

getter/setter | getRuleBase | return current RuleBase of the FuzzyModel |
getVariableBase | returns the current VariableBase | |
getRuleEditorView | return View | |
getInternalFrame | create new internal frame | |
removeInternalFrame | removes internal frame | |
Interface plugman.Plugable | exit | exit program/plugin |
getName | return plugin name | |
getJMenuItem | return menu item | |
getConfigPanel | none available (null) | |
Abstract class AbstractPlugin | initComponents | initialize plugin |
Interface plugman.DataModelAccessable | dataModelCreated | new DataModel has been created or loaded, loads data from the model |
dataModelClosed | DataModel has been closed, exits plugin | |
Interface fuzzymodel.IFuzzyObserver | update | FuzzyModel update has been triggered, forwarded to all refreshing classes |
Eventhandling | actionPerformed | event handling wenn menu item has been selected and plugin activated |
getter/setter | getSingleRuleEditors | returns vector with all SingeRuleEditors |
Eventhanding | actionPerformed | event handling |
valueChanged | event handling of the list | |
other | update | FuzzyModel changed, reloads Rule overview, informs all SingleRuleEditors |
initComponents | initializes all GUI elements |
getter/setter | getInternalFrame | returns internal frame of the windows |
Eventhandling | actionPerformed | event handling |
valueChanged | eventhandling of the lists | |
stateChanged | eventhandling JSpinner | |
Values | addValue | SingleValueEditor created a new FuzzyValue |
editValue | SingleValueEditor modified a FuzzyValue | |
other | update | FuzzyModel changed, refresh display |
initComponents | initialize GUI components | |
createPanel |
getter/setter | setEnabled | (de-)activated the panel and its GUI elements |
clear | clear all content | |
show | creates/displays FuzzyValue | |
Eventhandling | actionPerformed | event handling |
other | update | FuzzyModel changed, refresh display |
initComponents | initialize GUI components | |
createPanel |
New FuzzyModel created or FuzzyModel changed
When a new FuzzyModel is created, the plugin becomes activated in the menu
and an update is executed.
The update is also executed when the FuzzyModel has been updated.
The update is then passed through all classes and each class
refreshes its displays

FuzzyModel closed
When the FuzzyModel is closed, all displayed SingleRuleEditors are closed, then the RuleView itself and the menu entry is deactivated.
FuzzyRule created
When a FuzzyRule is created, it is inserted into the FuzzyRulyBase.
At the same time, a new SingleRuleEditor is created to edit it.
FuzzyRule removed
When a FuzzyRule is created, it is removed from the FuzzyRulyBase.
The automatic refresh of the Base closes the appropriate SingleRuleEditor.
FuzzyRule edited
Is a FuzzyRule closed with Apply, the correctness of all entered values
is tested.
If there is an error, a warning is displayed and the closing of the editor
is cancelled.
Altering the values in the editor leads directly carried into the Rule.
FuzzyValue Created
Is a new FuzzyValue created using Add,
the SingleValueEditor is activated and the existing
FuzzyVariables are loaded into the GUI.
There, FuzzyValues can be created by combining terms.
Hitting Enter validates the FuzzyValue and adds it to the
Anteccedent or Conclusion list.
Editing FuzzyValues
Editing a FuzzyValue is similar to creating one. In addition, a FuzzyValue-string is loaded into the text field.