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