LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
fj_rmax_evd.m
1%{ @file fj_rmax_evd.m
2 % @brief Maximum response time using Extreme Value Distribution approximation
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Maximum response time using Extreme Value Distribution approximation
9 %
10 % @details
11 % Approximates the expected value of the maximum response time for K
12 % parallel servers using the Extreme Value Distribution (EVD).
13 %
14 % R_K^max(rho) = R(rho) + (sqrt(6)*ln(K)/pi) * sigma_R(rho)
15 %
16 % where R(rho) is the mean response time and sigma_R(rho) is the standard
17 % deviation of response time.
18 %
19 % This approximation is based on fitting the response time distribution
20 % to a Gumbel (Type I extreme value) distribution with:
21 % - Location parameter: a = R - gamma*b
22 % - Scale parameter: b = sqrt(6)*sigma_R/pi
23 %
24 % where gamma ≈ 0.5772 is the Euler-Mascheroni constant.
25 %
26 % Note: Thomasian et al. [2007] found that dividing the correction term
27 % by 1.27 improves accuracy.
28 %
29 % @par Syntax:
30 % @code
31 % Rmax = fj_rmax_evd(K, R, sigma_R)
32 % Rmax = fj_rmax_evd(K, R, sigma_R, calibrated)
33 % @endcode
34 %
35 % @par Parameters:
36 % <table>
37 % <tr><th>Name<th>Description
38 % <tr><td>K<td>Number of parallel servers (positive integer)
39 % <tr><td>R<td>Mean response time
40 % <tr><td>sigma_R<td>Standard deviation of response time
41 % <tr><td>calibrated<td>Optional: use calibrated formula (default: false)
42 % </table>
43 %
44 % @par Returns:
45 % <table>
46 % <tr><th>Name<th>Description
47 % <tr><td>Rmax<td>Approximate maximum response time R_K^max
48 % </table>
49 %
50 % @par Reference:
51 % A. Thomasian, "Analysis of Fork/Join and Related Queueing Systems",
52 % ACM Computing Surveys, Vol. 47, No. 2, Article 17, July 2014.
53 % Eq. (43) on page 17:21.
54%}
55function Rmax = fj_rmax_evd(K, R, sigma_R, calibrated)
56
57if nargin < 4
58 calibrated = false;
59end
60
61if K < 1
62 line_error(mfilename, 'K must be a positive integer. Got K=%d.', K);
63end
64
65if R <= 0
66 line_error(mfilename, 'Mean response time R must be positive.');
67end
68
69if sigma_R < 0
70 line_error(mfilename, 'Standard deviation sigma_R must be non-negative.');
71end
72
73% EVD approximation: R_K^max = R + (sqrt(6)*ln(K)/pi) * sigma_R
74correction_factor = sqrt(6) * log(K) / pi;
75
76if calibrated
77 % Calibrated version from Thomasian et al. [2007]
78 % Divides the correction term by 1.27 for improved accuracy
79 correction_factor = correction_factor / 1.27;
80end
81
82Rmax = R + correction_factor * sigma_R;
83
84end