function pi = compute_pi_mux(bnode, bnet)

n = bnode.self;

j = bnet.pearl.parent_index{n}(bnode.gate); % gate is my j'th parent
m = bnet.pearl.msg{n}.pi_from_parent{j};
pi_from_gate = m(:);

pi_from_inputs = collect_pi_from_inputs(bnode, bnet);

pi = pi_from_inputs * pi_from_gate;

