const util_bn* GetNodeExpectedUtils_bn ( node_bn*  node )

Returns a vector providing the expected utility of each choice in a decision node, considering findings currently entered (each entry is a util_bn, which is a 'float').

The vector will be indexed by states, with one utility for each state (i.e., choice).

The net containing node must be a decision net (i.e., have decision and utility nodes), which has been compiled before calling this (with CompileNet_bn), or an error will be generated. If the net has been modified it must be recompiled, but just entering findings does not require a recompile.

Before calling this all preceding decision nodes must have positive findings entered.

node must be a decision node.

If belief updating hasn't been done since the last findings were entered, it will be done before this function returns, which can be time consuming (you can call IsBeliefUpdated_bn before calling this to find out if belief updating will be done).

If you need the utilities to persist, make a copy of the vector returned, since its contents may become invalid after further calls to Netica API. Do not try to directly modify or free the vector returned.

If you wish to retrieve a whole table of values, providing the optimal state to choose given the parent states, use GetNodeFuncState_bn.

Version:

Versions 1.07 and later have this function.

See also:

GetNodeFuncState_bn    Retrieve table of optimal choices as a function of parent values
GetNodeNumberStates_bn    Determine the length of the vector returned
GetNodeBeliefs_bn    For the beliefs of a nature node
GetNodeExpectedValue_bn    Don't confuse it with this function, which gets the expected real value of a nature node