The following table describes the various types of variables and parameters:
Creating a Variable or Parameter
To create a variable or parameter:
Select KB Workspace > New Object > g2-variable or parameter, then choose
the desired type:
|
To identify the external data source or target:
Specify one of the following values for Data-server in the variable's table:
Inference engine
G2
GFI data server
GSI data server
The following figure illustrates a logical variable and its table:
|
Note: When you set the Data-server attribute to inference engine for a variable,
NOL uses the G2 conclude action to change values locally within NOL.
When you set the Data-server attribute to anything other than inference
engine, however, NOL uses the G2 set action to set the value in the external
system.
Creating a Sensor
Sensors are a particular kind of variable that obtains or passes quantitative values
from or to external data sources; sensors do not allow the specification of a
formula.
To create a sensor:
KB Workspace > New Definition > object-definition to create a new class of object.
Direct-superior-classes as sensor.
Name of the new object.
create instance from the new object's menu to create an instance of the object.
Data-server for the sensor in the new object's table.
|
Connecting a Variable or Parameter to a Block
To connect a variable or parameter to a block:
Drag a connection stub from the block into the variable or parameter, and
click inside the icon to make the connection.
|
You can also connect variables and parameters to the output path of any block, for
example, to send data to an external process or to initiate forward chaining:
|
Caution: In general, do not create a variable or parameter that both receives data
from an input path and sets data onto an output path, because NOL cannot
guarantee the order of execution of the variable or parameter relative to
other blocks.
Overriding Values of Variables and Parameters
Any variable or parameter connected at the input end of a data, inference, or
control path contains two additional menu choices:
override
lock or unlock
To manually override a variable or parameter:
Use the override menu choice.
Manually overriding the value of a variable or parameter automatically locks the
object, which displays a lock icon associated with the object. A locked object
prevents the propagation of values obtained from any data source other than
manual. For example, if a rule or procedure concludes a value into a locked
variable, or if an external data source passes a new value into the variable, the
variable receives the value but does not propagate it onto the path. Manually
overriding the value of a locked variable or parameter does propagate the value.
unlock in its menu; an unlocked object contains lock in its
menu.
To unlock a locked object:
Select unlock from the object's menu, or delete the lock icon by selecting
delete from the icon's menu.
override from the menu. The figure also shows
the override menu choice and associated dialog box.
|
Coercing Data Using Variables and Parameters as Input
When using variables and parameters to set values onto a path, the override
dialog and the resulting value that appears on the output path depend on two
things:
You can also connect variables and parameters to connection paths where the data types do not correspond. For example, you can connect a float variable to an inference path, which converts the float value to a status and belief value.
Examples of Data Coercion Using Variables and Parameters as Input
The following figure illustrates two quantitative parameters connected to a data
path using a Summation block. The figure shows the Type-in override dialog for
one of the parameters and the table for one of the data paths.
|
This figure illustrates two logical variables connected to inference paths using an
And gate. The figure shows the T/F Radio Button override dialog for one of the
variables and the table for one of the inference paths.
|
This figure illustrates a symbolic variable connected to an inference path using a
Not gate. The figure shows the T/F/U Radio Button override dialog for the
variable and the table for the inference path.
|
The next figure illustrates a float variable connected to a control path using a
Control Counter block. The figure shows the output control signal dialog for the
variable.
|
Coercing Data Using Variables and Parameters as Output
NOL also coerces data passed into a variable or parameter from a path. The
following chart summarizes the data coercion that takes place when you use the
various types of variables and parameters as output from the four input path
types. The cells indicate the value stored in the variable or parameter based on the
input value. The shaded cells indicate combinations that are not possible. See
"Examples of Data Coercion Using Variables and Parameters as Output" for
examples.
Examples of Data Coercion Using Variables and Parameters as Output
The following figure shows a Numeric Entry Point connected to a logical variable.
The figure shows the Type-in override dialog for the Numeric Entry Point and the
table for the logical variable.
|
The next figure shows a Belief Entry Point connected to a float variable. The figure
shows the T/F/U override dialog for the Belief Entry Point and the table for the
float variable.
|
| Prev
| Next | Start of Chapter | End of Chapter | Contents | Index | (9 out of 12)
Copyright © 1996, Gensym Corporation, Inc.