Table of Contents


Defining Sensors and Effectors

Sensors and effectors are merely aliases for method names on Java objects and allow you to call named methods from within rules while the rules are being evaluated by the fuzzy inference engine. Sensors are typically used in assertions and antecedent clauses to unconditionally set or test a variable's current value to some real time value in the external world. Effectors are used in consequent clauses to effect a change in the external world.

On this page...


Sensors

Use this statement to declare that certain methods will be available to be called during inferencing from within rules. Any methods named in the Sensors statement can be used in assertions and antecedent clauses of rules. It is up to you to pass in the proper number of arguments to a sensor when it is invoked.

Syntax

   Sensors ( <sensorNames>* )
      

Parameters

       <sensorNames>
Is a list of zero or more identifiers that identify methods that can be run to obtain values from the external world.

Examples


   Sensors()              // No sensors available at runtime

   Sensors(a, b)          // Two sensors available at runtime:
                          //   method a and method b.

   // Rules that use the declared sensors:
   r1: myVar = a()        // The result of calling sensor a is
                          //   placed into variable myVar.

   r2: otherVar = b(someVar)   // The result of calling sensor b
                               //   with argument someVar is placed
                               //   into variable otherVar.

   r3: if myVar = a() then...  // myVar is tested against the
                               //   value returned by sensor a.   
      

Sensors is an optional statement and may be omitted altogether.

Return to top

Effectors

Use this statement to declare that certain methods will be available to be called during inferencing from within rules. Any methods named in the Effectors statement can be used in consequent clauses of rules. It is up to you to pass in the proper number of arguments to an effector when it is invoked.

Syntax

   Effectors ( <effectorNames>* )
      

Parameters

       <effectorNames>
Is a list of zero or more identifiers that identify methods that can be run to effect changes in the external world.

Examples


   Effectors()                 // No effectors available at runtime

   Effectors(a, b)             // Two effectors available at runtime:
                               //   method a and method b.

   // Rules that use the declared effectors:
   r1: if myVar = x then       // If the condition is true
         y = a();              // the result of calling effector a
                               // is placed into variable y.

   r2: if myVar = x then       // If the condition is true
         y = b(someVar);       // the result of calling effector b
                               // with argument someVar is
                               // placed into variable y.
      

Effectors is an optional statement and may be omitted.

Return to top
Rule language table of contents.
Fuzzy editor table of contents.
Fuzzy System table of contents.

Last modified: Wed Apr 19 15:20:12 CDT 2000