1function updateRoutingProbabilities(self, it)
2for u = 1:length(self.unique_route_prob_updmap)
3 if mod(it,0) % do elevator
4 idx = self.unique_route_prob_updmap(u);
6 idx = self.unique_route_prob_updmap(length(self.unique_route_prob_updmap)-u+1);
9 P = self.ensemble{self.idxhash(idx)}.getLinkedRoutingMatrix;
10 for r = find(self.route_prob_updmap(:,1) == idx)
'
11 host = self.route_prob_updmap(r,1);
12 tidx_caller = self.route_prob_updmap(r,2);
13 eidx = self.route_prob_updmap(r,3);
14 nodefrom = self.route_prob_updmap(r,4);
15 nodeto = self.route_prob_updmap(r,5);
16 classidxfrom = self.route_prob_updmap(r,6);
17 classidxto = self.route_prob_updmap(r,7);
18 if ~isempty(self.ensemble{self.idxhash(idx)}.items) % if idx is a cache node
19 Xtot = sum(self.results{end,self.idxhash(host)}.TN(self.ensemble{self.idxhash(host)}.attribute.serverIdx,:));
21 hm_tput = sum(self.results{end,self.idxhash(host)}.TN(self.ensemble{self.idxhash(host)}.attribute.serverIdx,classidxto));
22 P{classidxfrom,classidxto}(nodefrom, nodeto) = hm_tput / Xtot;
25 else % if idx is not a cache
26 Xtot = sum(self.results{end,self.idxhash(tidx_caller)}.TN(self.ensemble{self.idxhash(tidx_caller)}.attribute.serverIdx,:));
28 eidxclass = self.ensemble{self.idxhash(tidx_caller)}.attribute.calls(find(self.ensemble{self.idxhash(tidx_caller)}.attribute.calls(:,4) == eidx),1); %#ok<FNDSB>
29 entry_tput = sum(self.results{end,self.idxhash(tidx_caller)}.TN(self.ensemble{self.idxhash(tidx_caller)}.attribute.serverIdx,eidxclass));
30 P{classidxfrom,classidxto}(nodefrom, nodeto) = entry_tput / Xtot;
36 self.ensemble{self.idxhash(idx)}.relink(P);