Spark! Fuzzy Logic Editor Help


Variables | Sets | Rules | API | Integration | Tutorial


Sets

Sets are at the heart of fuzzy logic. Spark! provides you with four "membership functions" you can use. 

How do I?

See also the Variables and Rules "how to" pages and the tutorial.

Changing Membership Functions

There are 3 ways you can change the membership function of a Set:

  1. By selecting the Set, right mouse clicking then selecting "Membership Function" then the type of membership function you want to change to.  The current type of membership function will be shown with a "check mark".
  2. Selecting "Set | Membership Function" then selecting the type of membership function you want to change to.  The current type of membership function will be shown with a "check mark".
  3. Click on the appropriate toolbar icon () for the function type you want to change to

Back to top

Moving A Set's Nodes

You can move a Set's nodes individually or all the nodes at once.  To move a single node, select the node and move it.  When a node is selected the mouse pointer changes to a "East/West Pointer".

The movement of nodes is constrained to prevent instances where a membership function would have TWO "Degree of Membership" (or 'y') values for a single input value.

TIP:  If the Shift key is pressed while moving a node, ALL the Set's nodes are moved.

Back to top

Copying/Moving Whole Sets

Sets can be moved (or copied) one of two ways:

  1. Cut/Copy/Paste
  2. Drag and Drop in the tree view
Cut/Copy/Paste
When a Set is selected, you can cut or copy it.  That Set can then be pasted into any variable by selecting the variable and performing a "paste"
 
Drag and Drop in the tree view
In the tree view you can select a Set and drag-and-drop it into another variable.  Holding the SHIFT key while dragging and dropping will copy the Set.

Note:  When Sets are copied or moved they are placed in the same position as the original.  This will make Sets copied into the same variable appear on top of the original, obscuring it.

The color of the Sets is not changed, the Set name is changed to ensure that the Set identifier is unique within the variable.

Back to top

Reordering Sets In The Tree View

Sets can be reordered in the tree view by dragging and dropping them.  This has no effect on where the Sets are displayed within the variable view.

Back to top

Changing A Set's Color

To change a Set's color, select the Set then right mouse click and select "color".  

Back to top

Setting A Set's Shoulder Properties

To change a Set's shoulder state, select the Set then either:

  1. Right mouse click and select "Make Shoulder" then select the appropriate option.
  2. Click on the appropriate toolbar "shoulder" icon ()
  3. Select "Set | Right Shoulder" or "Set | Left Shoulder"

Your options are enabled/disabled depending on the type of Set and the current Set's shoulder state.

Back to top

Selecting A Set

You can select a Set by clicking anywhere on the Set or by selecting the Set from the tree view.

Back to top

Adding A Set

A Set can be added to a variable by going into "insert Set" mode and adding the Set.  To go into "insert Set" mode either select "Set | Insert Set Mode" or pressing the toolbar icon.

Once in "insert Set" mode, select the type of Set to insert by selecting "Set | Membership Function" or pressing the appropriate toolbar icon for the Set type you wish to insert:

Any where you click on the variable view will add a Set.  To exit "add Set" mode, press ESC, select "Set | Insert Set Mode" again or re-press the toolbar icon.

Tip:  To change the width of the Set you're adding, press the right mouse button then move the mouse up or down.  The Set will size accordingly.

Back to top

Deleting A Set

To delete a Set, select it then either:

  1. Hit delete
  2. Select "Set | Delete Set"
  3. Press the toolbar icon:

Back to top

Changing A Set's Name

To change a Set's name you can edit it in the tree view or click on it in the variable view.

Note: Set names must be unique within the variable they are in.

Back to top