LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
pfqn_cdfun.m
1%{
2%{
3 % @file pfqn_cdfun.m
4 % @brief AMVA-QD class-dependence function for queue-dependent scaling.
5%}
6%}
7
8%{
9%{
10 % @brief AMVA-QD class-dependence function for queue-dependent scaling.
11 % @fn pfqn_cdfun(nvec, cdscaling, classIdx)
12 % @param nvec Population state vector.
13 % @param cdscaling Cell array of class-dependent scaling functions.
14 % @param classIdx Optional class index selecting beta_{i,r} (default: 1).
15 % @return r Scaling factor vector for each station.
16%}
17%}
18function r = pfqn_cdfun(nvec, cdscaling, classIdx)
19% R = PFQN_CDFUN(NVEC, CDSCALING, CLASSIDX)
20%
21% AMVA-QD class-dependence function. Returns, for every station i, the
22% reciprocal of the class-dependent scaling
23% beta_{i,r}(n_i1, ..., n_iR)
24% evaluated at the per-class population vector NVEC(i,:), for class r=CLASSIDX.
25%
26% CDSCALING{i} is a function handle of the per-class population vector at
27% station i. It may return either
28% - a scalar, i.e. a chain-independent scaling beta_i(n) shared by every
29% class (the common case, and the historical contract), or
30% - a vector of length R, i.e. the per-class scalings
31% [beta_{i,1}(n), ..., beta_{i,R}(n)], of which element CLASSIDX is taken.
32% The per-class form expresses Sauer's chain-dependent service rates
33% mu_{r,i}(n) (Sauer 1983, "Computational Algorithms for State-Dependent
34% Queueing Networks", eq. (40)), so a single class-dependence mechanism covers
35% both the chain-independent and the chain-specific cases.
36%
37% Copyright (c) 2012-2026, Imperial College London
38% All rights reserved.
39if nargin < 3 || isempty(classIdx)
40 classIdx = 1;
41end
42M = size(nvec,1);
43r = ones(M,1);
44if ~isempty(cdscaling)
45 for i = 1:M
46 if isempty(cdscaling{i})
47 continue
48 end
49 v = cdscaling{i}(nvec(i,:));
50 if numel(v) > 1
51 % per-class beta_{i,r}: select the requested class
52 v = v(classIdx);
53 end
54 r(i) = 1 / v;
55 end
56end
57end
Definition Station.m:245