Event action upon successful resource release
[entity,event,out1,...] = resourceReleased(obj,storage,entity,resources,tag,in1,...)
obj— Discrete-event System object
Discrete-event System object.
Index of the storage element.
Entity releasing the resource. Entity has these fields:
structure) consisting of:
double) — Entity ID
double) — Entity
data — Entity data
resources— Released resources
An array of structures that specifies the resources that have been released.
tag— Tag of the resource release event
Tag of the currently executing resource release event.
in1— First data input
First data input.
Entity releasing the resource.
Events to be scheduled. Use
matlab.DiscreteEventSystem class methods to create events. Each event has
character vector) — Type of the
double) — Delay before the
double) — Priority of the
double) — Index of the storage
character vector) — Event
structure) — Source or destination location of entity (see
out1— First data output
First data output.
Suppose that an entity releases resources successfully with a
eventReleaseResource method and the tag of this event is
MyResourceAcquireEvent. The successful release of the resources
resourceReleased method to forward the entity to the
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'); end function [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