队列,,,,实体队列
Enqueue messages and entities
- 图书馆:
Simulink / Messages & Events
SimEvents
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
port_1
-Input entity or message
标量|vector | matrix
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
输出
port_1
-输出entity or message
标量|vector | matrix
输出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
port_d
- 离开该街区的实体数量
标量
Number of entities that have departed the block.
依赖性
To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框Number of entities departed, d。
数据类型:double
port_n
-Number of entities that have not yet departed the block
标量
Number of entities that have not yet departed the block.
依赖性
To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框块中的实体数量。
数据类型:double
port_w
- 街区实体的平均等待时间
标量
一个verage wait time for entities in the block.
依赖性
To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框一个verage wait, w。
数据类型:double
port_l
- 实体队列的平均长度
标量
port_l输出队列的平均长度的实体。
依赖性
To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框一个verage queue length, l。
数据类型:double
port_ex
-Number of entities extracted
标量
Number of entities that are pulled out of this block.
依赖性
To enable this port, select如果队列已满,则覆盖最古老的元素check box, and click the统计数据选项卡并选择标记的框提取的实体数量,ex。
数据类型:double
参数
如果队列已满,则覆盖最古老的元素
- 指定队列覆盖策略
ON(Simulink的默认值金宝app®)|off (default for SimEvents®)
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
-Specify the capacity of the queue
25(默认)|标量
指定队列的容量。
程序化使用
块参数:Capacity |
Type:角色向量 |
Values:'25' |标量 |
Default:'25' |
队列类型
-Choose the queue type
FIFO
(默认)|LIFO
|Priority
Choose the queue type.
FIFO
- 首先LIFO
-last-in-first-outPriority
- 按优先顺序存储元素,请参阅Serve High-Priority Customers by Sorting Entities Based on Priority(simevents)。Priority
can be selected when you clear the如果队列已满,则覆盖最古老的元素复选框。笔记
优先队列不支持金宝app
fixed point
data 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:'一个' |
Priority source
- 指定实体的哪些属性确定其优先级
PriorityAttribute
(默认)|角色向量
指定实体的哪些属性确定其优先级。
依赖性
This parameter is visible when you clear the如果队列已满,则覆盖最古老的元素复选框,设置队列类型至Priority
。
程序化使用
块参数:优先级 |
Type:角色向量 |
Values:'PriorityAttribute' |角色向量 |
Default:'PriorityAttribute' |
分类方向
-Choose the direction of sorting based on priority
一个scending
(默认)|Descending
根据优先级选择排序方向。
一个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' |
Entity arrival source
- 选择实体的到达来源
输入端口
(默认)|多播
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:“输入端口” |
事件动作
- 在某些事件中指定实体的行为
入口
(默认)|Exit
|阻止
在某些事件中指定实体的行为。定义行为事件动作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 point
data type.
依赖性
事件动作s are visible when you clear the如果队列已满,则覆盖最古老的元素复选框。
程序化使用
块参数:入口,退出,阻塞 |
Type:角色向量 |
Values:MATLAB代码 |
Default:'' |
Number of entities departed, d
-输出s the number of entities that have departed the block
off
(默认)|on
Number of entities that have departed the block.
依赖性
Number of entities departed, dis visible when you clear the如果队列已满,则覆盖最古老的元素复选框。
程序化使用
块参数:数字驱动 |
Type:角色向量 |
Values:'上' |'off' |
Default:'off' |
块中的实体数量
-输出s the number of entities present in the block, that are yet to depart
off
(默认)|on
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' |
一个verage wait, w
- 输出平均等待时间
off
(默认)|on
离开块的实体的等待时间总数除以其总数。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' |
一个verage queue length, l
- 输出实体队列的平均长度
off
(默认)|on
一个ccumulated time-weighted average queue size. The block computes this value by:
Multiplying the size of the queue by its duration to calculate time-weighted queue size
总结所有时间加权的队列大小,并在总时间内平均
有关更多信息,请参阅Interpret SimEvents Models Using Statistical Analysis(simevents)。
依赖性
一个verage queue length, lis visible when you clear the如果队列已满,则覆盖最古老的元素复选框。
程序化使用
块参数:平均水平 |
Type:角色向量 |
Values:'上' |'off' |
Default:'off' |
提取的实体数量,ex
-Number of entities extracted from this block
off
(默认)|on
输出通过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
数据类型 |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
可变大小信号 |
|
Zero-Crossing Detection |
|
扩展功能
C/C++ Code Generation
使用Simulink®Coder™生成C和C ++代码。金宝app
事件动作和统计信息不支持代码生成。金宝app
版本历史记录
MATLAB Command
您单击了与此MATLAB命令相对应的链接:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。金宝app
Select a Web Site
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
一个mericas
- 一个mérica Latina(Español)
- Canada(English)
- United States(English)