LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
Server.m
1classdef Server < ServiceSection
2 % Server Basic non-preemptive service section for job processing
3 %
4 % Server implements a basic service section that processes jobs according
5 % to non-preemptive disciplines. It manages service processes for different
6 % job classes and coordinates with scheduling sections to provide complete
7 % queueing station functionality.
8 %
9 % @brief Non-preemptive service section with class-dependent service processes
10 %
11 % Key characteristics:
12 % - Non-preemptive job service
13 % - Class-dependent service time distributions
14 % - Single or multiple server support
15 % - Load-independent service strategies
16 % - Integration with scheduling disciplines
17 %
18 % Server features:
19 % - Service process management per class
20 % - Service time distribution configuration
21 % - Server capacity specification
22 % - Load-independent operation
23 % - Deep copy support for model cloning
24 %
25 % Server is used in:
26 % - Basic FCFS and LCFS queues
27 % - Priority queue service sections
28 % - Multi-server queue implementations
29 % - Load-independent service modeling
30 % - Class-differentiated service systems
31 %
32 % Example:
33 % @code
34 % classes = {OpenClass(model, 'Class1'), ClosedClass(model, 'Class2', 5)};
35 % server = Server(classes);
36 % server.setServiceProcess(1, 1, Exp(2.0)); % Class1 service
37 % @endcode
38 %
39 % Copyright (c) 2012-2026, Imperial College London
40 % All rights reserved.
41
42 methods
43 %Constructor
44 function self = Server(classes)
45 % SERVER Create a basic server section instance
46 %
47 % @brief Creates a Server section for non-preemptive job processing
48 % @param classes Cell array of JobClass objects to be served
49 % @return self Server instance configured for the specified classes
50
51 self@ServiceSection('Server');
52 self.numberOfServers = 1;
53 self.serviceProcess = {};
54 initServers(self, classes);
55 end
56 end
57
58 methods (Access = 'private')
59 function initServers(self, classes)
60 % INITSERVERS(CLASSES)
61
62 for i = 1 : length(classes)
63 self.serviceProcess{1, i} = {classes{i}.name, ServiceStrategy.LI, Exp(0.0)};
64 end
65 end
66 end
67
68 methods(Access = protected)
69 % Override copyElement method:
70 function clone = copyElement(self)
71 % CLONE = COPYELEMENT()
72
73 % Make a shallow copy of all properties
74 clone = copyElement@Copyable(self);
75 % Make a deep copy of each object
76 for i = 1 : length(self.serviceProcess)
77 if ishandle(clone.serviceProcess{1,i}{3})
78 % this is a problem if one modifies the classes in the
79 % model because the one below is not an handle so it
80 % will not be modified
81 clone.serviceProcess{1,i}{3} = self.serviceProcess{1,i}{3}.copy;
82 end
83 end
84 end
85 end
86
87end
88