resourceSpecification
Class: matlab.DiscreteEventSystem
Namespace: matlab
Create specifications for a resource acquisition or a resource release event
Syntax
resRequest = resourceSpecification(resource,amount)
Description
specifies the names and the amount of the resources for the
resRequest
= resourceSpecification(resource
,amount
)eventAcquireResource
or the eventReleaseResource
requests.
For example, this code specifies one unit of Resource1
and two units of
Resource2
.
resRequest = obj.resourceSpecification('Resource1', 1); resRequest = [resReq obj.resourceSpecification('Resource2', 2)];
If you specify an amount for the eventReleaseResource
larger than the
amount that was acquired earlier, all the previously acquired resources are released.
For example, suppose that an entity previously acquired three resources of type
Resource1
and four resources of type Resource2
. This
code specifies the amounts for eventReleaseResource
.
resRequest = obj.resourceSpecification('Resource1', 2); resRequest = [resReq obj.resourceSpecification('Resource2', 5)]; event = eventReleaseResource(resReq, ‘relinquish’);
After the release, the entity has one resource of type Resource1
and
zero resources of type Resource2
.
You can specify the release of all previously acquired resources by using eventReleaseAllResources
.
Input Arguments
Output Arguments
Examples
Version History
Introduced in R2019a