LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ctmc_signal_busy.m
1function UNb = ctmc_signal_busy(sn, ind, ist, schedIst, SIst, StateSpace, istSpaceShift, wset, probSysState)
2% UNB = CTMC_SIGNAL_BUSY(SN, IND, IST, SCHEDIST, SIST, STATESPACE,
3% ISTSPACESHIFT, WSET, PROBSYSSTATE)
4%
5% Exact per-class busy-server fraction at station IST, read off the enumerated
6% state space as a 1 x nclasses row.
7%
8% For a class that a G-network signal can annihilate, the departure-based
9% estimator T*E[S]/c is exact only under exponential service: a job destroyed
10% mid-service leaves behind busy time with no completion, so with phase-type
11% service T*E[S]/c under-counts (M/Er2/1 with lambda+=0.5, lambda-=0.4 gives
12% 0.34941 against a true 0.37696). The in-service occupancy below is exact for
13% any service process.
14%
15% PS-like disciplines share the servers among all resident jobs, so class k
16% gets the weighted share n_k w_k / sum_j n_j w_j of the busy servers; the
17% remaining disciplines expose the in-service indicator directly through
18% State.toMarginal.
19%
20% Copyright (c) 2012-2026, Imperial College London
21% All rights reserved.
22
23K = sn.nclasses;
24UNb = zeros(1,K);
25isPS = any(schedIst == [SchedStrategy.PS, SchedStrategy.DPS, SchedStrategy.GPS, SchedStrategy.LPS]);
26cols = (istSpaceShift(ist)+1):(istSpaceShift(ist)+size(sn.space{ist},2));
27for st = wset
28 if probSysState(st) == 0
29 continue
30 end
31 [ni,nir,sir] = State.toMarginal(sn, ind, StateSpace(st,cols));
32 if ni <= 0
33 continue
34 end
35 if isPS
36 w = sn.schedparam(ist,:);
37 wtot = nir(:)'*w(:);
38 if wtot > 0
39 for k=1:K
40 UNb(k) = UNb(k) + probSysState(st)*(nir(k)*w(k)/wtot)*min(sum(ni),SIst)/SIst;
41 end
42 end
43 else
44 for k=1:K
45 UNb(k) = UNb(k) + probSysState(st)*sir(k)/SIst;
46 end
47 end
48end
49end
Definition Station.m:245