LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
qbd_raprap1.m
1%{ @file qbd_raprap1.m
2 % @brief Solves a RAP/RAP/1 queue using QBD methods
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Analyzes RAP/RAP/1 queue using Quasi-Birth-Death process
9 %
10 % @details
11 % This function solves a RAP/RAP/1 queue (Rational Arrival Process) using
12 % QBD methods, computing throughput, queue length, utilization, and other
13 % performance metrics.
14 %
15 % @par Syntax:
16 % @code
17 % [XN, QN, UN, pqueue, R, eta, G, B, L, F] = qbd_raprap1(RAPa, RAPs)
18 % [XN, QN, UN, pqueue, R, eta, G, B, L, F] = qbd_raprap1(RAPa, RAPs, util)
19 % @endcode
20 %
21 % @par Parameters:
22 % <table>
23 % <tr><th>Name<th>Description
24 % <tr><td>RAPa<td>Arrival process (RAP)
25 % <tr><td>RAPs<td>Service process (RAP)
26 % <tr><td>util<td>(Optional) Target utilization to scale service rate
27 % </table>
28 %
29 % @par Returns:
30 % <table>
31 % <tr><th>Name<th>Description
32 % <tr><td>XN<td>System throughput
33 % <tr><td>QN<td>Mean queue length
34 % <tr><td>UN<td>Utilization
35 % <tr><td>pqueue<td>Queue length distribution
36 % <tr><td>R<td>Rate matrix R
37 % <tr><td>eta<td>Caudal characteristic
38 % <tr><td>G<td>Rate matrix G
39 % <tr><td>B<td>Backward transition block
40 % <tr><td>L<td>Local transition block
41 % <tr><td>F<td>Forward transition block
42 % </table>
43%}
44function [XN,QN,UN,pqueue,R,eta,G,B,L,F]=qbd_raprap1(RAPa,RAPs,util)
45% [XN,QN,UN,PQUEUE,R,ETA]=QBD_RAPRAP1(RAPA,RAPS,UTIL)
46
47%[XN,QN,UN,pqueue,R]=qbd_raprap1(RAPa,RAPs,util)
48na = length(RAPa{1});
49ns = length(RAPs{1});
50
51if nargin>=3 %exist('util','var')
52 RAPs = map_scale(RAPs,util/map_lambda(RAPa));
53end
54util = map_lambda(RAPa) / map_lambda(RAPs);
55
56[QN,pqueue,R,G,B,L,F] = Q_RAP_RAP_1(RAPa{1},RAPa{2},RAPs{1},RAPs{2});
57eta = max(abs(eigs(R,1)));
58
59if na == 1 && ns == 1
60 UN = 1 - pqueue(1);
61else
62 UN= 1 - sum(pqueue(1,:));
63end
64XN=map_lambda(RAPa);
65end