function new_bnode = modify_parents_bnode(bnode, parents, bnet)
% MODIFY_PARENTS_BNODE (Dispatch) Change the set of parents and randomize the params for a generic node.
% bnode = modify_parents_bnode(bnode, parents, bnet)
%
% This is called by learn_dbn_structure.

switch bnode.type
  case 'gaussian',
    new_bnode = modify_parents_gaussian(bnode, parents, bnet);
  case 'input',
    new_bnode = modify_parents_input(bnode, parents, bnet);
  case 'logistic',
    new_bnode = modify_parents_logistic(bnode, parents, bnet);
  case 'noisyfn',
    new_bnode = modify_parents_noisyfn(bnode, parents, bnet);
  case 'noisyor',
    new_bnode = modify_parents_noisyor(bnode, parents, bnet);
  case 'softmax',
    new_bnode = modify_parents_softmax(bnode, parents, bnet);
  case 'tabular',
    new_bnode = modify_parents_tabular(bnode, parents, bnet);
  otherwise,
    error(['unrecognized node type ' bnode.type]);
end
