Main Content

Create a Discrete-Event System Object

MATLAB离散事件系统块允许您撰写自定义离散事件系统对象™并将其在simevents中使用®models. To author event-driven entity-flow systems, the block uses discrete-event System object with thematlab.discreteeventsystem班级,继承和扩展matlab.System班级。

Methods

matlab.discreteeventsystem类提供可让您与离散事件系统的这些元素一起工作的方法:

  • 定义对象实体类型,端口和存储的属性

  • 事件初始化

  • 对象的运行时行为

    • blocked— Event action when entity forward fails

    • 破坏- 对实体破坏的事件行动

    • entry— Event action when entity enters storage element

    • 出口- 实体退出存储之前的事件动作

    • 产生— Event action upon entity creation

    • 迭代- 实体迭代时事件动作

    • modified- 实体对实体修改的事件动作查找块

    • 资源- 在成功获取资源时指定事件动作。

    • Resourscereled- 在成功发行资源时指定事件操作。

    • Testentry— Event action to accept or refuse entity

    • timer— Event action when timer completes

While implementing these methods, define entity type, entity storage, create, schedule, and cancel events. Use these functions:

继承的方法来自matlab.System班级

继承matlab.discreteeventsystemclass also inherits a subset of thematlab.System类方法。

Getheaderimpl

系统对象显示标题

getPropertyGroupsImpl

系统对象显示的属性组

isInactivePropertyImpl

Inactive property status

validatePropertiesImpl

验证属性值

ProcessTunedPropertiesImpl

可调属性发生变化时的动作

getNumInputsImpl

步骤方法的输入数量

getInputNamesImpl

系统块输入端口的名称

getNumOutputsImpl

Number of outputs from step method

GetOutputnamesimpl

系统块输出端口的名称

getDiscreteStateImpl

离散状态属性值

SetupImpl

初始化系统对象

重置

重置系统对象状态

ReleaseImpl

释放资源

loadObjectImpl

从垫子文件加载系统对象

saveObjectImpl

Save System object in MAT file

infoImpl

有关系统对象的信息

getOutputSizeImpl

输出端口的尺寸

getOutputDataTypeImpl

Data types of output ports

isOutputComplexImpl

输出端口的复杂性

getDiscretestatesPecificationImpl

离散的状态大小,数据类型和复杂性

geticonimpl

名称显示为块图标

getSampleTime

Query sample time

有关这些方法的更多信息,请参见自定义simulink的系统对象金宝app

参考和提取实体

  1. When referencing entity attributes or system properties in a discrete-event System object, use these formats:

    Attribute or Property Format 使用权

    属性

    entity.data。属性_name

    Read/write

    priority property

    entity.sys.priority

    Read/write

    ID属性

    entity.sys.id

    只读

  2. If an entity that is a part of aMATLAB离散事件系统block is requested for extraction, the出口块的方法是触发的。当。。。的时候出口方法称为目的地参数设置为提炼。Seemodifiedfor entity modification.

也可以看看

|

Related Topics