2 % @brief Computes characteristic times
for LRU(m) cache levels
4 % @author LINE Development Team
8 % @brief Computes characteristic times
for LRU(m) cache
11 % This function computes the characteristic time
for each level of an
12 % LRU(m) cache
using fixed-point iteration.
16 % t = cache_t_lrum(gamma, m)
21 % <tr><th>Name<th>Description
22 % <tr><td>gamma<td>Item popularity probabilities or arrival rates
23 % <tr><td>m<td>Cache capacity vector
28 % <tr><th>Name<th>Description
29 % <tr><td>t<td>Characteristic time
for each cache level
32function t = cache_t_lrum(gamma,m)
33% fsolve solution to to T1,T2,...,Th, i.e., the characteristic time of
38options = optimoptions(
'fsolve',
'MaxIter',1e5,
'MaxFunEvals',1e6,
'Display',
'off');
39t = fsolve(fun,x,options);
44% the probability of each item at each list
49stablecapa = zeros(1,h);
52 trans(k,j) = exp(gamma(k,j)*x(j))-1; %birth and death
53 logtrans(k,j) = log(trans(k,j));
55 denom(k) = sum(exp(cumsum(logtrans(k,:))));
59 capa(l) = capa(l) + prod(trans(k,1:l))/(1+denom(k));
60 stablecapa(l) = stablecapa(l) + exp(sum(log(trans(k,1:l)))-log(1+denom(k)));
62 F(l) = m(l)-stablecapa(l);