AnyLogic 9
Expand
Font size

FluidPickup

Lets the passing through agents pick up fluid or bulk matter. Serves as an interface block between the Process Modeling Library (on any other library based on it) and the Fluid Library. Each agent is assumed to need a certain amount of fluid to pick up, and, upon arrival of the agent at the block, the block starts accumulating the fluid. The amount can be specified explicitly and may depend on the agent (pickup by amount mode), or pick up can be executed by batch. In the latter case, the agent is released once the block has accumulated a non-zero amount of fluid of one batch and the new different batch shows up. The block does not modify the agent anyhow, it is up to you to implement how the fluid picked up affects the agent.

Similarly to FluidDispose , this block can accept flow at any rate. When there is no agent in the block, the block contains no fluid and the fluid is not allowed to flow in. FluidPickup may contain only one agent at a time, and the next agent will not be let in until the current agent has left the block.

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

Parameters

Pickup
Defines the fluid pickup mode:
Amount of fluid — the agent picks up the specified amount of fluid.
By batch — the agent picks up any non-empty batch (the agent is released when the new batch shows up at this block).
Syntax: boolean pickupByAmount
Set new value at runtime: set_pickupByAmount(new value)
Valid values:
true — Amount of fluid
false — By batch
Fluid to pickup
[Visible and applies only if the Amount of fluid option is set]
Determines the amount of fluid to be picked up by the agent. This is a dynamic parameter re-evaluated upon arrival of each agent.
Value type: double
Local variable: Agent agent — the agent
Agent location
Space markup shape where the agent that currently is in the internal Delay block is animated.
Get value: agentLocation
Set new value at runtime: set_agentLocation(new value)

Animation

Storage tank
Here you can specify the name of Storage tank space markup shape used to animate FluidPickup (both in 2D and 3D animation). The storage tank animates the fluid the block currently contains.
Syntax: StorageTank storageTank
Show batches in flowchart
If set, the block icon will display the current batch color.
Syntax: boolean showBatchesInFlowchart
Set new value at runtime: set_showBatchesInFlowchart(new value)

Actions

On enter
Action executed upon arrival of the agent at the block, before Fluid to pickup is evaluated and the block starts accepting the fluid.
Local variable: Agent agent — the agent
On exit
Action executed when an agent has picked up the fluid and leaves the block. You can access the agent, the amount picked up, and the batch.
Local variables:
Agent agent — the agent
double amount — the amount
Object batch — the batch
On rate change
Action executed when the flow rate changes.
Changing something in the action may result in another immediate rate change and immediately following another call of On rate change, so the user can possibly create a livelock.
Local variable: double inrate — the current input rate

Functions

Fluid amount
Function Description
double amountPassed() Returns the total amount of fluid passed through the inFluid port of the block since the start of the simulation.
double amountPassed(AmountUnits units) Returns the total amount of fluid (in given units) passed through the inFluid port of the block since the start of the simulation.
double amount() Returns the amount of fluid currently accumulated in the block. This amount is less than the total amount of fluid required to release an agent.
double amount(AmountUnits units) Returns the amount of fluid (in given units) currently accumulated in the block. This amount is less than the total amount of fluid required to release an agent.
Flow rate
Function Description
double currentRate() Returns the current flow rate of fluid that comes in.
double currentRate(FlowRateUnits units) Returns the current flow rate (in given units) of fluid that comes in.
Batch
Function Description
Object getBatch() Returns the batch currently flowing into the block.
Resetting statistics
Function Description
void resetStats() Resets statistics collected for this block, including the statistics collected for its ports.

Ports

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