Products & Services Solutions Academia Support User Community Company

Learn more about SimEvents   

LIFO Queue - Store entities in stack 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 last-in, first-out (LIFO) fashion. 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.

Ports

Entity Input Ports

LabelDescription
INPort for arriving entities, which will be 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. If the entity arrives at an empty queue and immediately departs, then len has one sample time hit, not two.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

LIFO Queue Tab

Capacity

Determines how many entities the block can store at a time.

    Note   The ability to set Capacity to 0 will be removed in a future release. Instead, either use a positive value or omit this block from your model.

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 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".

Number of entities departed

Controls the presence and behavior of the signal output port labeled #d.

Number of entities in queue

Controls the presence and behavior of the signal output port labeled #n.

Average wait

Controls the presence and behavior of the signal output port labeled w.

Average queue length

Controls the presence and behavior of the signal output port labeled len.

Number of entities timed out

Controls the presence and behavior of the signal output port labeled #to.

Examples

See Example: Waiting Time in LIFO Queue.

See Also

FIFO Queue, Priority Queue

Using a LIFO Queuing Discipline

  


Free Discrete Event Simulation Technical Kit

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS