1function [ItemAvgTable] = getAvgItemTable(self)
2% [ITEMAVGTABLE] = GETAVGITEMTABLE(SELF)
3% Return a table of item-level cache occupancy, one row per Cache node, item
4% and cache list (level). Columns:
7% Item item index (1..nitems)
8% List cache list (level) index (1..nlists)
9% ListCap capacity of the list
10% Prob steady-state probability that the item resides in that list
12% The per-item, per-list occupancy
is reported only where the solver computes
13% a genuine per-item distribution (exact NC/MVA cache kernels and the
14% delayed-hit retrieval kernels); other solvers
return an empty table.
16% Copyright (c) 2012-2026, Imperial College London
19if GlobalConstants.DummyMode
20 ItemAvgTable = IndexedTable(Table());
24% Ensure the model has been solved so the cache item probabilities are filled.
27sn = self.model.getStruct;
28caches = find(sn.nodetype == NodeType.Cache)
';
30 ItemAvgTable = IndexedTable(Table());
35[Itemv, Listv, ListCapv, Probv] = deal([]);
38 np = sn.nodeparam{ind};
40 if isfield(np,'itemcap
'), itemcap = np.itemcap(:).'; end
42 node = self.model.nodes{ind};
43 itemprob = node.getItemProb(); % [nitems x (h+1)], col 1 = miss
44 if isempty(itemprob) || h == 0
47 n = size(itemprob, 1);
50 if (l+1) <= size(itemprob, 2)
55 Node{end+1,1} = sn.nodenames{ind}; %#ok<AGROW>
56 Itemv(end+1,1) = i; %#ok<AGROW>
57 Listv(end+1,1) = l; %#ok<AGROW>
58 ListCapv(end+1,1) = itemcap(l); %#ok<AGROW>
59 Probv(end+1,1) = p; %#ok<AGROW>
69ItemAvgTable = Table(Node, Item, List, ListCap, Prob);
70ItemAvgTable = IndexedTable(ItemAvgTable);