LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
Dispatcher.m
1classdef Dispatcher < OutputSection
2 % Dispatcher Output section for routing jobs to downstream destinations
3 %
4 % Dispatcher implements an output section that routes completed jobs to
5 % their next destinations according to specified routing strategies. It
6 % manages class-dependent routing decisions and coordinates job flow
7 % through the queueing network topology.
8 %
9 % @brief Output section for class-dependent job routing and dispatching
10 %
11 % Key characteristics:
12 % - Class-dependent routing strategies
13 % - Destination selection and job dispatching
14 % - Support for various routing policies
15 % - Integration with network topology
16 % - Probabilistic and deterministic routing
17 %
18 % Dispatcher features:
19 % - Routing strategy management per class
20 % - Destination probability specification
21 % - Random, round-robin, and custom routing
22 % - Class-based routing differentiation
23 % - Network flow coordination
24 %
25 % Dispatcher is used in:
26 % - Queue output sections for job routing
27 % - Router nodes for traffic distribution
28 % - Load balancing implementations
29 % - Multi-path network routing
30 % - Class-based service differentiation
31 %
32 % Example:
33 % @code
34 % classes = {OpenClass(model, 'WebReq'), OpenClass(model, 'DBReq')};
35 % dispatcher = Dispatcher(classes);
36 % dispatcher.setStrategy(classes{1}, RoutingStrategy.PROB);
37 % @endcode
38 %
39 % Copyright (c) 2012-2026, Imperial College London
40 % All rights reserved.
41
42 methods
43 %Constructor
44 function self = Dispatcher(customerClasses)
45 % SELF = DISPATCHER(CUSTOMERCLASSES)
46
47 self@OutputSection('Dispatcher');
48 self.outputStrategy = {};
49 initDispatcherJobClasses(self, customerClasses);
50 end
51 end
52
53 methods
54 function initDispatcherJobClasses(self, customerClasses)
55 % INITDISPATCHERJOBCLASSES(CUSTOMERCLASSES)
56
57 for r = 1 : length(customerClasses)
58 self.outputStrategy{r} = {customerClasses{r}.name, RoutingStrategy.toText(RoutingStrategy.DISABLED)};
59 end
60 end
61
62 function setStrategy(self, customerClasses, strategy)
63 % SETSTRATEGY(CUSTOMERCLASSES, STRATEGY)
64
65 if length(strategy)==1 %#ok<ISCL>
66 self.outputStrategy{customerClasses{r}.index} = {customerClasses{r}.name, strategy};
67 else
68 for r = 1 : length(customerClasses)
69 self.outputStrategy{customerClasses{r}.index} = {customerClasses{r}.name, strategy{r}};
70 end
71 end
72 end
73 end
74
75end
Definition mmt.m:92