LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mam_transient_mapmap1.m
1function mam_transient_mapmap1()
2% MAM_TRANSIENT_MAPMAP1 Transient analysis of a MAP/MAP/1 queue via the
3% Laplace-domain transient QBD solver in MAM. Computes the time-dependent
4% mean queue length, utilization, and throughput of a single-server queue with
5% correlated (MAP) arrivals and correlated (MAP) service, starting empty.
6%
7% The Laplace transient QBD method is auto-selected by getTranAvg because the
8% arrival and service processes are correlated MAPs (the libQBD/expm fast path
9% only handles Poisson arrivals).
10
11% Correlated arrival MAP (3 phases) and service MAP (2 phases), service scaled
12% to a stable utilization rho = 0.6.
13D0 = [-8, 1, 3; 0, -6, 4; 2, 0, -3];
14D1 = [3, 1, 0; 0, 2, 0; 0, 0, 1];
15S0 = [-3, 1; 6, -7];
16S1 = [0, 2; 1, 0];
17svc = map_scale({S0, S1}, 0.6 / map_lambda({D0, D1}));
18
19model = Network('MAP/MAP/1 transient');
20source = Source(model, 'Source');
21queue = Queue(model, 'Queue', SchedStrategy.FCFS);
22sink = Sink(model, 'Sink');
23oclass = OpenClass(model, 'Class1');
24source.setArrival(oclass, MAP({D0, D1}));
25queue.setService(oclass, MAP(svc{1}, svc{2}));
26model.link(Network.serialRouting(source, queue, sink));
27
28solver = MAM(model, 'timespan', [0, 40]);
29[QNt, UNt, TNt] = solver.getTranAvg();
30
31t = QNt{2, 1}.t;
32fprintf('MAP/MAP/1 transient (rho=0.6), start empty:\n');
33fprintf(' t=%5.1f E[N]=%.5f U=%.5f Tput=%.5f\n', ...
34 t(end), QNt{2,1}.metric(end), UNt{2,1}.metric(end), TNt{2,1}.metric(end));
35fprintf(' steady-state E[N] approaches 1.5458 as t -> inf.\n');
36end
Definition Station.m:245