1classdef (Sealed) HeteroSchedPolicy
2 % HeteroSchedPolicy Enumeration of scheduling policies
for heterogeneous multiserver queues
4 % HeteroSchedPolicy defines constants
for scheduling policies that determine
5 % how jobs are assigned to server types in heterogeneous multiserver queues.
6 % These policies are used when a job
's class is compatible with multiple
9 % @brief Scheduling policies for heterogeneous server assignment
12 % - ORDER: Assign to first available compatible server type (in definition order)
13 % - ALIS: Assign Longest Idle Server (round-robin with busy servers at back)
14 % - ALFS: Assign Longest Free Server (fairness sorting by coverage)
15 % - FAIRNESS: Fair distribution across compatible server types
16 % - FSF: Fastest Server First (based on expected service time)
17 % - RAIS: Random Available Idle Server
21 % queue = Queue(model, 'HeteroQueue
', SchedStrategy.FCFS);
22 % st1 = ServerType('Fast
', 2);
23 % queue.addServerType(st1);
24 % queue.setHeteroSchedPolicy(HeteroSchedPolicy.FSF);
27 % Copyright (c) 2012-2026, Imperial College London
28 % All rights reserved.
31 % ORDER - First available compatible server type in definition order (default)
34 % ALIS - Assign Longest Idle Server (round-robin)
37 % ALFS - Assign Longest Free Server with fairness sorting
40 % FAIRNESS - Fair distribution across compatible server types
43 % FSF - Fastest Server First (minimum expected service time)
46 % RAIS - Random Available Idle Server
51 function policy = fromText(text)
52 % FROMTEXT Convert text to HeteroSchedPolicy constant
54 % policy = FROMTEXT(text) converts a string to the corresponding
55 % HeteroSchedPolicy constant value.
57 % @param text String representation of the policy
58 % @return policy The corresponding HeteroSchedPolicy constant
62 policy = HeteroSchedPolicy.ORDER;
64 policy = HeteroSchedPolicy.ALIS;
66 policy = HeteroSchedPolicy.ALFS;
68 policy = HeteroSchedPolicy.FAIRNESS;
70 policy = HeteroSchedPolicy.FSF;
72 policy = HeteroSchedPolicy.RAIS;
74 line_error(mfilename, 'Unknown HeteroSchedPolicy: %s
', text);
78 function text = toText(policy)
79 % TOTEXT Convert HeteroSchedPolicy constant to text
81 % text = TOTEXT(policy) converts a HeteroSchedPolicy constant
82 % to its string representation.
84 % @param policy The HeteroSchedPolicy constant
85 % @return text String representation of the policy
88 case HeteroSchedPolicy.ORDER
90 case HeteroSchedPolicy.ALIS
92 case HeteroSchedPolicy.ALFS
94 case HeteroSchedPolicy.FAIRNESS
96 case HeteroSchedPolicy.FSF
98 case HeteroSchedPolicy.RAIS