function x = sample_bnode(bnode, bnet)
% SAMPLE_BNODE (Dispatch) Draw a random sample from Pr(self | observed parents) for a generic node.
% x = sample_bnode(bnode, bnet)

switch bnode.type
  case 'gaussian',
    x = sample_gaussian(bnode, bnet);
  case 'input',
    x = sample_input(bnode, bnet);
  case 'logistic',
    x = sample_logistic(bnode, bnet);
  case 'noisyfn',
    x = sample_noisyfn(bnode, bnet);
  case 'noisyor',
    x = sample_noisyor(bnode, bnet);
  case 'softmax',
    x = sample_softmax(bnode, bnet);
  case 'tabular',
    x = sample_tabular(bnode, bnet);
  otherwise, 
    error(['bad type' bnode.type]);
end

 
