1%{ @file cache_gamma_lp.m
2 % @brief Computes gamma parameters
for cache models
using linear programming
4 % @author LINE Development Team
8 % @brief Computes gamma parameters
for cache models
11 % This function computes item popularity probabilities at each cache level
12 %
using a linear programming approach based on arrival rates and routing
17 % [gamma, u, n, h] = cache_gamma_lp(lambda, R)
22 % <tr><th>Name<th>Description
23 % <tr><td>lambda<td>Arrival rates per user per item per list
24 % <tr><td>R<td>Routing probability structure
29 % <tr><th>Name<th>Description
30 % <tr><td>gamma<td>Item popularity probabilities at each level
31 % <tr><td>u<td>Number of users
32 % <tr><td>n<td>Number of items
33 % <tr><td>h<td>Number of cache levels
36function [gamma,u,n,h]=cache_gamma_lp(lambda,R)
37u=size(lambda,1); % number of users
38n=size(lambda,2); % number of items
39h=size(lambda,3)-1; % number of lists
42for i = 1:n %
for all items
43 for j = 1:h %
for all levels
53 pr_j = par(Rvi, pr_j);
55 if isempty(Pij) % debug
60 for li = 2:length(Pij) %
for all levels up to the current one
64 for v = 1:u %
for all streams
66 y=y + lambda(v, i, t) * R{v,i}(t, l);
69 gamma(i,j)=gamma(i,j)*y;
77function parent = par(R, j)
78% finds the parent of j according to the access probabilities in R
79 parent = find(R(1:(j-1),j));
81 line_error(mfilename,
'A cache has a list with more than one parent, but the structure must be a tree.');