function bnode = mk_adder_node(bnet, self, delta)
% MK_ADDER_NODE Make a node for which output = input + delta mod N, where N is the arity of the input/output.
%
% bnode.delta controls the increment value.

if ~exist('delta'), delta = 1; end

%% This node type can only be used when algo = 'pearl'

bnode.type = 'adder';
bnode.adjustable = 0;
bnode.self = self;
bnode.parents = parents(bnet.adj_mat, self);
assert(length(bnode.parents)==1);
bnode.self_size = bnet.node_sizes(self);
assert(subset([bnode.parents bnode.self], bnet.discrete_nodes));
bnode.nparams = 0; % since deterministic
bnode.delta = delta;

bnode.CPT = mk_CPT_from_adder(bnode.self_size, bnode.delta);
