AnyLogic
Expand
Font size

ResourceAttach

AnyLogic: The ResourceAttach block

The ResourceAttach block attaches the specified seized resources to the agent. The result is that they will move together with the agent (escort the agent) until they are detached or released. The resources to be attached must already be seized and located in the same node as the agent. Obviously, you cannot attach a static resource.

The attaching process takes zero time.

Attached resources are animated near the agent with a certain offset.

Parameters

Attach
Specifies which resources should be attached.
There are three options:
All compatible seized resources — all compatible (i.e. non-static) resource units are attached to the agent.
All units seized in given Seize block(s) — You specify the list of Seize blocks, and only the resources previously seized by these blocks will be attached.
Specified resources (list of pools) — You specify the list of ResourcePool objects, and only the specified resource units will be detached. One unit will be attached per pool name, so if you wish to attach two or more units of the same pool, you should list that pool twice, e.g.: doctors, nurses, nurses.
Syntax: ResourceAttach.AttachMode attachMode
Set new value dynamically: set_attachMode(new value)
Valid values:
ResourceAttach.ALL — All attached resources
ResourceAttach.ALL_FROM_SEIZES — All attached units seized in given Seize block(s)
ResourceAttach.SPECIFIED_RESOURCES — Specified resources (list of pools)
Seize blocks
[Visible if Attach: All units seized in given Seize block(s)]
List of Seize blocks. Only the resources previously seized by these blocks will be attached.
Syntax: Seize[] seizeBlocks
Set new value dynamically: set_seizeBlocks(new value)
Resource Pool objects
[Visible if Attach: Specified resources (list of pools)]
List of ResourcePool blocks whose units are being attached. One unit will be attached per pool name, so if you wish to release two or more units of the same pool, you should list that pool twice, e.g. doctors, nurses, nurses.
Type of value: ResourcePool[]
Local variable: agent — the agent

Actions

On enter
Code executed when the agent enters the block.
Local variable: agent — the agent
On exit
Code executed when the agent exits the block.
Local variable: agent — the agent

Ports

in
The input port.
out
The output port.
How can we improve this article?