1%{ @file sn_set_routing.m
2 % @brief Sets the routing matrix
4 % @author LINE Development Team
8 % @brief Sets the routing matrix
for stateful
nodes
11 % Replaces the rt matrix in NetworkStruct.
15 % sn = sn_set_routing(sn, rt)
16 % sn = sn_set_routing(sn, rt, autoRefresh)
21 % <tr><th>Name<th>Description
22 % <tr><td>sn<td>Network structure
23 % <tr><td>rt<td>New routing matrix (nstateful*nclasses x nstateful*nclasses)
24 % <tr><td>autoRefresh<td>If
true, refresh visit ratios (
default false)
29 % <tr><th>Name<th>Description
30 % <tr><td>sn<td>Modified network structure
33function sn = sn_set_routing(sn, rt, autoRefresh)
35if nargin < 3 || isempty(autoRefresh)
42% Auto-refresh visit ratios if requested
44 sn = sn_refresh_visits(sn, sn.chains, sn.rt, sn.rtnodes);