| NORSYS SOFTWARE © 2010 | NETICA API | C VERSION 4.18

void SetNodeFuncReal_bn ( | node_bn* node, const state_bn* parent_states, double func_value )

This is for deterministic nodes that are continuous or have been given real levels (e.g., by SetNodeLevels_bn). Deterministic nodes can be expressed as a function of their parent nodes, and that function can be in the form of a table. The purpose of SetNodeFuncReal_bn is to build that table. It adds an entry to the table by telling Netica that when each parent has the state indicated in the vector parent_states, the value of node is func_value.

The order of the states in parent_states should match the order of the nodes in the list returned by GetNodeParents_bn (this will be the same order that parents were added using AddLink_bn). MapStateList_bn may be useful for that. parent_states can be NULL if node has no parents.

If any entry of parent_states is EVERY_STATE then it applies to all possible values of the corresponding parent (see SetNodeProbs_bn).

If node has many parents (i.e., the product of their number of states is large) then the function table will be large, and your system may run out of memory. You can use GetError_ns after calling this to see if the table was successfully built.

To cycle through all the possibilities of parent_states, see the NeticaEx function NextStates.

Version:

Versions 2.06 and earlier didn't have this function, but had one called SetNodeFuncValue_bn, which worked almost the same, but took both discrete and continuous nodes (i.e., combined this and SetNodeFuncState_bn).
In versions 1.33 and earlier, "EVERY_STATE" was called "WILDCARD_STATE".

See also:

GetNodeFuncReal_bn |  | Retrieves values
SetNodeFuncState_bn |  | Same, but builds state integer tables instead of real-valued tables
SetNodeProbs_bn |  | To use instead if node isn't deterministic
MapStateList_bn |  | To create the state list passed in

Example:

    The following function is available in NeticaEx.c:
    void SetNodeFuncReal (node_bn* node, double value, ...);
    // The first example of SetNodeFuncState_bn can be adapted for real values
    // by just passing a double instead of an int for value, and calling
    // SetNodeFuncReal_bn instead of SetNodeFuncState_bn.