AnyLogic AnyLogic
Expand
Font size

Unbatch

Extracts all agents contained in the incoming agent (batch) and outputs them through the output port. The original agent (batch) is discarded. The operation takes zero time.

All contents of the incoming agent is extracted regardless of the way it was created: using Batch, Pickup, or programmatically by calling addEntityToContents().

A permanent batch created by the Batch block does not contain any agents, so it will simply be consumed by this block without any output.

Parameters

Batch type
The type of the batch agents entering this block.
Default value: Agent
Local variable: TBatch batch — the batch agent
Element type
The type of the agents that are extracted from the incoming agent and exit this block.
Default value: Agent
Local variable: TBatch batch — the batch agent
Elements appear in batch location
If selected, the unbatched agents will appear in the same location as the batch.
Syntax: boolean sameAsBatchLocation
Set new value at runtime: set_sameAsBatchLocation(new value)
New location
The new location of the unbatched agents. There are several available options:
Network/GIS node - Agents are placed in the given network node, GIS point, or GIS region.
Attractor - Agents are placed in the specified attractor.
(x, y, z) - Agents are placed in the point with the specified coordinates X, Y, Z.
(latitude, longitude) - Agents are placed in the given point on the GIS map with the specified Latitude and Longitude.
Geographic place - Agents are placed in the particular location on the GIS map. You define this place using the Name of place parameter below.
Syntax: InitialLocationType locationType
Node
[Visible if New location: Network / GIS node] Network node, GIS point, or GIS region where the unbatched agents are placed.
Type of value: INode
Local variable: T agent - the agent
Attractor
[Visible if New location: Attractor] Attractor where the unbatched agents are placed.
Type of value: Attractor
Local variable: T agent - the agent
X, Y, Z
[Visible if New location: (x, y, z)] X, Y, Z coordinates of the point where the unbatched agents will be placed.
Type of value: double
Local variable: T agent - the agent
...located in
[Visible if New location: (x, y, z)] Specifies where the unbatched agents will be added: either Level or Network.
Type of value: boolean locationXYZInNetwork
Level
[Visible if ...located in: Level] The level where the unbatched agent will be placed.
Type of value: Level
Local variable: T agent - the agent
Network
[Visible if ...located in: Network] The network where the unbatched agent will be placed.
Type of value: INetwork
Local variable: T agent - the agent
Latitude, Longitude
[Visible if New location: (latitude, longitude)] Latitude and longitude of the point on the GIS map where the unbatched agents will be placed.
Type of value: double
Local variable: T agent - the agent
Name of place
[Visible if New location: Geographic place] The name of the particular location on the GIS map, where the agents will be placed. You specify the name as text put in quotes, for example, "London". GIS map will search for a location with such name. The first location from the list of GIS search results will be used.
Type of value: String
Local variable: T agent - the agent

Advanced

Forced pushing
If the option is selected (true), when agents finish processing at the block, they are instantly pushed further regardless the state of the succeeding block. If the option is not selected, agents are not pushed, but pulled: only when the succeeding block is ready to accept one more agent, it requests the agent from this block, and only then this agent passes further.
Syntax: boolean pushProtocol
Default value: false

Actions

On enter
Code executed when the batch agent enters the block.
Local variable: TBatch batch — the batch agent
On exit
Code executed for each agent that is extracted from the batch and exits the block. The batch is still accessible here as batch.
Local variables:
T agent — the current agent extracted from the batch agent
TBatch batch — the batch agent

Ports

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