function [sample, weight] = init_sample(bnet, obs_nodes_t, vals_t)
% INIT_SAMPLE Create a sample of the first slice
% [sample, weight] = init_sample(bnet, obs_nodes_t, vals_t)

ss = bnet.slice_size;
bnet.observed_nodes = obs_nodes_t(:);
bnet.values = blockmatrix(1, bnet.blocks(:)); % clear old evidence
bnet.values(obs_nodes_t) = vals_t;
% By restricting attention to the first ss nodes, we don't make weight smaller than necessary.
[two_slice_sample, weight] = lw(bnet, 1, ss);
sample = two_slice_sample(1:ss);
