LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
sn_is_mm1k_loss.m
1%{ @file sn_is_mm1k_loss.m
2 % @brief Checks if the network is a single-station M/M/1/K queue with tail drop
3 %
4 % @author LINE Development Team
5%}
6
7function bool = sn_is_mm1k_loss(sn)
8% BOOL = SN_IS_MM1K_LOSS(SN)
9% Returns true for a single-class open Source-Queue-Sink system whose queue is
10% a single-server exponential M/M/1/K with tail drop (DropStrategy.DROP). This
11% is the exact regime shared by the closed-form loss scripts qsys_mm1k_loss
12% (probability-based, used by SolverNC) and qsys_mg1k_loss_mgs (moment-based,
13% used by SolverMVA), so both solvers gate their finite-capacity loss branch on
14% this predicate.
15bool = false;
16if sn.nclasses ~= 1 || sn.nclosedjobs ~= 0 || numel(sn.nodetype) ~= 3
17 return
18end
19if ~all(sort(sn.nodetype(:))' == sort([NodeType.Source,NodeType.Queue,NodeType.Sink]))
20 return
21end
22qist = sn.nodeToStation(sn.nodetype == NodeType.Queue);
23sist = sn.nodeToStation(sn.nodetype == NodeType.Source);
24if sn.nservers(qist) ~= 1
25 return
26end
27if isempty(sn.droprule) || sn.droprule(qist,1) ~= DropStrategy.DROP
28 return
29end
30if ~isfinite(sn.cap(qist)) || sn.cap(qist) <= 0
31 return
32end
33if abs(sn.scv(sist,1)-1) > 1e-6 || abs(sn.scv(qist,1)-1) > 1e-6
34 return
35end
36bool = true;
37end