ResourceSendTo


Sends (moves) resources from their current location(s) to a new location. Only moving resources or portable resources escorted by moving resources can be sent. The resource units sent by this block may be at different locations, but at each location there must be at least one moving resource. The agent will exit this block once the last unit arrives at the destination location, therefore the time spent by the agent in this block equals the longest travel time of the unit being sent. The speed of each group of units sent together equals the speed of the slowest moving resource in that group.

The resource units will be animated moving along the (shortest) paths from their origin to the destination. The agent will be animated as staying in its current location (at a random position inside the current network node).

Parameters

Resources to send [dynamic]
List of names of ResourcePool blocks whose units are being sent. One unit will be sent per pool name, so if you wish to send two or more units of the same pool, you should list that pool twice, e.g. { doctors, nurses, nurses }.
Value type: ResourcePool[]
Local variable: agent - the agent.
Destination is
Defines where the resources will be sent: The resources can be sent to:
Network node
- resources are sent to the specified network node.
Attractor
- resources are sent to the specified attractor.
Agent - resources are sent to the current agent location.
Other seized resource unit - resources are sent to the current location of another seized resource (specified below in the Resource field).
Home of seized resource unit - resources are sent to the home location of the seized resource unit.
Get value: destinationType
Default value: ResourceSendTo.DEST_NODE - Network node
Valid values: ResourceSendTo.DEST_NODE
ResourceSendTo.DEST_ATTRACTOR
ResourceSendTo.DEST_ENTITY
ResourceSendTo.DEST_RESOURCE
ResourceSendTo.DEST_RESOURCE_HOME
Node [dynamic]
[Visible if Destination is the Network node] Network node where the seized resources will be sent.
Value type: Node
Local variables: agent - the agent
Agent unit - the resource unit
Attractor [dynamic]
[Visible if Destination is Attractor] Attractor where the seized resources will be sent.
Value type: Attractor
Local variables: agent - the agent
Agent unit - the resource unit
Resource [dynamic]
[Visible if Destination is Other seized resource unit] The name of the resource pool of the unit to whose location the agent will move. If several units of the same pool are seized, the first in the list will be chosen.
Value type: ResourcePool
Local variables: agent - the agent
Agent unit - the resource unit
Actions
On enter [code]
Code executed when the agent enters the block.
Local variable: agent - the agent
On exit [code]
Code executed when the agent exits the block.
Local variable: agent - the agent

Functions

int size() - returns the number of agents (waiting for their resource units to arrive at their destinations) in this block.

Ports

in
The input port.
out
The output port.