int GenerateRandomCase_bn ( const nodelist_bn*  nodes,   int  method,   double  timeout )

Generates a random case for nodes (i.e., positive findings for each of them), by sampling from a probability distribution matching that of the net containing nodes, and conditioned on all findings already entered in the net.

timeout indicates how much time to allocate for the task (in relative units). If it cannot finish in time, it will return a negative quantity (no Netica error will be generated). If method is 1, or no findings are entered, then it always returns successfully, and within a fixed amount of time, so then timeout is ignored.

If method is 2, then forward sampling is used. This evaluates equations directly if they are available, rather than just using CPT entries (which may just approximate the equation). However, it uses a rejection method, so it may be very slow if the findings currently entered are improbable.

If method is 1, then the net must be compiled, and the junction tree is used to do very fast sampling with no rejections (i.e. findings don't slow it down).

If method is 0 (the recommended value), then the default method is used. Currently this is method 2 if rejections won't be a problem or the net is uncompiled, otherwise method 1.

Version:

In versions previous to 2.09, this function was named RandomCase_bn.
In versions previous to 1.07, it always used forward sampling.

See also:

GetNodeFinding_bn  Retrieve the random case generated
GetNodeValueEntered_bn  Retrieve the random case generated for a continuous node, method 0