Main Content

modified

Class: matlab.DiscreteEventSystem
Package: matlab

Event action upon entity modification by the Entity Find block

Syntax

[events] = modified(obj,storage,entity)
[events, out1, ...] = modified(obj,storage,entity,in1,...)

Description

[events] = modified(obj,storage,entity) specifies event actions of the object after an entity is modified.

[events, out1, ...] = modified(obj,storage,entity,in1,...) specifies event actions of the object when the block has one or more input signal ports and/or signal output ports.

Input Arguments

expand all

Discrete-event System object.

Index of the storage element where the entity is being modified.

Entity that is being modified. Entity has these fields:

  • sys (MATLAB structure) — It has these fields:

    • id (double) — Entity ID

    • priority (double) — Entity priority

  • data — Entity data

Any data inputs of the object. These input arguments exist only when the object has data inputs.

Output Arguments

expand all

Events to be scheduled after the method returns. Use matlab.DiscreteEventSystem class methods to create events. Each event has these fields:

  • type (character vector) — Type of the event

  • delay (double) — Delay before the event

  • priority (double) — Priority of the event

  • Storage (double) — Index of the storage element

  • tag (character vector) — Event tag

  • location (MATLAB structure) — Source or destination location of entity

Data outputs of the object. You must specify these output arguments when the object has data outputs.

Examples

expand all

Specify event action to be performed after entity modification in a storage

function events = modified(obj,storage,entity)
    events = [];
    % If the delay attribute of the entity exceeds 100, destroy the entity
    if entity.data.delay > 100
    events = obj.destroy();
    end
end
   
Introduced in R2018b