Documentation Center

  • 評価版
  • 製品アップデート

FIFO Queue

Store entities in sequence for undetermined length of time

Library

Queues

Description

This block stores up to N entities simultaneously, where N is the Capacity parameter value. The block attempts to output an entity through the OUT port, but retains the entity if the OUT port is blocked. If the block is storing multiple entities and no entity times out, then entities depart in a first-in, first-out (FIFO) fashion. If an entity in this block is scheduled to time out, then it might depart prematurely via the optional TO port. For an example, see Use Timeouts to Limit Entity Queueing Time. 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.

Ports

Entity Input Ports

LabelDescription
INPort for arriving entities, which are stored.

Entity Output Ports

LabelDescription
OUTPort for departing entities that do not time out while in this block.
TOPort 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

LabelDescriptionTime of Update When Statistic Is OnOrder of Update When Entity Departs
#dNumber of entities that have departed from this block via the OUT port since the start of the simulation.After entity departure via the OUT port3
#nNumber of entities currently in the queue.After entity arrival and after entity departure2
wSample mean of the waiting times in this block for all entities that have departed via any port.After entity departure1
lenAverage 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
#toNumber of entities that have timed out from this block since the start of the simulation.After entity departure via the TO port3

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.

Dialog Box

FIFO Queue Tab

Capacity

Determines how many entities the block can store at a time. The capacity must be a positive integer or Inf.

Timeout Tab

Enable TO port for timed-out entities

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.

Statistics Tab

These parameters determine whether the block produces data at signal output ports or omits those ports. For descriptions of the data and ports, see the preceding table, "Signal Output Ports".

Number of entities departed

Allows you to use the signal output port labeled #d.

Number of entities in queue

Allows you to use the signal output port labeled #n.

Average wait

Allows you to use the signal output port labeled w.

Average queue length

Allows you to use the signal output port labeled len.

Number of entities timed out

Allows you to use the signal output port labeled #to.

Was this topic helpful?