function [changed, new_ps] = change_parents_mux2(bnode, bnet)
% CHANGE_PARENTS_MUX If the gate is observed, select the relevant parent
% [changed, new_parents] = change_parents_mux(bnode, bnet, n)


if all(bnet.obs_mask([bnode.rgate bnode.cgate]))
  r = bnet.values(bnode.rgate);
  c = bnet.values(bnode.cgate);
  new_ps = bnode.input(r,c); % the node number of the selected input
  changed = 1;
else
  changed = 0;
  new_ps = [];
end
