1classdef SharedServer < ServiceSection
2 % A service section
for serving jobs with processor sharing type
5 % Copyright (c) 2012-2026, Imperial College London
10 function self = SharedServer(customerClasses)
11 % SELF = SHAREDSERVER(CUSTOMERCLASSES)
13 self@ServiceSection(
'SharedServer');
14 self.numberOfServers = 1;
15 self.serviceProcess = {};
16 initServers(self, customerClasses); %[JobClass(), ServiceStrategy.LI, Distribution(
'exp')];
20 methods (Access =
'private')
21 function initServers(self, customerClasses)
22 % INITSERVERS(CUSTOMERCLASSES)
24 for i = 1 : length(customerClasses),
25 self.serviceProcess{1, i} = {customerClasses{1, i}.name, ServiceStrategy.LI, Exponential()};
30 methods(Access =
protected)
31 % Override copyElement method:
32 function clone = copyElement(self)
33 % CLONE = COPYELEMENT()
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;