1function [QN, UN, RN, TN, CN, XN, t, QNt, UNt, TNt, xvec_iter, hitprob, missprob, runtime, it] = solver_fld_cacheqn_analyzer(sn, options)
2% SOLVER_FLD_CACHEQN_ANALYZER Fluid solver
for integrated caching-queueing networks
4% Delegates
the decomposition-aggregation alternation between
the isolated
5% caches and
the fluid ODE solution of
the surrounding queueing network to
6% da_cacheqn, until
the cache arrival rates converge. RANDOM(m) caches use
7%
the refined mean field miss algorithm (cache_miss_rmf, 1/N-accurate);
8% other replacement strategies use
the FPI approximation (cache_miss_fpi).
10% Copyright (c) 2012-2026, Imperial College London
16[res, hitprob, missprob, it, sn] = da_cacheqn(sn, @miss_isolated, @netsolve, options);
17QN = res.QN; UN = res.UN; RN = res.RN; TN = res.TN; XN = res.XN;
18t = res.t; QNt = res.QNt; UNt = res.UNt; TNt = res.TNt; xvec_iter = res.xvec_iter;
24 CN(k) = sn.njobs(k) ./ XN(k);
28% xvec_iter
is already a cell array from solver_fluid_matrix
31 function missrate = miss_isolated(gamma, m, lambda_cache, ch)
32 if ch.replacestrat == ReplacementStrategy.RR
33 % RANDOM(m) replacement: refined mean field (1/N-accurate)
34 [~, missrate] = cache_miss_rmf(gamma, m, lambda_cache);
36 [~, missrate] = cache_miss_fpi(gamma, m, lambda_cache);
40 function res = netsolve(snit)
41 % Solve
the queueing network
using the fluid matrix method
43 fluid_options = options;
44 fluid_options.method =
'matrix';
45 fluid_options.init_sol = solver_fluid_initsol(snit, fluid_options);
46 [res.QN, res.UN, res.RN, res.TN, res.xvec_iter, res.QNt, res.UNt, res.TNt, ~, res.t] = solver_fluid_matrix(snit, fluid_options);
48 % Compute system throughputs
51 if snit.refstat(k) > 0
52 res.XN(k) = res.TN(snit.refstat(k), k);