Store entities in sorted sequence for undetermined length of time
This block stores up to N entities simultaneously in a sorted
sequence, where N is the Capacity parameter value.
The queue sorts entities according to the values of an attribute,
in either ascending or descending order. Use the Sorting
attribute name and Sorting direction parameters
to determine the sorting behavior. The block accepts real numbers,
-Inf as valid values of the sorting attribute.
The block attempts to output an entity through the OUT port but retains the entity if the OUT port is blocked. If an entity in this block is scheduled to time out, then it might depart prematurely via the optional TO port. The length of time that an entity stays in this block cannot be determined in advance. The IN port is unavailable whenever this block stores exactly N entities. In this case, the queue is said to be full.
While you can view the value of the sorting attribute as an entity priority, this value has nothing to do with event priorities or block priorities.
Entity Input Ports
|IN||Port for arriving entities, which will be stored.|
Entity Output Ports
|OUT||Port for departing entities that do not time out while in this block.|
|TO||Port for entities that time out while in this block. You see this port only if you select Enable TO port for timed-out entities. This port must not be blocked when an entity attempts to depart here.|
Signal Output Ports
|Label||Description||Time of Update When Statistic Is On||Order of Update When Entity Departs|
|#d||Number of entities that have departed from this block via the OUT port since the start of the simulation.||After entity departure via the OUT port||3|
|#n||Number of entities currently in the queue.||After entity arrival and after entity departure||2|
|w||Sample mean of the waiting times in this block for all entities that have departed via any port.||After entity departure||1|
|len||Average number of entities in the queue over time, that is, the time average of the #n signal.||After entity arrival and after entity departure.||1|
|#to||Number of entities that have timed out from this block since the start of the simulation.||After entity departure via the TO port||3|
Output signals having the same number in the Order of Update column in the table above are updated in an arbitrary sequence relative to each other; you should not rely on a specific sequence for your simulation results.
The initial output value, which is in effect from the start of the simulation until the first update by the block, is 0 for all signals.
Determines how many entities the block can store at a time.
The capacity must be a positive integer or
The block uses this attribute to sort entities in the queue.
Determines whether the entity at the head of the queue is the
one with the smallest (
Ascending) or largest
Descending) value of the attribute named
above. Entities sharing the same attribute value are sorted in FIFO
This option becomes relevant if an entity times out while in this block. Selecting this option provides a TO entity output port through which the timed-out entity departs. If you clear this option in a model that uses timeouts, see the If entity has no destination when timeout occurs parameter of the Schedule Timeout block.
These parameters determine whether certain ports produce data throughout the simulation, produce data only when you stop or pause the simulation, or are omitted from the block. For descriptions of the affected ports, see the preceding table, "Signal Output Ports".
Allows you to use the signal output port labeled #d.
Allows you to use the signal output port labeled #n.
Allows you to use the signal output port labeled w.
Allows you to use the signal output port labeled len.
Allows you to use the signal output port labeled #to.