Main Content

队列,,,,实体队列

Enqueue messages and entities

  • 图书馆:
  • Simulink / Messages & Events

    SimEvents

  • 队列block

Description

This block stores entities or messages in a queue, based on the order of arrival or priority. Each element at the head of the queue departs when the downstream block is ready to accept it. The队列block and the实体队列block are the same blocks with different default values for the如果队列已满,则覆盖最古老的元素复选框。

您可以指定队列的能力,以及队列已满时的策略。该块支持三个不同的消金宝app息或队列排序策略,即首先出局(FIFO),最后一式(LIFO)和优先级。优先队列仅在如果队列已满,则覆盖最古老的元素复选框已清除。

Ports

Input

expand all

Input entity or message that carries scalar, bus, or vector data to enter the queue.

数据类型:单身的|double|int8|int16|int32|int64|UINT8|uint16|UINT32|Uint64|Boolean|enumerated|公共汽车|fixed point

输出

expand all

输出port that allows entities or messages at the head of the queue to depart when a downstream block is ready to accept them.

数据类型:单身的|double|int8|int16|int32|int64|UINT8|uint16|UINT32|Uint64|Boolean|enumerated|公共汽车|fixed point

Number of entities that have departed the block.

依赖性

To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框Number of entities departed, d

数据类型:double

Number of entities that have not yet departed the block.

依赖性

To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框块中的实体数量

数据类型:double

一个verage wait time for entities in the block.

依赖性

To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框一个verage wait, w

数据类型:double

port_l输出队列的平均长度的实体。

依赖性

To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框一个verage queue length, l

数据类型:double

Number of entities that are pulled out of this block.

依赖性

To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框提取的实体数量,ex

数据类型:double

参数

expand all

Select this check box to choose between two queue overwriting policies.

  • 如果选择复选框,如果队列已满,传入的消息将覆盖最古老的消息。

    此模式代表一个简单的消息缓冲区,您可以使用该模式在Simulink组件和生产代码之间生成异步通信。金宝app

  • 如果清除复选框,则该块如果队列已满,则该块不接受新消息。

    In this mode, you can manipulate entity data using event actions and visualize statistics.

    To customize actions when entities or messages enter, exit, or are blocked, enter MATLAB®代码入口action,,,,Exit action, 或者阻止action领域事件动作s标签。有关更多信息,请参阅事件和事件动作(simevents)

    For an example, seeManage Entities Using Event Actions(simevents)

程序化使用

块参数排队
Type:角色向量
Values'上'|'off'
Default'上'(for Simulink) and'off'(用于simevents)

指定队列的容量。

程序化使用

块参数Capacity
Type:角色向量
Values'25'|标量
Default'25'

Choose the queue type.

程序化使用

块参数Queuetype
Type:角色向量
Values'FIFO'|'lifo'|'Priority'
Default'FIFO'

通过多播来源广播实体时,指定标签。这Entity Multicastblock requires SimEvents license.

依赖性

This parameter is visible when you clear the如果队列已满,则覆盖最古老的元素复选框,设置Entity arrival source多播

程序化使用

块参数多播Tag
Type:角色向量
Values'一个'|角色向量
Default'一个'

指定实体的哪些属性确定其优先级。

依赖性

This parameter is visible when you clear the如果队列已满,则覆盖最古老的元素复选框,设置队列类型Priority

程序化使用

块参数优先级
Type:角色向量
Values'PriorityAttribute'|角色向量
Default'PriorityAttribute'

根据优先级选择排序方向。

  • 一个scending-Elements with smaller priority values appear in front of the queue.

  • Descending-Elements with greater priority values appear in front of the queue.

依赖性

This parameter is visible when you clear the如果队列已满,则覆盖最古老的元素复选框,设置队列类型Priority

程序化使用

块参数分类方向
Type:角色向量
Values'Ascending'|'Descending'
Default'Ascending'

Choose the source of arrival for the entities.

  • 输入端口- 输入端口是消息或实体的来源。

  • 多播-Entity Multicastblock is source of entities. TheEntity Multicastblock requires SimEvents license.

依赖性

This parameter is visible when you clear the如果队列已满,则覆盖最古老的元素复选框,设置队列类型Priority

程序化使用

块参数EntityArrivalSource
Type:角色向量
Values“输入端口”|“多播”
Default“输入端口”

在某些事件中指定实体的行为。定义行为事件动作parameter. The入口Exitactions are called just after the entity entry and just before entity exit. The阻止action is called after an entity is blocked. For more information, see事件和事件动作(simevents)

笔记

If an event action changes an entity, related block behavior such as resorting a priority queue, and rescheduling of any events, will occur after the event action has fully finished and returned.

笔记

事件动作s do not supportfixed pointdata type.

依赖性

事件动作s are visible when you clear the如果队列已满,则覆盖最古老的元素复选框。

程序化使用

块参数入口,退出,阻塞
Type:角色向量
Values:MATLAB代码
Default''

Number of entities that have departed the block.

依赖性

Number of entities departed, dis visible when you clear the如果队列已满,则覆盖最古老的元素复选框。

程序化使用

块参数数字驱动
Type:角色向量
Values'上'|'off'
Default'off'

Number of entities present in the block, but which are yet to depart.

依赖性

块中的实体数量is visible when you clear the如果队列已满,则覆盖最古老的元素复选框。

程序化使用

块参数NumberEntitiesInBlock
Type:角色向量
Values'上'|'off'
Default'off'

离开块的实体的等待时间总数除以其总数。Wait time实体队列block entry and exit of an entity. For more information, seeInterpret SimEvents Models Using Statistical Analysis(simevents)

依赖性

一个verage wait, wis visible when you clear the如果队列已满,则覆盖最古老的元素复选框。

程序化使用

块参数一个verageWait
Type:角色向量
Values'上'|'off'
Default'off'

一个ccumulated time-weighted average queue size. The block computes this value by:

  1. Multiplying the size of the queue by its duration to calculate time-weighted queue size

  2. 总结所有时间加权的队列大小,并在总时间内平均

有关更多信息,请参阅Interpret SimEvents Models Using Statistical Analysis(simevents)

依赖性

一个verage queue length, lis visible when you clear the如果队列已满,则覆盖最古老的元素复选框。

程序化使用

块参数平均水平
Type:角色向量
Values'上'|'off'
Default'off'

输出通过Entity Findblock. TheEntity Find块需要SimEvents许可证。如果提取ed entity is the first entity in the queue, the next entity is set as the pending entity to leave the block. If an entity attribute defines the priority in a priority queue and it is modified by theEntity Find块,队列再次排序。提取实体时,Number of entities departed, d,,,,块中的实体数量,,,,一个verage wait, w,,,,and一个verage queue length, l统计数据已相应更新。有关查找和提取实体的更多信息,请参见Find and Extract Entities in SimEvents Models(simevents)

依赖性

提取的实体数量,exis visible when you clear the如果队列已满,则覆盖最古老的元素复选框。

程序化使用

块参数NumEntitiesExtracted
Type:角色向量
Values'上'|'off'
Default'off'

Block Characteristics

数据类型

Boolean|公共汽车|double|enumerated|fixed point|integer|单身的|细绳

Direct Feedthrough

no

Multidimensional Signals

是的

可变大小信号

no

Zero-Crossing Detection

no

扩展功能

版本历史记录

在R2016a中引入

也可以看看

|