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
A flag to control whether the model element reacts to after experiment actions.
A flag to control whether the model element reacts to after replication actions.
A flag to control whether the model element reacts to before experiment actions.
A flag to control whether the model element reacts to before replication actions.
The current discipline for the queue
Indicates the current status of the model element for observers of ModelElement.Status
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.
A flag to control whether the model element reacts to initialization actions
Returns true if the queue is not empty
the left traversal count for pre-order traversal of the model element tree
Returns a string representation of the model element and its child model elements. Useful for realizing the model element hierarchy.
A flag to control whether the model element participates in monte carlo actions.
Gets the number of model elements contained by this model elements.
Allows access to number in queue response information
Indicates the previous status of the model element for observers of ModelElement.Status This allows the transition to be noted by observers
If the Queue uses randomness, this controls it. By default, it uses the model's global source of uniform random variates. //TODO this does not consider initial random source protocol if the user decides to change it, replications may not be replications
A flag to control whether the model element reacts to end replication actions.
the right traversal count for pre-order traversal of the model element tree
The spatial model associated with this model element. By default, each model element uses its parent model element's spatial model unless changed via this property. This changes the spatial model for this model element and no others.
Indicates whether something was just enqueued or dequeued
The time interval between TimedUpdate events. The default is zero, indicating no timed update
Specifies whether this model element participates in time update event specified by its parent
Specifies the havingPriority of this model element's timed update event.
Allows access to time in queue response information
Default option for whether waiting time statistics are collected upon removal of items from the queue
Indicates whether the warm-up action occurred sometime during the simulation for this model element. False indicates that the warm-up action has not occurred
Specifies if this model element will be warmed up when the warmup action occurs for its parent. The warm-up flag indicates whether this model element will be warmed up when its parent warm up event/action occurs. The default value for all model elements is true. A value of true implies that the model element allows its parent's warm up event to call the warm-up action. A value of false implies that the model element does not allow its parent's warm up event to call the warm-up action. False does not necessarily mean that the model element will not be warmed up. It may, through the use of the lengthOfWarmUp property, have its own warm up event and action.
Specifies the priority of this model element's warm up event.
Functions
Adds the supplied listener to this queue
Cancels the timed update event for this model element.
Cancels the warm-up event for this model element.
Checks if this model element or any model element directly above this model element in the hierarchy of model elements all the way until the top Model participates in the warm-up action.
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.
Find the first parent that has its own warm up event this guarantees that all elements below the found model element do not have their own warm-up event. A model element that has its own warm up event also opts out of the warm-up action. If the returned parent is the Model, then all are controlled by the model (unless they opt out). Elements can opt out and not have their own warm-up event. Thus, they have no warm up at all.
Fills up the supplied StringBuilder carrying a string representation of the model element and its child model elements Useful for realizing the model element hierarchy.
This method returns the planned time for the warm-up for this model element.
Fills a StringBuilder carrying the model element names in the order that they will be initialized
Checks if a warm-up event is scheduled for any model element directly above this model element in the hierarchy of model elements all the way until the top Model.
Checks if current status is the supplied status
Checks if a timed update event has been scheduled for this model element
Checks if a warm-up event has been scheduled for this model element
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.
Returns the value of a 1 millisecond time interval in terms of the base time unit
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
Sets the after experiment option of all model elements (children) contained by this model element.
Sets the after replication flag of all model elements (children) contained by this model element.
Sets the before experiment option of all model elements (children) contained by this model element.
Sets the before replication flag of all model elements (children) contained by this model element.
Sets the initialization option of all model elements (children) contained by this model element.
Sets the monte carlo option flag of all model elements (children) contained by this model element.
Sets the end replication option flag of all model elements (children) contained by this model element. Determines whether the replicationEnded() method will be called
Sets the timed update option flag of all model elements (children) contained by this model element.
Sets the warm-up option flag of all model elements (children) contained by this model element.