LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
fj_respt_2way.m
1%{ @file fj_respt_2way.m
2 % @brief Exact two-way Fork-Join response time R_2^{F/J}(rho)
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Exact two-way Fork-Join response time R_2^{F/J}(rho)
9 %
10 % @details
11 % Computes the exact mean response time for a 2-way (K=2) Fork-Join
12 % queueing system with Poisson arrivals and exponential service times.
13 % This is derived from the analysis in Flatto and Hahn [1984].
14 %
15 % R_2^{F/J}(rho) = (H_2 - rho/8) * R(rho) = (12 - rho)/8 * R(rho)
16 %
17 % where H_2 = 1.5 and R(rho) = (mu - lambda)^{-1} is the M/M/1 mean
18 % response time.
19 %
20 % Note that R_2^{F/J}(rho) < R_2^max(rho), with the difference being
21 % rho/8 * R(rho).
22 %
23 % @par Syntax:
24 % @code
25 % R = fj_respt_2way(lambda, mu)
26 % @endcode
27 %
28 % @par Parameters:
29 % <table>
30 % <tr><th>Name<th>Description
31 % <tr><td>lambda<td>Arrival rate
32 % <tr><td>mu<td>Service rate (mu > lambda for stability)
33 % </table>
34 %
35 % @par Returns:
36 % <table>
37 % <tr><th>Name<th>Description
38 % <tr><td>R<td>Exact 2-way F/J response time R_2^{F/J}(rho)
39 % </table>
40 %
41 % @par Reference:
42 % A. Thomasian, "Analysis of Fork/Join and Related Queueing Systems",
43 % ACM Computing Surveys, Vol. 47, No. 2, Article 17, July 2014.
44 % Eq. (6) on page 17:10.
45 %
46 % Original derivation: L. Flatto and S. Hahn, "Two Parallel Queues Created
47 % by Arrivals with Two Demands I", SIAM J. Appl. Math., 44(5), 1984.
48%}
49function R = fj_respt_2way(lambda, mu)
50
51% Compute utilization
52rho = lambda / mu;
53
54if rho >= 1
55 line_error(mfilename, 'System is unstable: rho = lambda/mu = %.4f >= 1. Require lambda < mu.', rho);
56end
57
58% Compute M/M/1 mean response time
59R_rho = qsys_mm1(lambda, mu);
60
61% Exact 2-way F/J response time: R_2^{F/J}(rho) = (H_2 - rho/8) * R(rho)
62% H_2 = 1 + 1/2 = 1.5
63% (H_2 - rho/8) = (1.5 - rho/8) = (12 - rho)/8
64R = (12 - rho) / 8 * R_rho;
65
66end