public class FIFODropTailQueue extends StdSingleServerQueue
FIFODropTailQueue
is a subclass of
StdSingleServerQueue
and defines the ReceiveMessage
method called on message arrival as well as HandleEndOfService
.
Incoming messages are immediately processed if the server is free or stored
in a queue if the server is busy. When the server has completed service the
message at the head of the queue enters service.
CanEnqueue
returns true if the total message length including
the message that has just arrived is <= the buffer size which can be
specified in the input file.
If the DequeueForService flag is not set the message is always appended to the queue and remains there until service completion.
Entity.PortAlias
Modifier and Type | Field and Description |
---|---|
protected DistributionStatistic |
busyPeriodDistStat |
protected SampleStatistic |
busyPeriodMeanStat |
protected double |
busyPeriodStartTime |
protected boolean |
dequeueForService |
protected Message |
msgInService |
protected ProbabilityStatistic |
packetLossStat |
protected java.util.Deque<Message> |
queue |
protected int |
queueLength |
protected IntegralStatistic |
queueLengthStat |
protected boolean |
traceOccupancy |
protected boolean |
traceQueueLength |
bufferSize, occupancyStat, serviceTime, useStatistics
eosEvent, inputPort, outputPort
portAliases, ports, simNode
Modifier | Constructor and Description |
---|---|
|
FIFODropTailQueue(boolean dequeueForService,
boolean traceQLength,
boolean traceOccupancy,
int bufferSize,
double serviceRate,
boolean useStatistics,
java.lang.String name,
SimNode parentNode) |
protected |
FIFODropTailQueue(java.lang.String name,
SimNode parentNode) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
CanEnqueue(Message msg) |
void |
handleEndOfService(double currentTime) |
void |
receiveMessage(Message msg) |
calcServiceTime
addPort, aliasPort, aliasPort, connect, disconnect, getName, getNode, getPortByName, getPorts, isPortKnown, unaliasPort
protected boolean dequeueForService
protected boolean traceQueueLength
protected boolean traceOccupancy
protected final java.util.Deque<Message> queue
protected int queueLength
protected Message msgInService
protected double busyPeriodStartTime
protected ProbabilityStatistic packetLossStat
protected IntegralStatistic queueLengthStat
protected DistributionStatistic busyPeriodDistStat
protected SampleStatistic busyPeriodMeanStat
public FIFODropTailQueue(boolean dequeueForService, boolean traceQLength, boolean traceOccupancy, int bufferSize, double serviceRate, boolean useStatistics, java.lang.String name, SimNode parentNode)
protected FIFODropTailQueue(java.lang.String name, SimNode parentNode)
protected boolean CanEnqueue(Message msg)
public void handleEndOfService(double currentTime)
handleEndOfService
in class SingleServerQueue
public void receiveMessage(Message msg)
receiveMessage
in interface MessageReceiver
receiveMessage
in class SingleServerQueue