LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getAvgOrbit.m
1function ON = getAvgOrbit(self)
2% ON = GETAVGORBIT()
3%
4% Mean number of jobs waiting in the ORBIT of each retrial station, as an
5% (nstations x nclasses) matrix. Stations that are not retrial queues report 0.
6%
7% A retrial station has no waiting room: a job that finds every server busy
8% joins the orbit instead of queueing, so its station population splits into
9% the jobs currently in service and the jobs orbiting. getAvgQLen reports the
10% whole station population, which is why the orbit had to be recovered by hand
11% as QLen - Util. This method reports it directly.
12%
13% The in-service population is obtained from the station throughput by Little's
14% law applied to the servers alone, E[in service] = X * E[S], which holds for
15% any service distribution and any number of servers, so the orbit length is
16% exact whenever QLen and Tput are.
17%
18% See also Queue.setOrbit, NetworkSolver.getAvgTable
19%
20% Copyright (c) 2012-2026, Imperial College London
21% All rights reserved.
22
23[QN,~,~,TN] = self.getAvg();
24sn = self.model.getStruct();
25ON = zeros(size(QN));
26
27if ~isfield(sn,'retrialProc') || isempty(sn.retrialProc)
28 return
29end
30
31for ist = 1:size(ON,1)
32 for r = 1:size(ON,2)
33 if size(sn.retrialProc,1) < ist || size(sn.retrialProc,2) < r ...
34 || isempty(sn.retrialProc{ist,r})
35 continue % not a retrial station for this class: no orbit
36 end
37 rate_ir = sn.rates(ist,r);
38 if ~isfinite(rate_ir) || rate_ir <= 0
39 continue
40 end
41 inService = TN(ist,r) / rate_ir; % Little's law on the servers
42 ON(ist,r) = max(0, QN(ist,r) - inService);
43 end
44end
45end