LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
pfqn_pbh.m
1%{
2%{
3 % @file pfqn_pbh.m
4 % @brief Performance Bound Hierarchy (Eager-Sevcik 1983) for single-class
5 % closed product-form networks.
6%}
7%}
8
9function [Xlo,Xhi,Qlo,Qhi] = pfqn_pbh(L,N,Z,level)
10%{
11%{
12 % @brief Level-`level` Performance Bound Hierarchy throughput/queue bounds.
13 % i MVA steps from an ABA-initialized residence give nested
14 % optimistic/pessimistic bounds converging to exact MVA as level->N
15 % (Eager-Sevcik 1983, ACM TOCS 1(2):99-115, eqs. 5-13). Level 1 with
16 % Z=0 equals the BJB optimistic bound; level 2 with Z=0 equals the
17 % closed form 1 + S(N-1), S = sum L_k^2.
18 % @fn pfqn_pbh(L, N, Z, level)
19 % @param L Service demand vector (M x 1).
20 % @param N Population (scalar).
21 % @param Z Think time (scalar, default 0).
22 % @param level Hierarchy level >= 0 (default 1); clamped to N.
23 % @return Xlo Lower throughput bound (pessimistic residence).
24 % @return Xhi Upper throughput bound (optimistic residence, joint with the
25 % asymptotic bound and 1/max(L)).
26 % @return Qlo Per-station lower queue-length bound (M x 1), Little bracket.
27 % @return Qhi Per-station upper queue-length bound (M x 1), Little bracket.
28%}
29%}
30L = L(:);
31if nargin < 3 || isempty(Z), Z = 0; end
32if nargin < 4 || isempty(level), level = 1; end
33Lmax = max(L);
34
35Ro = pbh_residence(L,N,Z,level,'opt'); % per-station optimistic residence
36Rp = pbh_residence(L,N,Z,level,'pess'); % per-station pessimistic residence
37
38% joint with the asymptotic residence lower bound: R(N) >= max(N*Lmax-Z, R(1)),
39% R(1)=sum(L) (the Eager-Sevcik model is normalized to sum(L)=1).
40RoC = max(sum(Ro), max(N*Lmax - Z, sum(L)));
41Xhi = min(1/Lmax, N/(Z + RoC));
42Xlo = N/(Z + sum(Rp));
43
44% Little's law bracket: Q_k = X*R_k, with X in [Xlo,Xhi], R_k in [Ro_k,Rp_k].
45Qlo = Xlo * Ro;
46Qhi = Xhi * Rp;
47end
48
49function Rk = pbh_residence(L,N,Z,level,side)
50% Per-station residence-time vector of the level-`level` PBH bound.
51K = numel(L);
52[~, b] = max(L);
53level = min(level, N);
54n0 = N - level;
55switch side
56 case 'opt', Rk = ones(K,1) * max(n0*L(b) - Z, sum(L))/K; % eq (7), ABA opt
57 case 'pess', Rk = zeros(K,1); Rk(b) = n0; % eq (13), ABA pess
58end
59if n0 == 0
60 Rk = zeros(K,1); % exact empty base
61end
62for n = n0+1:N
63 Rtot = sum(Rk);
64 if n == 1 || Z + Rtot == 0
65 Rk = L; % empty-network base step
66 else
67 Rk = L .* (1 + (n-1) * Rk / (Z + Rtot)); % eq (5)
68 end
69end
70end
Definition Station.m:245