function pot = mk_pot_from_bnode(bnode, bnet)
% MK_POT_FROM_BNODE (Dispatch) Compute a potential representing the conditional distrib. of a generic node.
% pot = mk_pot_from_bnode(bnode, bnet)

switch bnode.type
  case 'adder'
    pot = mk_pot_from_adder(bnode, bnet);
  case 'gaussian'
    pot = mk_pot_from_gaussian(bnode, bnet);
  case 'input'
    pot = mk_pot_from_input(bnode, bnet);
  case 'logistic'
    pot = mk_pot_from_logistic(bnode, bnet);
  case 'mux'
    pot = mk_pot_from_mux(bnode, bnet);
  case 'mux2'
    pot = mk_pot_from_mux2(bnode, bnet);
  case 'noisyfn',
    pot = mk_pot_from_noisyfn(bnode, bnet);
  case 'noisyor',
    pot = mk_pot_from_noisyor(bnode, bnet);
  case 'softmax'
    pot = mk_pot_from_softmax(bnode, bnet);
  case 'tabular',
    pot = mk_pot_from_tabular(bnode, bnet);
  otherwise,
    error(['bad type ' bnode.type]);
end

