Spark! Fuzzy Logic Editor Help


Variables | Sets | Rules | API | Integration | Tutorial


Rules

Rules are traditionally the messiest part of fuzzy logic.  Depending on how many fuzzy variable and sets you have, there can be MANY rules which can get real ugly, real quick.  Read below to see how Spark! greatly eases rule creation and shows you just the information you want to know.

How do I:

See also the Set and Fuzzy Variables "how to" pages and the tutorial.

Creating Rules

To create a rule simply click on the buttons (so they are pressed DOWN) that comprise that rule.

Back to top

Deleting Rules

To delete a rule simply click on the sets that comprise the rule and un-click the output set.  To change the output set of a rule simply click on a different set in the output variable.

Back to top

Deleting All Rules

To delete all rules select "Rules | Clear Rules" or click on it's toolbar icon:

Note:  all the rules are also deleted if a variable is added or deleted.

Back to top

Moving Rule Buttons

Rule buttons can be arranged any way you like.  To move a rule lasso it by right mouse clicking on a non-button area and drag the lasso to encompass the buttons you wish to move.  The selected buttons will be "highlighted" by appearing darker than the non-selected buttons.  Release the right mouse button and click (and hold the button) on any highlighted button to move it.

You can also select (and de-select) individual buttons by control-clicking on them.

Back to top

Seeing All The Rules That Involve Specific Sets

When you press any set button, any rules that are contain that term are highlighted.  If you have many rules and select only one term you'll see lots of rules.  As you click more sets, less rules are highlighted as only the rules involving the pressed sets are shown.

Back to top

Seeing All The Rules Activated By The Current Input

When debugging it is invaluable to see the rules that are being activated by the current input to the Spark! model.  If the "View | Active Rules" menu ( on the toolbar) choice is checked you will see these rules along with the "activation level" or "degree of membership" for each Set.

Back to top

Seeing Any Missing Rules 

When dealing with non-trivial systems it's easy to miss some rules.  To fine out which rules are missing select "View | Missing Rules" or click the toolbar icon:

The missing rules that are displayed can be "parsed" down by the same logic as Seeing All The Rules That Involve Certain Terms.

Back to top

Turning On/Off The Rules That Are Activated By The Current Input

While seeing the rules that are activated by current inputs to the Spark! model is a cool feature, sometimes it gets in the way - especially when creating rules.  You can turn on or off this feature via the "View | Active Rules" menu choice or by clicking on it's toolbar icon:

Back to top

Aligning Rule Buttons

 Buttons can be automatically aligned by their left side or top.  Select the buttons you wish to align (either by lassoing them or control-clicking on them) then select either "Rules | Left Align" or "Rules | Top Align" or their associated toolbar icons: and respectively.

 Back to top

Fitting The Rules To The Screen Size 

By selecting the "Rules | Fit To Window" menu choice or clicking on it's toolbar icon: Spark! will attempt to fit the rules within the window, if it cannot it will size them at the minimum spacing and enable scroll bars.

Back to top

Adding/Removing Batches Of Rules

There are times when you want to create (or remove) a large number of rules for one output set.  To quickly do this press down the rules you want involved then hold SHIFT while you press (or UNpress to remove) the output set.

Back to top