Main Content

Queue and Service

FIFO queue, LIFO queue, priority queue, delay modeling, entity storage, buffering

In a discrete-event simulation, queueing blocks store entities for a length of time that cannot be determined in advance. Queuing blocks attempt to output entities when possible, but its output depends on whether the downstream block accepts new entities. An everyday example of a queue is people waiting in line for a store register. A shopper cannot determine in advance how long they will have to wait to complete their purchase. TheEntity Queueblock is one of the queueing blocks provided in the SimEvents®可以根据排序策略在队列中对实体进行排序的库。您可以对FIFO队列,LIFO队列和优先队列进行建模。有关更多信息,请参阅Model Basic Queuing Systems.

您可以使用SimeVents库中提供的队列和服务器块来建模基本或复杂的队列服务器系统。服务器块存储和延迟实体的指定时间长度,然后尝试输出实体。服务器的日常示例正在工厂装配线中处理一定时间段的零件。在这种情况下,服务器延迟可以代表热过程的持续时间。这Entity Serverblock is one of the server blocks that stores and services entities, and then attempts to output them.

您还可以创建更高级的排队系统using discrete-event System object™ and离散事件图表block.

Blocks

expand all

Entity Queue Enqueue messages and entities
Entity Store Store entities
Entity Server Serve entities
Entity Transport Delay 引入延迟传播SimEventsmessage
Conveyor System Transport entities

Topics

Basic Queuing Systems

Overview of Queues and Servers in Discrete-Event Simulation

Model storage with queues and servers, use serial or parallel queue-server pairs.

Model Basic Queuing Systems

Use FIFO queue, LIFO queue, priority queue, and servers to model queueing systems.

Broadcast Entities using Entity Multicasting

Send, receive, transport, and multicast entities wirelessly.

Applications of Basic Queuing Systems

使用队列事件动作对储罐进行建模

This example shows how to use Entity Queue block event actions, a Simulink Function block, and an Entity Gate block to model a bottle storage system with a limited capacity.

Serve High-Priority Customers by Sorting Entities Based on Priority

This example shows how to minimize the time required to serve high-priority customers by using a priority queue and Entity Input Switch and Entity Output Switch blocks.

Model Traffic Intersections as a Queuing Network

This example shows how to create a SimEvents® model to represent a vehicle traffic network and to investigate mean waiting time of vehicles when the network is in steady-state.

Model Preemption and Server Failure

Model Server Failure

Using Stateflow®charts to model the behavior of a server that requires maintenance.

Task Preemption in a Multitasking Processor

Model server task preemption for low priority tasks.

Model Advanced Queuing Systems with Custom Behavior

Create Custom Blocks Using MATLAB Discrete-Event System Block

Author discrete-event System object by defining entity types, ports, storage, and events.

Flush Entities from a Queue-Server

This example shows how you can use a Discrete-Event Chart block to model a queue-server that can flush entities when it receives a message on the "FlushCmd" port.