2 % @file pfqn_lcfsqn_nc.m
3 % @brief Normalizing constant
for LCFS queueing networks
5 % @author LINE Development Team
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.
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
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)
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
34% G - normalizing constant
35% Ax - cell array of A matrices for each state x=0:K
38% G. Casale,
"A family of multiclass LCFS queueing networks with
39% order-dependent product-form solutions", QUESTA 2026.
41% Copyright (c) 2012-2026, Imperial College London
49 Ax{1+x} = make_A(alpha, beta, x, K, R);
50 G = G + perm(Ax{1+x}, N);
52% The permanent counts the N(r)! orderings of the identical
class-r jobs, so it
53% overstates G by prod(N!). pfqn_joint.m divides by exactly
this factor for the
54% same reason. Without it
this routine disagreed with pfqn_lcfsqn_ca, which the
55% NC solver actually uses as the normalizing constant.
56G = G / prod(factorial(N));
60function A = make_A(alpha, beta, x, K, R)
61% alpha : vector of length R
62% beta : vector of length R
65% perm(A,N)
requires A to be (sum(N) x R): rows are job slots, columns are
66% class groups (see matlab/util/perm.m). This built the TRANSPOSE, class on the
67% row, in a K x K buffer, so rows R+1..K stayed zero and every Ryser term
68% carried a zero
factor: G came back as 0 for every population other than the
69% all-ones default, where the matrix happens to be square and symmetric under
81 A(x+j, i) = alpha(i)^(x+j-1) * beta(i);