User-Defined Fields

Sometimes it is useful to be able to define your own fields for nodes or nets, with names that you choose, and give them the kind of values you want (integers, real numbers, or text).  These have sometimes been called attribute-value pairs, and are saved in the Bayes net file along with the rest of the information about the nodes and net.  Netica API can also read and set user-defined fields, so they are a great way to communicate with your own program through Netica Application and then Netica API.

There are two ways to work with user-defined fields.  The first is described in a page on the Node Properties Dialog.  The second is described below.

Setting:  Right-click on a node and choose User Defined Enter to create a new user field, or User Defined field name to change the value of an existing one.  If you create a new user field, Netica will verify that its name meets the requirements of an IDname.  You can do the same thing to several nodes at once by selecting them before right-clicking one of them, and you can do it to the net itself by right-clicking on the net's background and choosing Modify User Defined field name.

Observing:  To observe the values assigned to user fields of a node or net, right-click the node or net background and choose User Defined.  The values will appear within the menu.  If they are too large for the menu, or contain special characters, you can use the Node Properties Dialog instead.

Removing:  To remove a field from a node, right-click the node and choose User Defined field name.  When the dialog box asking for the value comes up, make it empty and press Okay.  Then Netica will ask you if you just want an empty value, or if you want to remove the field.  You can do the same thing to several nodes at once by selecting them before right-clicking one of them, and you can do it to the net itself by right-clicking on the net's background and choosing Modify User Defined field name.

 

Tips:

 

 If you want to define the same user-field for several nodes at once, but give them each different values: Select the nodes, right-click and choose User Defined Enter, enter the name you want for the field and press Okay, then leave the value box empty and press Okay, No.  Now go to each node and right-click, then choose User Defined field name.  You will be able to keep track of which ones you've already entered, based on which are empty.

 For categorizing nodes, rather than user-defined fields, you may want to use node-sets, since Netica has some specialized features for working with them, such as selecting all the nodes in some node-set, reporting all the nodes in a node-set, and choosing display colors based on node-sets.

 If there are so many user fields that it is difficult choosing the name from a menu, instead of choosing User Defined field name, you can choose User Defined Enter, and then type the name of the user field you want to view or modify.