2 % @brief Computes characteristic times
for hierarchical LRU cache levels
4 % @author LINE Development Team
8 % @brief Computes characteristic times
for hierarchical LRU cache
11 % This function computes the characteristic time
for each level of a
12 % hierarchical LRU cache
using fixed-point iteration.
16 % t = cache_t_hlru(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_hlru(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);
45% the probability of each item at each list
52 temp1(k) = temp1(k)*(1-exp(-gamma(k,s)*x(s)));
59 middtemp = middtemp*(1-exp(-gamma(k,s)*x(s)));
61 middtemp2 = middtemp2+middtemp;
63 temp2(k) = exp(-gamma(k,a)*x(a))*(1+middtemp2);
65 probh(k) = temp1(k)/(temp1(k)+temp2(k));
68F(a) = m(a)-sum(probh);