1function [kvals, kprobs] = signalBatchPMF(sn,
class, ntot)
2% [KVALS, KPROBS] = SIGNALBATCHPMF(SN, CLASS, NTOT)
4% Batch-size distribution of
the jobs removed by signal
class CLASS when
5% NTOT eligible jobs are present. Without a removal distribution a signal
6% removes exactly one job. With one,
the pmf
is clipped at NTOT: a batch
7% larger than
the eligible population empties it instead of driving
the
8% queue negative, so
the tail
P(B >= NTOT) lumps onto
"remove NTOT". This
9% matches
the min(B, n) clipping in SolverLDES and
the tail term that
10% SolverMAM puts on
the empty state.
14if ~isfield(sn,
'signalremdist') || numel(sn.signalremdist) <
class || isempty(sn.signalremdist{
class})
17dist = sn.signalremdist{
class};
20pmf = zeros(1, numel(support));
21for i = 1:numel(support)
22 pmf(i) = dist.evalPMF(support(i));
24% Everything at or beyond ntot removes
the whole eligible population.
25head = pmf(1:end-1); % B = 0 .. ntot-1
26tail = max(0, 1 - sum(head)); %
P(B >= ntot)
27kvals = [support(1:end-1), ntot];
38kprobs = kprobs / sum(kprobs);