1%{ @file cache_ttl_lrum.m
2 % @brief Computes steady-state probabilities
for TTL-based LRU(m) cache
4 % @author LINE Development Team
8 % @brief Computes steady-state probabilities
for LRU(m) cache
11 % This function computes the steady-state probability distribution
for a
12 % TTL-based LRU(m) cache system.
16 % prob = cache_ttl_lrum(gamma, m)
21 % <tr><th>Name<th>Description
22 % <tr><td>gamma<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_lrum(gamma,m)
33gamma = gamma(1,:,2:end);
34gamma = reshape(gamma,size(gamma,2),size(gamma,3));
36t = cache_t_lrum(gamma,m); % the characteristic time of each list, a total of h lists
38probh = zeros(n,h); % steady state 1,...,h
39prob0 = zeros(n,1); % steady state 0
45 trans(k,j) = exp(gamma(k,j)*t(j))-1; %birth and death
47 denom(k) = sum(cumprod(trans(k,:)));
52 probh(k,l) = prod(trans(k,1:l))/(1+denom(k));
54 prob0(k) = 1-sum(probh(k,:));