Queue
The Queue class provides the ability to hold entities (QObjects) within the model.
FIFO ensures first-in, first-out behavior. LIFO ensures last-in, last-out behavior. RANKED ensures that each new element is added such that the priority is maintained from the smallest first to the largest priority last using the compareTo method of the QObject. Ties in priority give preference to time of creation, then to order of creation. RANDOM causes the elements to be randomly selected (uniformly).
Parameters
its parent
The name of the queue
The queuing discipline to be followed
Inheritors
Constructors
Types
Properties
The current discipline for the queue
Returns the default reporting option. True means that the response should appear on the default reports
The initial queue discipline. The initial discipline indicates the queue distribution that will be used at the beginning of each replication. Changing the initial discipline during a replication will have no effect until the next replication. WARNING: This will cause replications to have different disciplines and thus invalidate the concept of replications if used during a replication. Use this method only when the simulation is not running.
This property provides a reference to allow random selection from queues. It can only be changed if the model is not running. By default, it is set equal to the model's default random number stream
Returns true if the queue is not empty
Allows access to number in queue response information
Indicates whether something was just enqueued or dequeued
Allows access to time in queue response information
Default option for whether waiting time statistics are collected upon removal of items from the queue
Functions
Adds the supplied listener to this queue
Returns true if this queue contains the specified element. More formally, returns true if and only if this list contains at least one element e such that (o==null ? e==null : o.equals(e)).
Returns true if this queue contains all the elements in the specified collection WARNING: The collection should contain references to QObject's otherwise it will certainly return false.
Returns the index in this queue of the last occurrence of the specified element, or -1 if the queue does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
Returns an iterator (as specified by Collection ) over the elements in the queue in proper sequence. The elements will be ordered according to the state of the queue given the specified queue discipline.
Removes the first occurrence in the queue of the specified element Automatically collects waiting time statistics and number in queue statistics. If the queue does not contain the element then it is unchanged and false is returned
Finds and removes all the QObjects in the Queue that satisfy the condition and adds them to the deletedItems collection
Removes the element at the specified position in this queue. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
Removes from this queue all the elements.
Removes from this queue all the elements that are contained in the specified collection The collection should contain references to objects of type QObject that had been enqueued in this queue; otherwise, nothing will be removed.
Removes from this queue all the elements that are presented by iterating through this iterator The iterator should be based on a collection that contains references to objects of type QObject that had been enqueued in this queue; otherwise, nothing will be removed.
Removes the QObject at the front of the queue Uses remove(int index) where index = 0
Removes the QObject at the last index in the queue. Uses remove(int index) where index is the size of the list - 1
Removes the next item from the queue according to the queue discipline that was specified. Returns a reference to the QObject representing the item that was removed
Removes the supplied listener from this queue