Main Content

resourceReleased

Class:matlab.DiscreteEventSystem
Package:matlab

Event action upon successful resource release

Since R2019a

Syntax

[entity,event,out1,...] = resourceReleased(obj,storage,entity,resources,tag,in1,...)

Description

[entity,event,out1,...] = resourceReleased(obj,storage,entity,resources,tag,in1,...)specifies event actions for a discrete-event System object™ upon successful resource release.

Input Arguments

expand all

Discrete-event System object.

Index of the storage element.

实体releasing the resource. Entity has these fields:

  • sys(MATLABstructure) consisting of:

    • id(double) — Entity ID

    • priority(double) — Entity priority

  • data— Entity data

An array of structures that specifies the resources that have been released.

Tag of the currently executing resource release event.

First data input.

Output Arguments

expand all

实体releasing the resource.

Events to be scheduled. Usematlab.DiscreteEventSystemclass 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(MATLABstructure) — Source or destination location of entity (seesource)

第一个数据输出。

Examples

expand all

Suppose that an entity releases resources successfully with a scheduledeventReleaseResourcemethod and the tag of this event isMyResourceAcquireEvent. The successful release of the resources invokes theresourceReleasedmethod to forward the entity to the output.

function[entity,events] = entry(obj, storage, entity, source)% On entry, release one resource of type Resource1.resRequest = obj.resourceSpecification('Resource1', 1); events = obj.eventReleaseResource(resRequest,'MyResourceAcquireEvent');endfunction[entity,events] = resourceReleased(obj, storage,...entity, resources, tag)% After resource release, forward the entity to the output.events = obj.eventForward('output', storage, 0.0);end

他的版本tory

Introduced in R2019a