1classdef ClosedSignal < ClosedClass
2 % ClosedSignal Signal
class for closed queueing networks
4 % ClosedSignal
is a specialized ClosedClass
for modeling signals in closed
5 % queueing networks. Unlike regular customers, signals can have special
6 % effects on queues they visit, such as removing jobs (negative signals)
7 % or unblocking servers (reply signals).
9 % For open networks, use OpenSignal instead.
11 % ClosedSignal has zero population - signals are created dynamically
12 % through
class switching from the target job class.
15 % - SignalType.NEGATIVE: Removes a job from the destination queue
16 % - SignalType.REPLY: Unblocks servers waiting
for a reply
20 % model = Network(
'ClosedModel');
21 % delay = Delay(model,
'Think');
22 % queue1 = Queue(model,
'Client', SchedStrategy.FCFS);
23 % queue2 = Queue(model,
'Server', SchedStrategy.FCFS);
24 % jobClass = ClosedClass(model,
'Job', 5, delay);
25 % replySignal = ClosedSignal(model,
'Reply', SignalType.REPLY, delay).forJobClass(jobClass);
28 % Copyright (c) 2012-2026, Imperial College London
29 % All rights reserved.
32 signalType % SignalType constant (NEGATIVE, REPLY)
33 targetJobClass % JobClass that this signal
is associated with
38 function self = ClosedSignal(model, name, signalType, refstat, prio)
39 % CLOSEDSIGNAL Create a closed signal class instance
41 % @param model Network model to add the signal class to
42 % @param name String identifier for the signal class
43 % @param signalType SignalType constant (default: SignalType.NEGATIVE)
44 % @param refstat Reference station (should match target job class)
45 % @param prio Optional priority level (default: 0)
46 % @return self ClosedSignal instance
52 line_error(mfilename,
'ClosedSignal requires a reference station.');
54 if nargin < 3 || isempty(signalType)
55 signalType = SignalType.NEGATIVE;
58 % ClosedSignal has 0 population - signals are created by class switching
59 self@ClosedClass(model, name, 0, refstat, prio);
60 self.signalType = signalType;
61 self.targetJobClass = [];
64 function type = getSignalType(self)
65 % GETSIGNALTYPE Get the signal type
66 type = self.signalType;
69 function self = forJobClass(self, jobClass)
70 % FORJOBCLASS Associate
this signal with a job
class
72 % For REPLY signals,
this specifies which job
class's servers
73 % will be unblocked when this signal arrives.
75 % @param jobClass The JobClass to associate with this signal
76 % @return self The modified Signal instance (for chaining)
78 self.targetJobClass = jobClass;
80 jobClass.replySignalClass = self;
84 function jobClass = getTargetJobClass(self)
85 % GETTARGETJOBCLASS Get the associated job class
86 jobClass = self.targetJobClass;
89 function idx = getTargetJobClassIndex(self)
90 % GETTARGETJOBCLASSINDEX Get the index of the associated job class
91 if isempty(self.targetJobClass)
94 idx = self.targetJobClass.index;
98 function summary(self)
100 line_printf('Signal (%s): <strong>%s</strong> [%s]
', self.type, self.getName, self.signalType);