1%{ @file cache_ttl_hlru.m
2 % @brief Computes steady-state probabilities
for TTL-based hierarchical LRU cache
4 % @author LINE Development Team
8 % @brief Computes steady-state probabilities
for hierarchical LRU cache
11 % This function computes the steady-state probability distribution
for a
12 % TTL-based hierarchical LRU cache system.
16 % prob = cache_ttl_hlru(lambda, m)
21 % <tr><th>Name<th>Description
22 % <tr><td>lambda<td>Arrival rates per item per list
23 % <tr><td>m<td>Cache capacity vector
28 % <tr><th>Name<th>Description
29 % <tr><td>prob<td>Steady-state probability distribution
32function prob=cache_ttl_hlru(lambda,m)
33lambda = lambda(1,:,2:end);
34lambda = reshape(lambda,size(lambda,2),size(lambda,3));
35[n,h]=size(lambda); % n totalitems, h lists
37t = cache_t_hlru(lambda,m);
38probh = zeros(n,1); % steady state at list h
39prob0 = zeros(n,1); % steady state at list 0
45 temp1(k) = temp1(k)*(1-exp(-lambda(k,s)*t(s)));
52 middtemp = middtemp*(1-exp(-lambda(k,s)*t(s)));
54 middtemp2 = middtemp2+middtemp;
56 temp2(k) = exp(-lambda(k,h)*t(h))*(1+middtemp2);
58 probh(k) = temp1(k)/(temp1(k)+temp2(k));
59 prob0(k) = 1/(temp1(k)+temp2(k))/exp(lambda(k,h)*t(h));