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 ChangeFinding 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.

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:

// 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 ChangeFinding (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:
// 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 = NodeNamed_bn (node_name, net);
    state_bn state = StateNamed_bn (state_name, node);
    EnterFinding_bn (node, state);
}