LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SolverQNS.m
1classdef SolverQNS < NetworkSolver
2 % Wrapper of LQNS's qnsolver
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 methods
8 function self = SolverQNS(model,varargin)
9 % SELF = SolverQNS(MODEL,VARARGIN)
10
11 self@NetworkSolver(model, mfilename);
12 self.setOptions(Solver.parseOptions(varargin, self.defaultOptions));
13 end
14
15 runtime = run(self)
16
17 function sn = getStruct(self)
18 % QN = GETSTRUCT()
19
20 % Get data structure summarizing the model
21 sn = self.model.getStruct(false);
22 end
23
24 [runtime, analyzer] = runAnalyzer(self, options);
25
26 function [allMethods] = listValidMethods(self)
27 % allMethods = LISTVALIDMETHODS()
28 % List valid methods for this solver
29 sn = self.model.getStruct();
30 allMethods = {'default','conway','rolia','zhou','suri','reiser','schmidt'};
31 end
32 end
33
34 methods (Static)
35
36 function featSupported = getFeatureSet()
37 % FEATSUPPORTED = GETFEATURESET()
38
39 featSupported = SolverFeatureSet;
40 featSupported.setTrue({'Sink',...
41 'Source',...
42 'Router',...
43 'ClassSwitch',...
44 'Delay',...
45 'DelayStation',...
46 'Queue',...
47 'Fork',...
48 'Join',...
49 'Forker',...
50 'Joiner',...
51 'Logger',...
52 'Coxian',...
53 'Cox2',...
54 'APH',...
55 'Erlang',...
56 'Exp',...
57 'HyperExp',...
58 'Det',...
59 'Gamma',...
60 'Lognormal',...
61 'MAP',...
62 'MMPP2',...
63 'Normal',...
64 'PH',...
65 'Pareto',...
66 'Weibull',...
67 'Replayer',...
68 'Trace',...
69 'Uniform',...
70 'StatelessClassSwitcher',...
71 'InfiniteServer',...
72 'SharedServer',...
73 'Buffer',...
74 'Dispatcher',...
75 'Server',...
76 'JobSink',...
77 'RandomSource',...
78 'ServiceTunnel',...
79 'LogTunnel',...
80 'Buffer', ...
81 'Linkage',...
82 'Enabling', ...
83 'Timing', ...
84 'Firing', ...
85 'Storage', ...
86 'Place', ...
87 'Transition', ...
88 'SchedStrategy_INF',...
89 'SchedStrategy_PS',...
90 'SchedStrategy_DPS',...
91 'SchedStrategy_FCFS',...
92 'SchedStrategy_GPS',...
93 'SchedStrategy_SIRO',...
94 'SchedStrategy_HOL',...
95 'SchedStrategy_LCFS',...
96 'SchedStrategy_LCFSPR',...
97 'SchedStrategy_SEPT',...
98 'SchedStrategy_LEPT',...
99 'SchedStrategy_SJF',...
100 'SchedStrategy_LJF',...
101 'RoutingStrategy_PROB',...
102 'RoutingStrategy_RAND',...
103 'RoutingStrategy_RROBIN',...
104 'RoutingStrategy_WRROBIN',...
105 'RoutingStrategy_KCHOICES',...
106 'SchedStrategy_EXT',...
107 'ClosedClass',...
108 'OpenClass'});
109 end
110
111 function [bool, featSupported] = supports(model)
112 % [BOOL, FEATSUPPORTED] = SUPPORTS(MODEL)
113
114 featUsed = model.getUsedLangFeatures();
115 featSupported = SolverQNS.getFeatureSet();
116 bool = SolverFeatureSet.supports(featSupported, featUsed);
117 end
118 end
119
120 methods (Static)
121 function bool = isAvailable()
122 %ISAVAILABLE Check if QNS is available on the system path
123 bool = true;
124 if ispc
125 [~, ret] = dos('qns -V');
126 if contains(ret, 'not recognized', 'IgnoreCase', true)
127 bool = false;
128 return;
129 end
130 else
131 [~, ret] = unix('qns -V');
132 if contains(ret, 'command not found', 'IgnoreCase', true)
133 bool = false;
134 return;
135 end
136 end
137 end
138
139 function options = defaultOptions()
140 % OPTIONS = DEFAULTOPTIONS()
141
142 options = SolverOptions('QNS');
143 options.timespan = [Inf,Inf];
144 end
145 end
146end