AnyLogic
Expand
Font size

Dropoff

Removes the agents contained in the incoming “container” agent and outputs them via the outDropoff port. Similarly to the Pickup block that is used to add agents to the container, here agents are removed according to the given mode: all, a given number, or all satisfying the given condition. The whole operation takes zero time.

The dropoff Condition is evaluated when the agent is still in the container, but On dropoff action is executed after the agent has been removed from the container.

An example of the drop-off condition: assume the container contains agents of type Passenger with field destination and you wish to drop off those whose destination equals here. Then you should specify the type Passenger as the generic parameter Container agent type and write in the drop-off condition: agent.destination == here.

Consider also using Unbatch instead of Dropoff if you do not need to keep the container agent.

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

Parameters

Container type
The type of the container agents arriving at port in. This agent type is referred below as TContainer.
Default value: Agent
Element type
The type of the agents being dropped off. Referred below as T.
Default value: Agent
Dropoff
Defines how the agents are selected to be dropped off. You can setup this block to remove All available agents from the container, a Given quantity (if available), or remove agents for which the specified boolean condition is true (While condition is true).
Syntax: Dropoff.DropoffType dropoffType
Valid values:
Dropoff.BY_CONDITION — While condition is true
Dropoff.QUANTITY — Given quantity (if available)
Dropoff.ALL — All available agents
Condition
[Visible if Dropoff: While condition is true]
Condition evaluated for each agent in the container to determine whether it should be dropped off. The condition result may depend on the container agent as well as on the “candidate” to be dropped off.
Type of value: boolean
Local variables:
agent — the agent to be dropped off
TContainer container — the container agent
Quantity
[Visible if Dropoff: Given quantity (if available)]
Expression returning the number of agents that should be dropped off.
Type of value: int
Local variable: TContainer container — the container agent
Default value: 1

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 the agent passes further.
Syntax: boolean pushProtocol
Default value: false

Actions

On enter
Code executed when the container enters the block.
Local variable: TContainer container — the container agent
On dropoff
Code executed for each agent that is removed from the container.
Local variables:
agent — the agent being dropped off
TContainer container — the container agent
On exit
Code executed when the container exits the block.
Local variable: TContainer container — the container agent
On dropoff exit
Code executed for each agent being dropped off when it exits the block.
Local variables:
agent — the agent being dropped off
TContainer container — the container agent

Functions

Function Description
int size() Returns the number of the dropped agents waiting to be accepted by the subsequent flowchart blocks.

Ports

in
The input port.
out
The output port.
outDropoff
The output port for agents removed from the container agent.
How can we improve this article?