1%{ @file sn_print_routing_matrix.m
2 % @brief Prints the routing matrix of the network
4 % @author LINE Development Team
8 % @brief Prints the routing matrix of the network
11 % This function displays the routing probabilities between
nodes and
classes
12 % in a human-readable format.
16 % sn_print_routing_matrix(sn)
17 % sn_print_routing_matrix(sn, onlyclass)
22 % <tr><th>Name<th>Description
23 % <tr><td>sn<td>Network structure
24 % <tr><td>onlyclass<td>(Optional) Filter printing
for a specific
class
27function sn_print_routing_matrix(sn, onlyclass)
29node_names = sn.nodenames;
30classnames = sn.classnames;
33nclasses = sn.nclasses;
38 if rtnodes((i-1)*nclasses+r,(j-1)*nclasses+s)>0
39 if sn.nodetype(i) == NodeType.Cache
40 pr =
'state-dependent';
41 elseif sn.nodetype(i) == NodeType.Sink
44 if sn.routing(i,r) == RoutingStrategy.DISABLED
48 pr = num2str(rtnodes((i-1)*nclasses+r,(j-1)*nclasses+s),
'%f');
52 line_printf(
'\n%s [%s] => %s [%s] : Pr=%s',node_names{i}, classnames{r}, node_names{j}, classnames{s}, pr);
54 if strcmpi(classnames{r},onlyclass.name) || strcmpi(classnames{s},onlyclass.name)
55 line_printf(
'\n%s [%s] => %s [%s] : Pr=%s',node_names{i}, classnames{r}, node_names{j}, classnames{s}, pr);