function [sample, weight] = propagate_sample(bnet, sample_tm1, obs_nodes_t, vals_t)
% PROPAGATE_SAMPLE Given an instantiation of slice t-1, create one for slice t
% [sample, weight] = propagate_sample(bnet, sample_tm1, obs_nodes_t, vals_t)

% All of slice t-1 is observed. Add new evidence to slice t.
ss = bnet.slice_size;
bnet.observed_nodes = [1:ss  obs_nodes_t(:)'+ss];
evidence = zeros(1, sum(bnet.block_sizes));
evidence(1:ss) = sample_tm1;
evidence(obs_nodes_t+ss) = vals_t;
[two_slice_sample, weight] = lw(bnet, 1, evidence, obs, 2*ss);
sample = two_slice_sample((1:ss)+ss);
