LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
pfqn_ljdfun.m
1function r = pfqn_ljdfun(nvec, ljdscaling, ljdcutoffs, nservers)
2% R = PFQN_LJDFUN(NVEC, LJDSCALING, LJDCUTOFFS, NSERVERS)
3%
4% Joint-dependence scaling function for AMVA-QD
5%
6% nvec: per-class population vector [n1, n2, ..., nR]
7% ljdscaling: cell array of linearized scaling tables per station
8% ljdcutoffs: M x K matrix of cutoffs
9% nservers: (optional) number of servers per station
10%
11% Returns: r - scaling factor vector (M x 1)
12
13% Copyright (c) 2012-2026, Imperial College London
14% All rights reserved.
15
16M = size(ljdcutoffs, 1);
17K = length(nvec);
18r = ones(M, 1);
19alpha = 20; % softmin parameter
20
21for i = 1:M
22 if ~isempty(ljdscaling{i})
23 % Clamp population to cutoffs
24 nClamped = min(nvec, ljdcutoffs(i, :));
25
26 % Compute linearized index (1-indexed for MATLAB)
27 idx = ljd_linearize(nClamped, ljdcutoffs(i, :));
28
29 % Look up scaling value
30 if idx <= length(ljdscaling{i})
31 r(i) = ljdscaling{i}(idx);
32 end
33 end
34
35 % Handle servers (similar to pfqn_lldfun)
36 if nargin >= 4
37 if isinf(nservers(i)) % delay server
38 % handled in the main code differently
39 else
40 total_n = sum(nvec);
41 r(i) = r(i) / softmin(total_n, nservers(i), alpha);
42 if isnan(r(i)) % if numerical problems in soft-min
43 r(i) = 1 / min(total_n, nservers(i));
44 end
45 end
46 end
47end
48end