public abstract class FairQueuing extends StackableQueuingDiscipline
MessageClassificator
.
Fair queuing involves two tasks:
QueuingDiscipline.QueueEntry
Modifier and Type | Field and Description |
---|---|
protected ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer |
activeQ |
protected java.util.TreeMap<java.lang.Long,java.util.LinkedList<ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer>> |
longestQList |
protected int |
maxSizeInUnits |
protected MessageClassificator<ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer> |
queues |
lossProbability, numberOfMessages, numberOfUnits, parent, simNode, transferTime, waitingTime
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
FairQueuing(SimNode ownNode,
Parameters pars) |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
activeQListIsEmpty()
update the sortedQList, that defines which Q is dequeued next, and the
longestQList, which defines which Q would be dropped from next, if push()
makes that necessary
|
protected abstract void |
addToActiveQList(ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer sq) |
protected abstract void |
advanceActiveQ() |
protected void |
bufferStealing()
Discard if necessary to obey the maximum size.
|
abstract ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer |
createSortableQDisc(StackableQueuingDiscipline q) |
int |
getMaxSizeInUnits() |
boolean |
isEmpty() |
protected QueuingDiscipline.QueueEntry |
peek()
Retrieve the QueueEntry that would be delivered next, without actually
removing it.
|
protected QueuingDiscipline.QueueEntry |
pop()
Retrieve and remove the next QueueEntry according to the queuing
discipline.
|
protected void |
push(QueuingDiscipline.QueueEntry qe)
Push message into the data structure managed by the queuing discipline.
|
protected abstract void |
updateActiveQList(ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer sq,
double oldPos) |
protected void |
updateLongestQList(ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer sq,
long oldLength) |
abstract boolean |
wouldStore(Message msg) |
dequeue, dropScheduledNext, enqueue, getCurrentNumberOfMessages, getCurrentNumberOfUnits, getName, getNode, getParent, handleLossMessage, handleMessage, handleRejectedMessage, hasSpaceFor, statsUpdateDequeue, statsUpdateEnqueue, statsUpdateLoss, statsUpdateReject
protected MessageClassificator<ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer> queues
protected java.util.TreeMap<java.lang.Long,java.util.LinkedList<ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer>> longestQList
protected ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer activeQ
protected int maxSizeInUnits
public FairQueuing(SimNode ownNode, Parameters pars)
public abstract boolean wouldStore(Message msg)
wouldStore
in interface QueuingDiscipline
wouldStore
in class StackableQueuingDiscipline
ProbabilisticQeuingDiscipline
s. For these, two subsequent
calls with the same message may return different results!public abstract ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer createSortableQDisc(StackableQueuingDiscipline q)
protected abstract boolean activeQListIsEmpty()
sq
- oldKey
- protected abstract void addToActiveQList(ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer sq)
protected abstract void updateActiveQList(ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer sq, double oldPos)
protected abstract void advanceActiveQ()
protected void updateLongestQList(ikr.simlib.algorithms.queuingDisciplines.FairQueuing.SortableQDiscContainer sq, long oldLength)
public int getMaxSizeInUnits()
getMaxSizeInUnits
in interface QueuingDiscipline
getMaxSizeInUnits
in class StackableQueuingDiscipline
public boolean isEmpty()
isEmpty
in interface QueuingDiscipline
isEmpty
in class StackableQueuingDiscipline
protected void push(QueuingDiscipline.QueueEntry qe)
StackableQueuingDiscipline
push
in class StackableQueuingDiscipline
protected void bufferStealing()
protected QueuingDiscipline.QueueEntry peek()
StackableQueuingDiscipline
peek
in class StackableQueuingDiscipline
protected QueuingDiscipline.QueueEntry pop()
StackableQueuingDiscipline
pop
in class StackableQueuingDiscipline