LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
pfqn_mcub.m
1%{
2%{
3 % @file pfqn_mcub.m
4 % @brief Multiclass Composite Upper Bound (Kerola 1986) on per-class
5 % throughput for closed product-form networks.
6%}
7%}
8
9function [Xub,Xlb] = pfqn_mcub(L,N,Z)
10%{
11%{
12 % @brief Kerola's composite bound method (Perf. Eval. 6:1-9, eqs. 10-16).
13 % Given per-class multiclass BJB lower bounds X_s^-, the residual-
14 % utilization composite upper bound is
15 % X_r <= min_k [1 - sum_{s!=r} X_s^- L_ks] / L_kr,
16 % computed at O(KR). Much tighter than per-class ABA at moderate load.
17 % (Named pfqn_mcub because pfqn_cub is the unrelated cubature NC method.)
18 % @fn pfqn_mcub(L, N, Z)
19 % @param L Service demand matrix, station x class (M x R).
20 % @param N Population vector (1 x R).
21 % @param Z Think time vector (1 x R, default zeros).
22 % @return Xub Composite upper throughput bound per class (1 x R).
23 % @return Xlb Multiclass BJB lower throughput bound per class (1 x R, eq. 10).
24%}
25%}
26[M,R] = size(L);
27N = N(:)';
28if nargin < 3 || isempty(Z), Z = zeros(1,R); end
29Z = Z(:)';
30Ntot = sum(N);
31R0 = sum(L,1); % per-class total demand (1 x R)
32Lb = max(L,[],1); % per-class bottleneck demand (1 x R)
33
34% eq (10): multiclass Balanced Job Bounds lower throughput bound.
35Xlb = N ./ (R0 + Z + (Ntot - 1).*Lb);
36
37% eqs (13)-(16): composite upper bound per class.
38Xub = zeros(1,R);
39for r = 1:R
40 Uoth = zeros(M,1); % utilization at each device by other classes
41 for s = 1:R
42 if s ~= r
43 Uoth = Uoth + Xlb(s) * L(:,s);
44 end
45 end
46 Ucub = 1 - Uoth; % residual utilization available to class r
47 dev = inf(M,1);
48 for k = 1:M
49 if L(k,r) > 0
50 dev(k) = Ucub(k) / L(k,r);
51 end
52 end
53 Xub(r) = min(dev);
54end
55end