LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
fj_rmax.m
1%{ @file fj_rmax.m
2 % @brief Compute maximum response time R_K^max(rho) for K M/M/1 queues
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Compute maximum response time R_K^max(rho) for K M/M/1 queues
9 %
10 % @details
11 % Computes the expected value of the maximum of K response times from
12 % independent M/M/1 queues. This serves as an upper bound to the K-way
13 % Fork-Join response time R_K^{F/J}(rho).
14 %
15 % R_K^max(rho) = H_K * R(rho) = H_K / (mu - lambda)
16 %
17 % where H_K is the K-th Harmonic number and R(rho) is the M/M/1 mean
18 % response time.
19 %
20 % This formula holds because for M/M/1 queues, the response time
21 % distribution is exponential with rate (mu - lambda), and the expected
22 % maximum of K i.i.d. exponential random variables with rate theta is
23 % H_K / theta.
24 %
25 % @par Syntax:
26 % @code
27 % Rmax = fj_rmax(K, lambda, mu)
28 % @endcode
29 %
30 % @par Parameters:
31 % <table>
32 % <tr><th>Name<th>Description
33 % <tr><td>K<td>Number of parallel servers (positive integer)
34 % <tr><td>lambda<td>Arrival rate
35 % <tr><td>mu<td>Service rate (mu > lambda for stability)
36 % </table>
37 %
38 % @par Returns:
39 % <table>
40 % <tr><th>Name<th>Description
41 % <tr><td>Rmax<td>Expected maximum response time R_K^max(rho) = H_K * R(rho)
42 % </table>
43 %
44 % @par Reference:
45 % A. Thomasian, "Analysis of Fork/Join and Related Queueing Systems",
46 % ACM Computing Surveys, Vol. 47, No. 2, Article 17, July 2014.
47 % Page 17:8, Eq. (1), and surrounding text.
48%}
49function Rmax = fj_rmax(K, lambda, mu)
50
51if K < 1
52 line_error(mfilename, 'K must be a positive integer. Got K=%d.', K);
53end
54
55% Compute harmonic number H_K
56H_K = fj_harmonic(K);
57
58% Compute M/M/1 mean response time
59R_rho = qsys_mm1(lambda, mu);
60
61% Maximum response time: R_K^max(rho) = H_K * R(rho)
62Rmax = H_K * R_rho;
63
64end