LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
signalBatchPMF.m
1function [kvals, kprobs] = signalBatchPMF(sn, class, ntot)
2% [KVALS, KPROBS] = SIGNALBATCHPMF(SN, CLASS, NTOT)
3%
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.
11
12kvals = 1;
13kprobs = 1;
14if ~isfield(sn, 'signalremdist') || numel(sn.signalremdist) < class || isempty(sn.signalremdist{class})
15 return
16end
17dist = sn.signalremdist{class};
18
19support = 0:ntot;
20pmf = zeros(1, numel(support));
21for i = 1:numel(support)
22 pmf(i) = dist.evalPMF(support(i));
23end
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];
28kprobs = [head, tail];
29
30keep = kprobs > 0;
31kvals = kvals(keep);
32kprobs = kprobs(keep);
33if isempty(kvals)
34 kvals = 1;
35 kprobs = 1;
36 return
37end
38kprobs = kprobs / sum(kprobs);
39end
Definition Station.m:245