LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
Linkage.m
1classdef Linkage < OutputSection
2 % An output section dispatching jobs to a destination
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 methods
8 %Constructor
9 function self = Linkage(customerClasses)
10 % SELF = DISPATCHER(CUSTOMERCLASSES)
11
12 self@OutputSection('Linkage');
13 self.outputStrategy = {};
14 initDispatcherJobClasses(self, customerClasses);
15 end
16 end
17
18 methods
19 function initDispatcherJobClasses(self, customerClasses)
20 % INITDISPATCHERJOBCLASSES(CUSTOMERCLASSES)
21
22 for r = 1 : length(customerClasses)
23 self.outputStrategy{r} = {customerClasses{r}.name, RoutingStrategy.RAND};
24 end
25 end
26
27 function setStrategy(self, customerClasses, strategy)
28 % SETSTRATEGY(CUSTOMERCLASSES, STRATEGY)
29
30 if isscalar(strategy)
31 self.outputStrategy{customerClasses{r}.index} = {customerClasses{r}.name, strategy};
32 else
33 for r = 1 : length(customerClasses)
34 self.outputStrategy{customerClasses{r}.index} = {customerClasses{r}.name, strategy{r}};
35 end
36 end
37 end
38 end
39
40end