LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
da_cache_isolate.m
1function [gamma, lambda_cache, Rcost] = da_cache_isolate(ch, lambda)
2% [GAMMA, LAMBDA_CACHE, RCOST] = DA_CACHE_ISOLATE(CH, LAMBDA)
3%
4% Isolated-cache input construction for DA methods: builds the per-class,
5% per-item, per-list arrival rates LAMBDA_CACHE and the access cost
6% matrices RCOST from the cache node parameters CH (sn.nodeparam of the
7% cache node) and the current class arrival rates LAMBDA (1 x nclasses),
8% then computes the access factors GAMMA via cache_gamma_lp.
9%
10% Copyright (c) 2012-2026, Imperial College London
11% All rights reserved.
12
13m = ch.itemcap;
14n = ch.nitems;
15h = length(m);
16u = length(lambda);
17lambda_cache = zeros(u, n, h);
18
19for v = 1:u
20 for k = 1:n
21 for l = 1:(h+1)
22 if ~isnan(ch.pread{v})
23 lambda_cache(v, k, l) = lambda(v) * ch.pread{v}(k);
24 end
25 end
26 end
27end
28
29Rcost = ch.accost;
30if isempty(Rcost)
31 % Default linear cache routing: items flow from list l to list l+1
32 Rcost = cell(u, n);
33 for v = 1:u
34 for k = 1:n
35 Rmat = diag(ones(1, h), 1);
36 Rmat(h+1, h+1) = 1;
37 Rcost{v, k} = Rmat;
38 end
39 end
40end
41gamma = cache_gamma_lp(lambda_cache, Rcost);
42end
Definition Station.m:245