Enters the discrete finding state for node. This means that in the case currently being analyzed, node is known with certainty to have value state.

state must be between 0 and n - 1 inclusive, where n is the node's number of states.

If node could already have a finding that you wish to override with this new finding, RetractNodeFindings_bn should be called first, otherwise an "inconsistent findings" error could result (see SetNodeFinding in the examples below).

If you wish to pass the state by name, see the "EnterFinding" example below.

If node is a continuous node that has been discretized, this function will work fine, but it is better to use EnterNodeValue_bn if the real value is known, for possibly improved accuracy when equations are involved, the case is saved to file, or the discretization changes.

If the net has auto-updating (see SetNetAutoUpdate_bn), then a belief updating will be done to reflect the new finding before this function returns (otherwise it will just be done when needed).

Version:

This function is available in all versions. In versions previous to 3.00 there was a NeticaEx function called ChangeFinding that is now called SetNodeFinding.

// This function may be useful if we are not sure whether node
// already has a finding, but if it does we just want to override it.
//
void SetNodeFinding (node_bn* node, state_bn state){
net_bn* net = GetNodeNet_bn (node);
int saved = SetNetAutoUpdate_bn (net, 0); // turning it off can greatly aid efficiency
RetractNodeFindings_bn (node);
EnterFinding_bn (node, state);
SetNetAutoUpdate_bn (net, saved); // if changing further findings, defer this step
if possible, for efficiency
}