![]() |
NORSYS SOFTWARE © 2002 | NETICA API | C   VERSION   2.15  |
void OptimizeDecisions_bn ( | const nodelist_bn* nodes ) |
Finds the optimal decision function for each decision node in nodes, and attaches it to the node. Each decision function provides the optimal decision for this node (to maximize expected utility) for each configuration of parent states.
WARNING: This function works by absorbing nodes (i.e. reversing links and deleting nodes) according to the algorithm of Shachter86, and after optimal decisions are found, restoring the original network. It is not very efficient, requires no-forgetting links, and allows only a single utility node. Generally it is better to simply compile the network, enter findings, and call GetNodeExpectedUtils_bn. That uses a strong junction tree algorithm, which is more efficient, handles multiple utility nodes, and doesn't require no-forgetting links to be explicit.
As a side effect, Netica may attach optimal decision functions to some other decision nodes not in nodes.
It is okay if nodes contains some nodes that aren't decision nodes; OptimizeDecisions_bn will act as though they weren't in the list. All of the nodes should come from the same net.
You can use GetNodeFuncState_bn to "read out" the decisions found.
If it wasn't possible to do the optimization by node absorptions, Netica will generate an error explaining why not, and leave the net in the most reduced state possible.
Version:
See also:
AbsorbNodes_bn | Call this with just a few nodes at a time, for finer control | |
GetNodeFuncState_bn | To get the decision functions found | |
CompileNet_bn | Alternate, more efficient way |
Example:
// To optimize all the decision nodes in net. // OptimizeDecisions_bn (GetNetNodes_bn (net));