LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
pfqn_lcfsqn_nc.m
1%{
2 % @file pfqn_lcfsqn_nc.m
3 % @brief Normalizing constant for LCFS queueing networks
4 %
5 % @author LINE Development Team
6%}
7
8%{
9 % @brief Computes the normalizing constant for LCFS queueing networks
10 % @fn pfqn_lcfsqn_nc(alpha, beta, N)
11 % @param alpha Service rates at LCFS station (1xR vector).
12 % @param beta Service rates at LCFS-PR station (1xR vector).
13 % @param N Population vector (default: ones(1,R)).
14 % @return G Normalizing constant.
15 % @return Ax Cell array of A matrices for each state.
16%}
17function [G,Ax] = pfqn_lcfsqn_nc(alpha,beta,N)
18% [G,AX] = PFQN_LCFSQN_NC(ALPHA, BETA, N)
19% Normalizing constant for multiclass LCFS queueing networks
20%
21% This function computes the normalizing constant for a 2-station closed
22% queueing network with:
23% - Station 1: LCFS (Last-Come-First-Served, non-preemptive)
24% - Station 2: LCFS-PR (LCFS with Preemption-Resume)
25%
26% Parameters:
27% alpha - vector of inverse service rates at station 1 (LCFS)
28% alpha(r) = 1/mu(1,r) for class r
29% beta - vector of inverse service rates at station 2 (LCFS-PR)
30% beta(r) = 1/mu(2,r) for class r
31% N - population vector, N(r) = number of jobs of class r
32%
33% Returns:
34% G - normalizing constant
35% Ax - cell array of A matrices for each state x=0:K
36%
37% Reference:
38% G. Casale, "A family of multiclass LCFS queueing networks with
39% order-dependent product-form solutions", QUESTA 2026.
40%
41% Copyright (c) 2012-2026, Imperial College London
42% All rights reserved.
43
44K = sum(N);
45R = length(N);
46G = 0;
47Ax=cell(1,K+1);
48for x=0:K
49 Ax{1+x} = make_A(alpha, beta, x, K, R);
50 G = G + perm(Ax{1+x}, N);
51end
52end
53
54
55function A = make_A(alpha, beta, x, K, R)
56% alpha : vector of length R
57% beta : vector of length R
58% x : integer
59% K : matrix size
60if issym(alpha)
61 A = sym(zeros(K, K));
62else
63 A = zeros(K, K);
64end
65for i = 1:R
66 for j = 1:x
67 A(i, j) = alpha(i)^j;
68 end
69 for j = 1:(K-x)
70 A(i, x+j) = alpha(i)^(x+j-1) * beta(i);
71 end
72end
73end