LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SolverSSA.m
1classdef SolverSSA < NetworkSolver
2 % Stochastic Simulation Analysis solver
3 %
4 % Implements discrete-event stochastic simulation for queueing network analysis.
5 %
6 % Copyright (c) 2012-2026, Imperial College London
7 % All rights reserved.
8 methods
9 function self = SolverSSA(model,varargin)
10 % SOLVERSSA Create an SSA solver instance
11 %
12 % @brief Creates a Stochastic Simulation Analysis solver
13 % @param model Network model to be analyzed via simulation
14 % @param varargin Optional parameters (method, samples, seed, etc.)
15 % @return self SolverSSA instance configured for simulation
16
17 self@NetworkSolver(model, mfilename);
18 self.setOptions(Solver.parseOptions(varargin, self.defaultOptions));
19 self.setLang();
20 end
21
22 function sn = getStruct(self)
23 % QN = GETSTRUCT()
24
25 % Get data structure summarizing the model
26 sn = self.model.getStruct(true);
27 end
28
29 [runtime, tranSysState, tranSync] = run(self, options);
30 Prob = getProb(self, node, state);
31 ProbAggr = getProbAggr(self, node, state);
32 ProbSys = getProbSys(self);
33 ProbSysAggr = getProbSysAggr(self);
34 tranNodeState = sample(self, node, numSamples, markActivePassive);
35 tranNodeStateAggr = sampleAggr(self, node, numSamples, markActivePassive);
36 tranSysStateAggr = sampleSysAggr(self, numSamples, markActivePassive);
37 tranSysState = sampleSys(self, numSamples, markActivePassive);
38
39 function [allMethods] = listValidMethods(self)
40 % allMethods = LISTVALIDMETHODS()
41 % List valid methods for this solver
42
43 %sn = self.model.getStruct();
44 allMethods = {'default','ssa','serial', 'para','parallel','nrm'};
45 end
46 end
47
48 methods (Static)
49
50 function featSupported = getFeatureSet()
51 % FEATSUPPORTED = GETFEATURESET()
52
53 featSupported = SolverFeatureSet;
54 featSupported.setTrue({'Sink','Source','Router',...
55 'ClassSwitch','Delay','DelayStation','Queue',...
56 'Cache','CacheClassSwitcher',...
57 'MAP','MMPP2', 'APH', 'PH',...
58 'Coxian','Erlang','Exp','HyperExp',...
59 'Det','Gamma','Lognormal','Pareto','Uniform','Weibull',...
60 'StatelessClassSwitcher','InfiniteServer',...
61 'SharedServer','Buffer','Dispatcher',...
62 'Server','JobSink','RandomSource','ServiceTunnel',...
63 'SchedStrategy_INF','SchedStrategy_PS',...
64 'SchedStrategy_DPS','SchedStrategy_FCFS',...
65 'SchedStrategy_GPS','SchedStrategy_LPS','SchedStrategy_SIRO',...
66 'SchedStrategy_HOL','SchedStrategy_LCFS',...
67 'SchedStrategy_SEPT','SchedStrategy_LEPT',...
68 'SchedStrategy_LCFSPR',...
69 'SchedStrategy_PSPRIO','SchedStrategy_DPSPRIO','SchedStrategy_GPSPRIO',...
70 'RoutingStrategy_RROBIN',...
71 'RoutingStrategy_PROB','RoutingStrategy_RAND',...
72 'ReplacementStrategy_RR', 'ReplacementStrategy_FIFO','ReplacementStrategy_SFIFO','ReplacementStrategy_LRU',...
73 'SchedStrategy_EXT','ClosedClass','SelfLoopingClass','OpenClass',...
74 'Place', 'Transition', 'Linkage', 'Enabling', 'Timing', 'Firing', 'Storage'});
75 % 'Fork','Join','Forker','Joiner',...
76 end
77
78 function [bool, featSupported] = supports(model)
79 % [BOOL, FEATSUPPORTED] = SUPPORTS(MODEL)
80
81 featUsed = model.getUsedLangFeatures();
82 featSupported = SolverSSA.getFeatureSet();
83 bool = SolverFeatureSet.supports(featSupported, featUsed);
84 end
85
86 function options = defaultOptions()
87 % OPTIONS = DEFAULTOPTIONS()
88
89 options = SolverOptions('SSA');
90 end
91
92 function libs = getLibrariesUsed(sn, options)
93 % GETLIBRARIESUSED Get list of external libraries used by SSA solver
94 % SSA uses internal simulation, no external libraries needed
95 libs = {};
96 end
97
98 end
99end