public abstract class StackableQueuingDiscipline extends java.lang.Object implements QueuingDiscipline
QueuingDiscipline.QueueEntry| Modifier and Type | Field and Description |
|---|---|
protected ProbabilityStatistic |
lossProbability |
protected IntegralStatistic |
numberOfMessages |
protected IntegralStatistic |
numberOfUnits |
protected SimNode |
parent |
protected SimNode |
simNode |
protected SampleStatistic |
transferTime |
protected SampleStatistic |
waitingTime |
CREATE_INSTANCE_METHOD_NAME| Constructor and Description |
|---|
StackableQueuingDiscipline(SimNode ownNode) |
StackableQueuingDiscipline(SimNode ownNode,
Parameters pars) |
| Modifier and Type | Method and Description |
|---|---|
QueuingDiscipline.QueueEntry |
dequeue()
Dequeue the next
QueuingDiscipline.QueueEntry according to the
QueuingDiscipline. |
QueuingDiscipline.QueueEntry |
dropScheduledNext()
This method returns the
QueuingDiscipline.QueueEntry that would be delivered next,
but accounts it as drop. |
void |
enqueue(Message msg) |
int |
getCurrentNumberOfMessages() |
long |
getCurrentNumberOfUnits() |
abstract int |
getMaxSizeInUnits() |
java.lang.String |
getName() |
SimNode |
getNode() |
SimNode |
getParent() |
protected void |
handleLossMessage(QueuingDiscipline.QueueEntry qe) |
protected void |
handleLossMessageInternal(QueuingDiscipline.QueueEntry qe)
This method is intended to be overriden to implement any desired loss
handling while ensuring that numberOfMessages and -Units is decremented
accordingly.
|
boolean |
handleMessage(Message msg)
Request the
QueuingDiscipline to handle the Message. |
protected void |
handleRejectedMessage(QueuingDiscipline.QueueEntry qe)
Whatever to be done at rejected packets, e.g.
|
boolean |
hasSpaceFor(Message msg)
A simple method to check for "physical" space.
|
abstract boolean |
isEmpty() |
QueuingDiscipline.QueueEntry |
peek()
Retrieve the QueueEntry that would be delivered next, without actually
removing it.
|
protected abstract QueuingDiscipline.QueueEntry |
peekInternal() |
protected abstract QueuingDiscipline.QueueEntry |
pop()
Retrieve and remove the next QueueEntry according to the queuing
discipline.
|
protected abstract void |
push(QueuingDiscipline.QueueEntry qe)
Push message into the data structure managed by the queuing discipline.
|
protected void |
statsUpdateDequeue(QueuingDiscipline.QueueEntry qe) |
protected void |
statsUpdateEnqueue(QueuingDiscipline.QueueEntry qe)
Whatever to be done at enqueue, e.g.
|
protected void |
statsUpdateLoss(QueuingDiscipline.QueueEntry qe)
Whatever to be done on loss, e.g.
|
protected void |
statsUpdateReject(QueuingDiscipline.QueueEntry qe) |
boolean |
wouldStore(Message msg) |
protected final SimNode simNode
protected final SimNode parent
protected final SampleStatistic waitingTime
protected final SampleStatistic transferTime
protected final IntegralStatistic numberOfUnits
protected final ProbabilityStatistic lossProbability
protected final IntegralStatistic numberOfMessages
public StackableQueuingDiscipline(SimNode ownNode, Parameters pars)
public StackableQueuingDiscipline(SimNode ownNode)
public abstract int getMaxSizeInUnits()
getMaxSizeInUnits in interface QueuingDisciplinepublic java.lang.String getName()
getName in interface QueuingDisciplinepublic SimNode getNode()
getNode in interface QueuingDisciplinepublic SimNode getParent()
getParent in interface QueuingDisciplinepublic abstract boolean isEmpty()
isEmpty in interface QueuingDisciplinepublic boolean wouldStore(Message msg)
wouldStore in interface QueuingDisciplineProbabilisticQueuingDisciplines. For these, two subsequent
calls with the same message may return different results!public boolean hasSpaceFor(Message msg)
msg - QueuingDiscipline has space for that message.public final int getCurrentNumberOfMessages()
getCurrentNumberOfMessages in interface QueuingDisciplinepublic final long getCurrentNumberOfUnits()
getCurrentNumberOfUnits in interface QueuingDisciplinepublic final QueuingDiscipline.QueueEntry dequeue()
QueuingDisciplineQueuingDiscipline.QueueEntry according to the
QueuingDiscipline. This will be accounted for as successful
forwarding.dequeue in interface QueuingDisciplineQueuingDiscipline.QueueEntrypublic boolean handleMessage(Message msg)
QueuingDisciplineQueuingDiscipline to handle the Message. This
can either store it, then it returns true, or drop it, then it return
false. If it drops it, this drop will be accounted for (as drop with 0
waiting time).handleMessage in interface QueuingDisciplinepublic QueuingDiscipline.QueueEntry dropScheduledNext()
QueuingDisciplineQueuingDiscipline.QueueEntry that would be delivered next,
but accounts it as drop.dropScheduledNext in interface QueuingDisciplineQueuingDiscipline.QueueEntrypublic final void enqueue(Message msg)
protected void handleRejectedMessage(QueuingDiscipline.QueueEntry qe)
qe - protected final void handleLossMessage(QueuingDiscipline.QueueEntry qe)
protected void handleLossMessageInternal(QueuingDiscipline.QueueEntry qe)
qe - protected void statsUpdateEnqueue(QueuingDiscipline.QueueEntry qe)
qe - protected void statsUpdateReject(QueuingDiscipline.QueueEntry qe)
protected void statsUpdateLoss(QueuingDiscipline.QueueEntry qe)
qe - protected void statsUpdateDequeue(QueuingDiscipline.QueueEntry qe)
protected abstract void push(QueuingDiscipline.QueueEntry qe)
public final QueuingDiscipline.QueueEntry peek()
Message object than the next pop(). Therefore only
peekInternal() may be overriden.protected abstract QueuingDiscipline.QueueEntry peekInternal()
protected abstract QueuingDiscipline.QueueEntry pop()