LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
sn_has_sd_routing.m
1%{ @file sn_has_sd_routing.m
2 % @brief Checks if the network has state-dependent routing strategies
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Checks if the network has state-dependent routing strategies
9 %
10 % @details
11 % Returns true if the network contains routing strategies that are state-dependent
12 % and therefore violate the product-form assumption. State-dependent routing
13 % strategies include Round-Robin, Weighted Round-Robin, Join Shortest Queue,
14 % Power of K Choices, and Reinforcement Learning.
15 %
16 % @par Syntax:
17 % @code
18 % bool = sn_has_sd_routing(sn)
19 % @endcode
20 %
21 % @par Parameters:
22 % <table>
23 % <tr><th>Name<th>Description
24 % <tr><td>sn<td>Network structure
25 % </table>
26 %
27 % @par Returns:
28 % <table>
29 % <tr><th>Name<th>Description
30 % <tr><td>bool<td>True if the network has state-dependent routing
31 % </table>
32%}
33function bool = sn_has_sd_routing(sn)
34
35% Product-form requires state-independent (Markovian) routing.
36% PROB and RAND are product-form compatible.
37% RROBIN, WRROBIN, JSQ, KCHOICES, RL are state-dependent and violate product-form.
38
39if isempty(sn.routing)
40 bool = false;
41 return;
42end
43
44% Check for any state-dependent routing strategy
45bool = any(sn.routing(:) == RoutingStrategy.RROBIN | ...
46 sn.routing(:) == RoutingStrategy.WRROBIN | ...
47 sn.routing(:) == RoutingStrategy.JSQ | ...
48 sn.routing(:) == RoutingStrategy.KCHOICES | ...
49 sn.routing(:) == RoutingStrategy.RL);
50end