LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SolverFLD.m
1classdef SolverFLD < NetworkSolver
2 % FLD - Fluid/Mean-Field Approximation solver for large-scale network analysis
3 %
4 % Implements fluid approximation by replacing discrete populations with continuous levels.
5 %
6 % Copyright (c) 2012-2026, Imperial College London
7 % All rights reserved.
8
9 methods
10 function self = SolverFLD(model,varargin)
11 % SOLVERFLUID Create a Fluid solver instance
12 %
13 % @brief Creates a Fluid solver for continuous approximation analysis
14 % @param model Network model to be analyzed via fluid approximation
15 % @param varargin Optional parameters (method, tolerances, etc.)
16 % @return self SolverFLD instance configured for fluid analysis
17
18 % An auxiliary solver passed as first optional argument requests a
19 % warm start: its steady-state solution decides the initial state
20 % of the ODE integration (see NetworkSolver.initFromSolver).
21 initSolver = [];
22 if ~isempty(varargin) && isa(varargin{1}, 'NetworkSolver')
23 initSolver = varargin{1};
24 varargin(1) = [];
25 end
26 self@NetworkSolver(model, mfilename);
27 self.setOptions(Solver.parseOptions(varargin, self.defaultOptions));
28 self.setLang();
29 if ~isempty(initSolver)
30 self.initFromSolver(initSolver);
31 end
32 end
33 end
34
35 methods
36 RD = getTranCdfPassT(self, R);
37 [Pnir,logPnir] = getProbAggr(self, ist);
38 RD = getCdfRespT(self, R);
39 RD = getCdfPassT(self, R);
40 RD = getCdfPT(self, R);
41 [AoI, PAoI, aoiTable] = getAvgAoI(self);
42 [AoI_cdf, PAoI_cdf] = getCdfAoI(self, t_values);
43
44 function sn = getStruct(self)
45 % QN = GETSTRUCT()
46
47 % Get data structure summarizing the model
48 sn = self.model.getStruct(true);
49 end
50
51 [QNt,UNt,TNt] = getTranAvg(self,Qt,Ut,Tt);
52
53 % export the mean-field ODE system to LaTeX (scalar or matrix notation)
54 [tex, sys] = exportODEs(self, filename, notation);
55
56 % solve method is supplied by Solver superclass
57 runtime = runAnalyzer(self, options);
58
59 function [allMethods] = listValidMethods(self)
60 % allMethods = LISTVALIDMETHODS()
61 % List valid methods for this solver
62 allMethods = {'default','softmin','pnorm','statedep','closing','matrix','diffusion','mfq','rmf','tbi'};
63 end
64 function featSupported = getMethodFeatureSet(self, method) %#ok<INUSD>
65 % All FLD methods share the solver-level feature envelope.
66 %
67 % Defining this is what lets NetworkSolver.supportsModelMethod name
68 % the offending features: with no method feature set it falls back
69 % to the coarse supports(model), which returns an empty reason, so
70 % the gate could only report "features not supported" without
71 % saying which ones.
72 %
73 % A non-Network model (e.g. a LayeredNetwork) has no
74 % getUsedLangFeatures, so it keeps the coarse path and any
75 % structural checks or redirects that operate on such models.
76 if ~isa(self.model, 'Network')
77 featSupported = [];
78 return;
79 end
80 featSupported = SolverFLD.getFeatureSet();
81 end
82
83
84 end
85
86 methods (Static)
87
88 function featSupported = getFeatureSet()
89 % FEATSUPPORTED = GETFEATURESET()
90
91 featSupported = SolverFeatureSet;
92 featSupported.setTrue({
93 'ClassSwitch','Delay','DelayStation','Queue',...
94 'Cache','CacheClassSwitcher',...
95 'CacheRetrieval', ...
96 'Cox2','Coxian','Erlang','Exp','HyperExp',...
97 'APH', 'Det','MAP','MMPP2','NHPP',...
98 'StatelessClassSwitcher','InfiniteServer','SharedServer','Buffer','Dispatcher',...
99 'Server','ServiceTunnel',...
100 'SchedStrategy_INF','SchedStrategy_PS',...
101 'SchedStrategy_DPS','SchedStrategy_FCFS','SchedStrategy_HOL',...
102 'SchedStrategy_SIRO','SchedStrategy_LCFS','SchedStrategy_LCFSPR',...
103 'ReplacementStrategy_RR','ReplacementStrategy_FIFO',...
104 'ReplacementStrategy_LRU','ReplacementStrategy_SFIFO',...
105 'ReplacementStrategy_HLRU',...
106 'RoutingStrategy_PROB','RoutingStrategy_RAND',...
107 'ClosedClass','SelfLoopingClass','Replayer', ...
108 'RandomSource','Sink','Source','OpenClass','JobSink'});
109 %SolverFLD has very weak performance on open models
110 end
111
112 function [bool, featSupported] = supports(model)
113 % [BOOL, FEATSUPPORTED] = SUPPORTS(MODEL)
114
115 featUsed = model.getUsedLangFeatures();
116 featSupported = SolverFLD.getFeatureSet();
117 bool = SolverFeatureSet.supports(featSupported, featUsed);
118 end
119
120 function options = defaultOptions()
121 % OPTIONS = DEFAULTOPTIONS()
122 options = SolverOptions('Fluid');
123 end
124
125 function libs = getLibrariesUsed(sn, options)
126 % GETLIBRARIESUSED Get list of external libraries used by FLD solver
127 libs = {};
128 if nargin >= 2 && isfield(struct(options), 'method')
129 if any(strcmp(options.method, {'rmf', 'fluid.rmf'}))
130 libs{end+1} = 'rmf_tool (MIT License)';
131 end
132 end
133 end
134 end
135end
Definition Station.m:245