SeizeTransporter

Seizes one transporter from the specified fleet defined by the TransporterFleet block. Sends the seized transporter to the specified location.

Use the ReleaseTransporter block to release the seized transporter. All seized transporters must be released before the agent (material item) is disposed.

Demo model: SeizeTransporter and ReleaseTransporter

Parameters

Fleet [dynamic]
TransporterFleet block defining the fleet of transporters. This block will seize one transporter from this fleet.
Type of value: TransporterFleet
Local variable:  T agent - the agent
Destination is
Defines where the transporter will be sent. The transporter can be sent to:
Agent - transporter is sent to the current agent location.
Node - transporter is sent to the specified network node.
Attractor
- transporter is sent to the specified attractor.
Path - transporter is sent to the specified path.
Conveyor - transporter is sent to the specified conveyor.
Position on conveyor - transporter is sent to the specified position on conveyor.
Conveyor station - transporter is sent to the specified station.
(x, y, z) -  transporter is sent to the point with the specified coordinates.
Syntax:
 SeizeTransporter.DestinationType destinationType
Set new value at runtime: set_destinationType(new value)
Valid values: SeizeTransporter.DEST_AGENT; SeizeTransporter.DEST_NODE; SeizeTransporter.DEST_ATTRACTOR; SeizeTransporter.DEST_PATH; SeizeTransporter.DEST_CONVEYOR; SeizeTransporter.DEST_POSITION_ON_CONVEYOR; SeizeTransporter.DEST_CONVEYOR_STATIONSeizeTransporter.DEST_XYZ
Path [dynamic]
[Visible and applies only if the Destination is option is set to Path] The path the transporter will move to.
Type of value: Path
Local variables:  T agent - the agent
                          Agent transporter - the transporter
Conveyor [dynamic]
[Visible and applies only if the Destination is option is set to Conveyor] The conveyor the transporter will move to.
Type of value: ConveyorPath
Local variables:  T agent - the agent
                          Agent transporter - the transporter
Offset from [dynamic]
[Visible and applies only if the Destination is option is set to Path or Conveyor] Defines how to calculate the offset of the exact point on a path or a conveyor the transporter will move to: from The beginning of the conveyor/path, or from The end of the conveyor/path.
Type of value: boolean
Local variables:  T agent - the agent
                          Agent transporter - the transporter
Offset [dynamic]
[Visible and applies only if the Destination is option is set to Path or Conveyor] The distance from the start or end point of the path/conveyor (depends on the Offset from parameter) defining the exact destination point for the transporter.
Type of value: double
Local variables:  T agent - the agent
                          Agent transporter - the transporter
Attractor [dynamic]
[Visible and applies only if the Destination is option is set to Attractor] The attractor the transporter will move to.
Type of value: Attractor
Local variables:  T agent - the agent
                          Agent transporter - the transporter
Node [dynamic]
[Visible and applies only if the Destination is option is set to Node] The network node the transporter will move to.
Type of value: Node
Local variables:  T agent - the agent
                          Agent transporter - the transporter
Position on conveyor [dynamic]
[Visible and applies only if the Destination is option is set to Position on conveyor] The position on conveyor the transporter will move to.
Type of value: PositionOnConveyor
Local variables:  T agent - the agent
                          Agent transporter - the transporter
Conveyor station [dynamic]
[Visible and applies only if the Destination is option is set to Conveyor station] The station the transporter will move to.
Type of value: ConveyorStation
Local variables:  T agent - the agent
                          Agent transporter - the transporter
X, Y, Z [dynamic]
[Visible and applies only if the Destination is option is set to (x, y, z)] X,Y,Z coordinates of the point the seized transporter will move to.
Type of value: double
Local variables:  T agent - the agent
                          Agent transporter - the transporter
Priorities
Task priority [dynamic]
The priority of the task for the incoming agent (the larger the higher).
Type of value: double
Local variable:  T agent - the agent
Task may preempt [dynamic]
If the option is selected, this task may preempt other tasks of the requested transporter.
Type of value: boolean
Local variable:  T agent - the agent
Task preemption policy [dynamic]
Here you can choose what is done when some other task incomes for the transporter.
No preemption - the current task continues executing.
Seize any resource - the task is interrupted and tries to seize any transporter of the specified type.
Type of value:   SeizeTransporter.TransporterTaskPreemptionPolicy
Valid values:      TransporterTaskPreemptionPolicy.PP_NO_PREEMPTION
             TransporterTaskPreemptionPolicy
.PP_SEIZE_ANY_RESOURCE 
Local variable:  T agent - the agent
Advanced
Customize transporter choice
If the option is selected, you can choose the specific transporter for the operation (using the Transporter choice condition below). 
Syntax: boolean customizeTransporterChoice
Set new value at runtime: set_customizeTransporterChoice(new value)
Transporter choice condition [dynamic]
[Visible if the Customize transporter choice option is selected] Here you can specify a boolean expression that will be checked to find the specific transporter that may perform the operation. If none of the currently available transporters satisfy the specified condition (the condition returns false), the block will wait for the first transporter that matches the condition to become available. 
Usually you define some field inside the agent type (say, transport), store there the reference to the transporter when it starts working with this agent (agent.transport=transporter), and then specify here the condition agent.transport==transporter enabling only this particular transporter to continue working with this particular agent - material item.
Type of value: boolean
Local variables:  T agent - the agent
                          Agent transporter - the transporter
                          TransporterFleet fleet - the fleet
Dispatching policy
Here you specify how the block chooses a transporter to perform the agent operation. If the Customize transporter choice option is set, the transporter will be chosen from the subset returned by the algorithm in the Transporter choice condition parameter.
The possible options are:
Nearest to the agent - The nearest to the current agent transporter will be chosen.
The most preferred - The transporter will be chosen by comparing transporters to each other. The comparison algorithm should be placed in the "unit1 is preferred to unit2" parameter below.
Transporter with top rating - The transporter with the top rating will be chosen. You define the rating (or rating calculation algorithm) in the Transporter rating parameter below.
Off (chooses some matching transporter) - The dispatching policy is not applied.
Syntax: SeizeTransporter.DispatchingPolicy dispatchingPolicy
Set new value at runtime: set_dispatchingPolicy(new value)
Valid values: SeizeTransporter.DISPATCHING_POLICY_NEARESTSeizeTransporter.DISPATCHING_POLICY_BASED_ON_COMPARISONSeizeTransporter.DISPATCHING_POLICY_BASED_ON_RATING_VALUESeizeTransporter.DISPATCHING_POLICY_SOME_TRANSPORTER
"unit1 is preferred to unit2" [dynamic]
[Visible and applies only if the Dispatching policy is set to The most preferred] The comparison algorithm (or its call) that is used for choosing a transporter for the given agent. The algorithm compares transporters to each other. It should return true if the transporter unit1 has higher preference than the transporter unit2 (and false otherwise, including the case of choice equality). The algorithm should provide transitiveness.
Type of value: boolean
Local variables:  Agent unit1 - the first transporter to be compared
                           Agent unit2 - the second transporter to be compared
                           T agent - the current agent
Transporter rating [dynamic]
[Visible and applies only if the Dispatching policy is set to Transporter with top rating] The rating value of this transporter. The rating is used to choose a transporter for the given agent (the larger the higher, transporter with the top rating value will be chosen).
Type of value: double
Default value: 0
Local variables:  Agent unit - the transporter
                           T agent - the current agent
Actions
On enter [code]
Here you can type Java code that will be executed when the agent (material item) enters the block.
Local variable:  T agent - the agent
On seize transporter [code]
Here you can type Java code that will be executed when the agent (material item) seizes the transporter.
Local variables:  T agent - the agent
                          Agent unit - the transporter
On remove [code]
Here you can type Java code that will be executed when the agent (material item) is removed from the block.
Local variable:  T agent - the agent
On exit [code]
Here you can type Java code that will be executed when the agent (material item) exits the block.
Local variable:  T agent - the agent
On task suspended [code]
[Visible and applies only if the Task preemption policy option is set to Seize any resource] Callback for action executed when agent task is suspended because of the Seize any resource preemption policy, when its transporter gets grabbed by another task with a higher priority. 
Local variables:  T agent - the agent
                          Agent transporter - the transporter
On task resumed [code]
[Visible and applies only if the Task preemption policy option is set to Seize any resource] Callback for action executed when agent resumes processing after it has been suspended because of Seize any resource preemption policy.
Local variables:  T agent - the agent
                          Agent transporter - the transporter

Functions

T get(int index) - Returns the agent at a given position specified by index (counted from 0). Throws error in case of invalid (or out-of-bounds) index.

int size() - Returns the number of agents in the embedded queue.

Ports

in
The input port.
out
The output port.