1classdef SolverFLD < NetworkSolver
2 % FLD - Fluid/Mean-Field Approximation solver
for large-scale network analysis
4 % Implements fluid approximation by replacing discrete populations with continuous levels.
6 % Copyright (c) 2012-2026, Imperial College London
10 function self = SolverFLD(model,varargin)
11 % SOLVERFLUID Create a Fluid solver instance
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
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).
22 if ~isempty(varargin) && isa(varargin{1},
'NetworkSolver')
23 initSolver = varargin{1};
26 self@NetworkSolver(model, mfilename);
27 self.setOptions(Solver.parseOptions(varargin, self.defaultOptions));
29 if ~isempty(initSolver)
30 self.initFromSolver(initSolver);
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);
44 function sn = getStruct(self)
47 % Get data structure summarizing
the model
48 sn = self.model.getStruct(
true);
51 [QNt,UNt,TNt] = getTranAvg(self,Qt,Ut,Tt);
53 %
export the mean-field ODE system to LaTeX (scalar or matrix notation)
54 [tex, sys] = exportODEs(self, filename, notation);
56 % solve method
is supplied by Solver superclass
57 runtime = runAnalyzer(self, options);
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'};
64 function featSupported = getMethodFeatureSet(self, method) %#ok<INUSD>
65 % All FLD methods share
the solver-level feature envelope.
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
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')
80 featSupported = SolverFLD.getFeatureSet();
88 function featSupported = getFeatureSet()
89 % FEATSUPPORTED = GETFEATURESET()
91 featSupported = SolverFeatureSet;
92 featSupported.setTrue({
93 'ClassSwitch',
'Delay',
'DelayStation',
'Queue',...
94 'Cache',
'CacheClassSwitcher',...
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
112 function [bool, featSupported] = supports(model)
113 % [BOOL, FEATSUPPORTED] = SUPPORTS(MODEL)
115 featUsed = model.getUsedLangFeatures();
116 featSupported = SolverFLD.getFeatureSet();
117 bool = SolverFeatureSet.supports(featSupported, featUsed);
120 function options = defaultOptions()
121 % OPTIONS = DEFAULTOPTIONS()
122 options = SolverOptions('Fluid');
125 function libs = getLibrariesUsed(sn, options)
126 % GETLIBRARIESUSED Get list of external libraries used by FLD solver
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)';