2 % @file pfqn_lcfsqn_ca.m
3 % @brief Convolution algorithm
for 2-station LCFS queueing networks
5 % @author LINE Development Team
9 % @brief Convolution algorithm
for 2-station LCFS queueing networks
10 % @fn pfqn_lcfsqn_ca(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 V Auxiliary normalization term.
17function [G,V] = pfqn_lcfsqn_ca(alpha,beta,N)
18% [G,V] = PFQN_LCFSQN_CA(ALPHA, BETA, N)
19% Convolution algorithm 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
32% (default: ones(1,R) - one job per class)
35% G - normalizing constant
36% V - auxiliary normalization term
39% G. Casale,
"A family of multiclass LCFS queueing networks with
40% order-dependent product-form solutions", QUESTA 2026.
42% Copyright (c) 2012-2026, Imperial College London
58 prods(r)=prod(N(1:r-1)+1);
60 G = zeros(prod(N+1),1);
61 V = zeros(prod(N+1),1);
64 idx = hashpop(n,N,R,prods);
73 idx_r = hashpop(oner(n,r),N,R,prods);
74 % recursive definition of V
75 V(idx) = V(idx) + V(idx_r);
76 % recursive definition of G uses V and beta
77 G(idx) = G(idx) + alpha(r)^(sum(n)-1)*beta(r) * G(idx_r);
80 V(idx) = prod(alpha.^n) * V(idx);
81 G(idx) = G(idx) + V(idx);