1function [Q,U,R,T,C,X,lG,iter] = solver_sqd(sn, options)
2% [Q,U,R,T,C,X,LG,ITER] = SOLVER_BAS(SN, OPTIONS)
4% Blocking-After-Service (BAS) approximate MVA handler.
6% Wraps npfqn_sqd (chain-aggregated approximation): solves
the single closed chain,
7% then disaggregates
the chain-level throughput, queue length and utilization back to
8% per-class results via sn_deaggregate_chain_results. Supports single-chain closed
9% networks (one or more classes connected by class switching); multi-chain models are
10% rejected, since
the BAS approximation models a single circulating population.
12% Copyright (c) 2012-2026, Imperial College London
19 line_warning(mfilename, sprintf([
'SQD (Smith Queue Decomposition) supports single-chain closed ' ...
20 'networks only; this model is multichain (nchains=%d) - returning empty results.'], sn.nchains));
21 M0 = sn.nstations; K0 = sn.nclasses;
22 Q = nan(M0,K0); U = nan(M0,K0); R = nan(M0,K0); T = nan(M0,K0); C = nan(1,K0); X = nan(1,K0);
26[Lchain,STchain,Vchain,alpha,~,~,refstatchain] = sn_get_demands_chain(sn);
29[Xst,Qst,Ust,Rst] = npfqn_sqd(sn, sn.nclosedjobs);
31% Assemble chain-level (M x 1) matrices
for the single closed chain.
32% Vchain
is normalized to 1 at
the reference station, so
the per-station
33% throughput there equals
the chain reference throughput.
34refstat = refstatchain(1);
41[Q,U,R,T,C,X] = sn_deaggregate_chain_results(sn, Lchain, [], STchain, Vchain, alpha, ...
42 Qchain, Uchain, Rchain, Tchain, [], Xchain);