function pot = mk_pot_from_mux(bnode, bnet)

if bnet.obs_mask(bnode.gate)  & bnet.wait_till_evidence
  % parent will just be the selected input
  bnode.CPT = eye(bnode.self_size);
else
  %ps = parents(bnet.adj_mat, bnode.self);
  %input = setdiff(ps, bnode.gate);
  ps = bnode.parents;
  input = bnode.input;
  fprintf('mux warning: making CPT with %d parents\n', length(bnode.parents));
  bnode.CPT = mk_CPT_from_mux(find(bnode.gate==ps), find_equiv_posns(input, ps), bnode.self_size);
end

pot = mk_pot_from_tabular(bnode, bnet);

