Documentation

Resource Acquirer

Acquire entity resources

Library

Resources

Description

This block acquires the use of resources for a passing entity. You can specify that the block acquire certain resource types.

Initialize the block with specified amount of available resources. Then:

  • Use one or more Resource Acquirer blocks to reserve the use of those resources.

  • Use a Resource Releaser block to return resources back to this block for future use.

Resources are visible to the current subsystem and its children. Resource are not visible to parent subsystems.

Parameters

Maximum number of waiting entities

Enter the maximum number of entities that can wait for a resource.

Event actions

Specify the behavior of the entity on certain events. Define the behavior in the Event action parameter. For example, the Entry action is called when an entity is generated.

Event actions

Define the behavior for the event action specified in Event actions.

Number of entities departed, d

Outputs the number of entities that have departed the block.

Number of entities in block, n

Outputs the number of entities present in the block.

Average wait, w

Outputs the average wait time for entities in the block.

Available Resources

Use the Available Resources controls to:

  • Select the resources from the resources defined in all the Resource Pool blocks in the model.

  • Add the resources to the Selected Resources table, where you can configure resource acquisition details.

The list displays all the available resources in the model. (If there are no resources, the Available Attributes list is empty.)

If the resource list is long, you can type the resource name in the text box to filter the list.

Use the buttons in the Available Resources section to help build the resources table. The buttons perform these actions.

ButtonAction

Refresh the Available Resources list. The list updates with any upstream model changes you make while the block dialog box is open.

Add the selected resources to the Selected Resources table.

Move the selected resource from the Selected Resources table to the Available Resources list.

Note

If the selected resource is one you added manually, this button appears dimmed.

The message area below the available resources list displays additional messages about the resources, as they apply.

MessageMeaning

> Resource already selected

You have already added the resource to the Selected Resources table. You cannot add the resource to the table again.

Selected Resources

Use the controls under Selected Resources to build and manage the list of resources to attach to the entity. Each resource appears as a row in a table.

Using these controls, you can:

  • Add a resource manually.

  • Modify a resource that you added to the table from the Available Resources list to attach to the entity.

The buttons under Selected Resources perform these actions:

ButtonActionNotes

Add a template resource to the table.

Rename the resource and specify its properties.

Add a copy of the selected resource to the table to use as the basis of a new resource.

Rename the copy. Two resources cannot have the same name.

Remove the selected resource from the Selected Resources table.

When you delete a resource this way, no confirmation appears and you cannot undo the operation.

Move the selected resource up in order in the Selected Resources table.

N/A

Move the selected resource down in order in the Selected Resources table.

N/A

Note

If you delete a row and apply the change, the deletion can affect signal output ports corresponding to other attributes. For example, if the block has a signal output port A2 and you delete the attribute with a port marked A1, the block relabels A2 as A1. Verify that any signal that connects to the relabeled port is still connected as you expect.

PropertySpecifyUse

Name

The name of the resource. Each resource must have a unique name.

Double-click the existing name, and then type the new name.

Amount Source

Whether the resource amount, that an entity requests, comes from the dialog box or an attribute.

Select Dialog or Attribute. If you select Attribute, the source of the resource amount comes from the attribute of the entity. This option allows each entity to acquire varying amounts of resources. For more information, see Set Resource Amount with Attributes

Amount

The value to assign to the resource (when the resource comes from the dialog box).

Double-click the value, and then type the value you want to assign.

This value is the number of resources acquired per entity. For example, if Amount is 3, each entity that arrives at the Release Acquire must wait to acquire 3 resources before departing the block.

Introduced in R2016a

Was this topic helpful?