LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SharedServer.m
1classdef SharedServer < ServiceSection
2 % A service section for serving jobs with processor sharing type
3 % policies
4 %
5 % Copyright (c) 2012-2026, Imperial College London
6 % All rights reserved.
7
8 methods
9 %Constructor
10 function self = SharedServer(customerClasses)
11 % SELF = SHAREDSERVER(CUSTOMERCLASSES)
12
13 self@ServiceSection('SharedServer');
14 self.numberOfServers = 1;
15 self.serviceProcess = {};
16 initServers(self, customerClasses); %[JobClass(), ServiceStrategy.LI, Distribution('exp')];
17 end
18 end
19
20 methods (Access = 'private')
21 function initServers(self, customerClasses)
22 % INITSERVERS(CUSTOMERCLASSES)
23
24 for i = 1 : length(customerClasses),
25 self.serviceProcess{1, i} = {customerClasses{1, i}.name, ServiceStrategy.LI, Exponential()};
26 end
27 end
28 end
29
30 methods(Access = protected)
31 % Override copyElement method:
32 function clone = copyElement(self)
33 % CLONE = COPYELEMENT()
34
35 % Make a shallow copy of all properties
36 clone = copyElement@Copyable(self);
37 % Make a deep copy of each object
38 for i=1:length(self.serviceProcess)
39 if ishandle(self.serviceProcess{i}{3})
40 clone.serviceProcess{i}{3} = self.serviceProcess{i}{3}.copy;
41 end
42 end
43 end
44 end
45end
46