LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
qbd_rg.m
1%{ @file qbd_rg.m
2 % @brief Computes QBD matrices R and G for MAP/MAP/1 queue
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Computes QBD transition matrices for MAP/MAP/1 queue
9 %
10 % @details
11 % This function computes the QBD (Quasi-Birth-Death) matrices R and G
12 % along with transition blocks B, L, F for a MAP/MAP/1 queue.
13 %
14 % @par Syntax:
15 % @code
16 % [R, G, B, L, F, U] = qbd_rg(MAPa, MAPs)
17 % [R, G, B, L, F, U] = qbd_rg(MAPa, MAPs, util)
18 % @endcode
19 %
20 % @par Parameters:
21 % <table>
22 % <tr><th>Name<th>Description
23 % <tr><td>MAPa<td>Markovian Arrival Process for arrivals
24 % <tr><td>MAPs<td>Markovian Arrival Process for service
25 % <tr><td>util<td>(Optional) Target utilization for scaling service rate
26 % </table>
27 %
28 % @par Returns:
29 % <table>
30 % <tr><th>Name<th>Description
31 % <tr><td>R<td>Rate matrix R (forward transitions)
32 % <tr><td>G<td>Rate matrix G (backward transitions)
33 % <tr><td>B<td>Backward transition matrix
34 % <tr><td>L<td>Local transition matrix
35 % <tr><td>F<td>Forward transition matrix
36 % <tr><td>U<td>Utilization
37 % </table>
38%}
39function [R,G,B,L,F,U]=qbd_rg(MAPa,MAPs,util)
40% [XN,QN,UN,PQUEUE,R,ETA]=QBD_MAPMAP1(MAPA,MAPS,UTIL)
41
42%[XN,QN,UN,pqueue,R]=qbd_mapmap1(MAPa,MAPs,util)
43na = length(MAPa{1});
44ns = length(MAPs{1});
45
46if nargin>=3%exist('util','var')
47 MAPs = map_scale(MAPs,util/map_lambda(MAPa));
48end
49util = map_lambda(MAPa) / map_lambda(MAPs);
50F = kron(MAPa{2},eye(ns));
51L = krons(MAPa{1},MAPs{1});
52B = kron(eye(na),MAPs{2});
53A0bar = kron(MAPa{1},eye(ns));
54
55[G,R,U] = QBD_CR(B,L,F);
56end