Font size


Defines the start of the flowchart branch modeling the task for seized resource units (usually it is a resource preparation process). The preparation task’s flowchart branch starts with ResourceTaskStart block and ends at the lower port of the Seize block that has seized the resource(s). The agent will proceed to the blocks following the Seize block only when the preparation task will be finished.


Demo model: Emergency Department Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).

In the given demo model you can find examples of the preparation and wrap-up tasks. You will find them in the custom USoundProcess agent type, which defines the process of ultrasound examination. For the ultrasound examination, an ultrasound device has to be brought by an ultrasound technician. If you take a look at the flowchart, you will see that patient seizes a technician (in the seizeTech block). When this happens, the resource preparation process starts, since this block has a connection to a flowchart branch via its lower port. The resource preparation flowchart always starts with the ResourceTaskStart block. There we specify the particular resource we define this subprocess for (here it is technician). Here the preparation subprocess consists of the seizeUSound block (seizes the ultrasound device), takeUSound MoveTo block (technician moves to the seized device) and attachUSound ResourceAttach block (attaches the ultrasound device resource to the technician resource). The preparation subprocess ends when the connector goes into the lower port of the Seize block that initiated this task. Since this Seize block has the Send seized resources option selected, the technician will finally bring the ultrasound device to the patient that requested it.

After the examination (the Delay block doUSound), the releaseTechUSound Release block follows. It releases the specified resource (technician) and starts the wrap-up subprocess (since another flowchart branch is connected to its lower port). The technician moves to the home node of the seized usound (block moveTo) and releases this seized resource upon arrival (block release). The wrap-up process always ends with the ResourceTaskEnd block.


Unit type
The type of resource units performing the task. This resource type is referred to below as T.
Default value: Agent
Start here
Here you specify whether all the resource units will start the task, or only some specific ones.
All the resources — all the resources seized by the Seize block that initiated this task, start performing this task.
Specific resources — only some particular resources from the seized set, start this task.
Syntax: boolean defaultUnitsStart
Default value: all the resources (true)
Resource pool
[Visible if Start here is defined as Specific resources]
The specific ResourcePool block that contains the resource units that will start this task.
Type of value: ResourcePool


On enter
Code executed when the resource unit enters this ResourceTaskStart block.
Local variable: T unit — the resource unit.
On remove
Code executed when the resource unit is intentionally removed from this block by calling the unit’s function remove(). This code is automatically executed after the remove() function call.
Local variable: T unit — the resource unit.


Function Description
int size() Returns the number of units currently pending transfer in this block (that haven’t yet been accepted by subsequent flowchart blocks).
long count() Returns the number of resource units entered this flowchart block.
void take(T unit) Inserts the given resource unit into the process flow by sending it to output it via the out port.

unit — The unit to insert.
Iterator<T> iterator() Returns the iterator over the resource units currently pending transfer in this block (that have not yet been accepted by subsequent flowchart blocks), in their take() order.


The output port.
How can we improve this article?