AnyLogic
Expand
Font size

ResourceDetach

AnyLogic: The ResourceDetach block

The ResourceDetach block detaches the previously seized and attached resources from the agent. The detached resource units are still owned by the agent, but will not follow the agent when it moves.

The detach operation takes zero time.

If the resources are released, they are automatically detached and you do not need to use this block in that case.

Parameters

Detach
Specifies which resources should be detached:
All attached resources — All the currently attached resources will be detached.
All attached 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 detached.
Specified resources (list of pools) — You specify the list of ResourcePool blocks, and only the resources previously attached by these blocks will be detached.
Syntax: ResourceDetach.DetachMode detachMode
Set new value at runtime: set_detachMode(new value)
Valid values:
ResourceDetach.ALL — All attached resources
ResourceDetach.ALL_FROM_SEIZES — All attached units seized in given Seize block(s)
ResourceDetach.SPECIFIED_RESOURCES — Specified resources (list of pools)
Seize blocks
[Visible if Detach: All attached units seized in given Seize block(s)]
List of Seize blocks. Only the resources previously seized by these blocks will be detached.
Syntax: Seize[] seizeBlocks
Set new value dynamically: set_seizeBlocks(new value)
ResourcePool blocks
[Visible if Detach: Specified resources (list of pools)]
List of ResourcePool blocks. Only the resources previously attached by these blocks will be detached. One unit will be detached per pool name, so if you wish to detach 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?