Class Signal
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public class Signal extends OpenClass implements Serializable
A signal class representing special customers in G-networks and related models.
Signals are specialized open classes that can have special effects on queues they visit. Unlike regular customers that simply receive service, signals can:
- Remove jobs from destination queues (NEGATIVE signals)
- Reset queue states (RESET signals)
- Trigger reply actions (REPLY signals)
G-networks (Gelenbe networks) use negative signals to model scenarios like job cancellations or service interrupts.
Reference: Gelenbe, E. (1991). "Product-form queueing networks with negative and positive customers", Journal of Applied Probability
-
-
Field Summary
Fields Modifier and Type Field Description public SignalTypesignalTypepublic JobClasstargetJobClassprotected Networkmodelprotected JobClassTypetypeprotected intpriorityprotected booleancompletesprotected Stationrefstatprotected booleanisrefclassprotected intindexprotected doubledeadlinepublic Array<Integer>attributepublic intreplySignalClassIndexpublic Distributionpatiencepublic PatienceTypepatienceTypeprotected Stringname
-
Constructor Summary
Constructors Constructor Description Signal(Network model, String name, SignalType signalType, int priority)Creates a new signal class with the specified type and priority. Signal(Network model, String name, SignalType signalType)Creates a new signal class with the specified type and default priority (0). Signal(Network model, String name)Creates a new negative signal class with default priority (0).
-
Method Summary
Modifier and Type Method Description SignalTypegetSignalType()Gets the signal type for this signal class. voidsetSignalType(SignalType signalType)Sets the signal type for this signal class. JobClassgetTargetJobClass()Gets the associated job class. SignalforJobClass(JobClass jobClass)Associates this signal with a job class. intgetTargetJobClassIndex()Gets the index of the associated job class. voidprintSummary()Prints a summary of this signal class configuration. -
Methods inherited from class jline.lang.JobClass
expectsReply, getAttribute, getCompletes, getDeadline, getIndex, getJobClassType, getNumberOfJobs, getPatience, getPatienceType, getPriority, getReferenceStation, getReplySignalClassIndex, hasPatience, isReferenceClass, isReferenceStation, setAttribute, setCompletes, setDeadline, setPatience, setPatience, setPriority, setReferenceClass, setReferenceStation, setReplySignalClassIndex -
Methods inherited from class jline.lang.OpenClass
setReferenceStation -
Methods inherited from class jline.lang.Element
getName, setName -
Methods inherited from class jline.lang.Copyable
copy -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Signal
Signal(Network model, String name, SignalType signalType, int priority)
Creates a new signal class with the specified type and priority.- Parameters:
model- the network model to add this class toname- the name for this signal classsignalType- the type of signal (NEGATIVE, RESET, or REPLY)priority- the priority level for signals in this class
-
Signal
Signal(Network model, String name, SignalType signalType)
Creates a new signal class with the specified type and default priority (0).- Parameters:
model- the network model to add this class toname- the name for this signal classsignalType- the type of signal (NEGATIVE, RESET, or REPLY)
-
-
Method Detail
-
getSignalType
SignalType getSignalType()
Gets the signal type for this signal class.
- Returns:
the signal type
-
setSignalType
void setSignalType(SignalType signalType)
Sets the signal type for this signal class.
- Parameters:
signalType- the new signal type
-
getTargetJobClass
JobClass getTargetJobClass()
Gets the associated job class.
- Returns:
the JobClass associated with this signal, or null if none
-
forJobClass
Signal forJobClass(JobClass jobClass)
Associates this signal with a job class.
For REPLY signals, this specifies which job class's servers will be unblocked when this signal arrives.
- Parameters:
jobClass- the JobClass to associate with this signal- Returns:
this Signal instance (for method chaining)
-
getTargetJobClassIndex
int getTargetJobClassIndex()
Gets the index of the associated job class.
- Returns:
the index of the associated JobClass, or -1 if none
-
printSummary
void printSummary()
Prints a summary of this signal class configuration.
-
-
-
-