主要内容

资源池

池实体资源

  • 库:
  • SimEvents /实体管理

    SimEvents

  • 资源池块

描述

资源池块定义实体在模型模拟过程中可以使用的资源。使用资源收购方而且资源发布人块来处理这些资源。

用指定数量的可用资源初始化块。然后:

  • Use one or more资源收购方blocks to reserve those resources.

  • 使用一个资源发布人块将资源返回给此块以供将来使用。

You can determine the visibility of available resources in a model hierarchy.你可以选择全球作用域resources in the pool.

  • 全球-资源可以从模型层次结构中的任何位置引用。

  • 作用域— Resources are locally visible and can be referenced only from the subsystem that contains the资源池块和里面的所有子系统。

港口

输入

全部展开

Input entity port for changing resource amount.The input cannot be a negative value.

依赖关系

要启用此端口,请选择Change amount through control port随着资源源量

数据类型:||int8|int16|int32|int64|uint8|uint16|uint32|uint64|布尔|不动点

输出

全部展开

Number of resources that are in use.

依赖关系

若要启用此端口,请单击统计数据选项卡并选择标签框Amount in use, u

数据类型:

Average wait time the pool is utilized.

依赖关系

若要启用此端口,请单击统计数据选项卡并选择标签框平均利用率、实效

数据类型:

可用资源的数量。

依赖关系

若要启用此端口,请单击统计数据选项卡并选择标签框量,效果

数据类型:

参数

全部展开

输入实体资源名称。

编程使用

块参数ResourceName
类型:特征向量
“Resource1”|特征向量
默认的“Resource1”

选择资源使用的粒度。

  • 离散单元— Use whole number increment.

  • 零金额-使用分数增量。

编程使用

块参数ResourceGranularity
类型:特征向量
离散单元的|“零金额”
默认的离散单元的

  • Select this check box to allow this resource to return to the resource pool upon release.An example of such a resource is a table in a restaurant, which is available for reuse when a customer leaves.

  • Clear this check box to prevent this resource from returning to the resource pool upon release.In this case, when the resource is released, it is no longer available in the resource pool.An example of such a resource is food in a restaurant, which is not reusable upon consumption.

编程使用

块参数ReusableUponRelease
类型:特征向量
“上”|“关闭”
默认的“关闭”

Select resource amount source.

  • 对话框

  • Change amount through control port

    Select this option to enable an input entity port and a variable capacity resource.The payload of the arriving message increments the existing number of resources for the block.For example, if the resource pool has five resources, and a message with a payload of three arrives at the input port, the block has eight resources available.The number of resources cannot decrement.

编程使用

块参数ResourceAmountSource
类型:特征向量
“对话框”|'Change amount through control port'
默认的“对话框”

Enter amount of resource.

依赖关系

选择对话框要启用资源源量

编程使用

块参数ResourceAmount
类型:特征向量
“十”|标量
默认的“十”

Enter initial amount of resource.

依赖关系

选择Change amount through control port要启用资源源量

编程使用

块参数InitialResourceAmount
类型:特征向量
“十”|标量
默认的“十”

Choose the behavior of the resources acquired from this pool as全球作用域

全球选择:

  • Resource pool names must be unique in the model.

  • 所有资源都具有全局作用域,并且可以从模型层次结构中的任何位置引用它们。

  • An entity carrying a resource acquired from this block, must explicitly relinquish the resource.

  • When an entity is destroyed, the resources that are associated with it are returned to the pool, if the可重用在释放check box is selected.

作用域选择:

  • Resources are locally visible and can be referenced only from the subsystem that contains the资源池块和里面的所有子系统。

  • Resource pool names must be unique within the model hierarchy where the资源池块是可见的。

  • An entity carrying the resource acquired from this block, must explicitly relinquish the resource.

  • 当一个实体离开作用域时,该作用域本地且尚未释放的任何资源将被自动释放。如果可重用在释放复选框,则将它们返回到池。

编程使用

块参数InitialResourceAmount
类型:特征向量
“十”|标量
默认的“十”

Outputs the amount of resources that the block has acquired and has not yet released.For example, if the resource pool has10resources, and the entity acquires all of them, this port shows10.当块释放资源时,显示此端口0

编程使用

块参数AmountInUse
类型:特征向量
“上”|“关闭”
默认的“关闭”

Outputs the average resource utilization.

编程使用

块参数AverageUtilization
类型:特征向量
“上”|“关闭”
默认的“关闭”

Outputs the amount of resources available.

编程使用

块参数AmountAvailable
类型:特征向量
“上”|“关闭”
默认的“关闭”

版本历史

介绍了R2016a

Baidu
map