void EnterFinding_bn ( node_bn*  node,   state_bn  state )

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.

See also:

EnterFindingNot_bn    To indicate that node isn't in some state
EnterNodeValue_bn    To enter the real value of a continuous node
EnterNodeLikelihood_bn    To enter uncertain findings
GetNodeFinding_bn    To retrieve findings entered so far
RetractNodeFindings_bn    To remove the finding entered
GetNodeNumberStates_bn    state must be between 0 and one less than this, inclusive

Example:

The following function is available in NeticaEx.c:
// 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 }
Example 2:
The following function is available in NeticaEx.c:
// This function is useful to enter a finding based on the names // of the node and state. // void EnterFinding (char* node_name, char* state_name, net_bn* net){ node_bn* node = GetNodeNamed_bn (node_name, net); state_bn state = GetStateNamed_bn (state_name, node); EnterFinding_bn (node, state); }