TransporterFleet

Defines a fleet of transporters that can be seized and released by agents (material items) using SeizeTransporter and ReleaseTransporter flowchart blocks of the Material Handling Library.

An example of a transporter is an AGV (automated guided vehicle).

Transporters have their home locations where they can optionally return. The transporters in one fleet can have individual properties, can be animated, collect unit-based statistics, etc.

Transporters move along network paths. By default transporters take the shortest route. If needed, you can manage the routing by yourself - select the Custom routing option and provide the block with the route selection algorithm in the Find path parameter.

Parameters

Capacity
The number of transporters in this fleet. This number must not exceed the number of attractors (if any) placed at the home location.
Syntax: int capacity
Set new value at runtime: set_capacity(new value)
Home locations
The location transporters are based at and may return to when released. Home location can be defined by a Rectangular Node, a Polygonal Node or a Point Node. The rectangular and polygonal nodes can contain Attractors, serving as specific spots for transporters. The number of attractors you place within the nodes defines the maximum number of transporters they can accept. Empty rectangular and polygonal nodes may accept unlimited number of transporters. Point Node may contain one transporter only.
Syntax: AreaNode[] homeNodes
Set new value at runtime: set_homeNodes(new value)
Min distance to obstacle
Here you can define how close a transporter of this fleet can get to other transporter (of this and other fleets) on its way. 
Syntax: double minDistanceToObstacle
Set new value at runtime: set_minDistanceToObstacle(new value)
Default value: 1 meter
Transporter
New transporter [dynamic]
Specify here the type of the transporters in this fleet.
Type of value: Agent
Set dimensions [dynamic]
If selected, you can alter the dimensions (length, width, height) of the transporters in this fleet.
Type of value: boolean
Local variable:  unit - the transporter
Length [dynamic]
[Visible and applies only if the Set dimensions option is set] The length of the transporter.
Type of value: double
Local variable:  unit - the just created transporter
Width [dynamic]
[Visible and applies only if the Set dimensions option is set] The width of the transporter.
Type of value: double
Local variable:  unit - the just created transporter
Height [dynamic]
[Visible and applies only if the Set dimensions option is set] The height of the transporter.
Type of value: double
Local variable:  unit - the just created transporter
Maximum speed [dynamic]
The maximum speed of the transporter.
Type of value: double
Local variable:  unit - the just created transporter
Acceleration [dynamic]
The acceleration of the transporter.
Type of value: double
Local variable:  unit - the just created transporter
Deceleration [dynamic]
The deceleration of the transporter.
Type of value: double
Local variable:  unit - the just created transporter
Advanced
Custom routing
By default transporters take the shortest route. Select this option to define a custom route for transporters (in the Find path field below). 
Syntax: boolean customRouting
Set new value at runtime: set_customRouting(new value)
Find path [dynamic]
[Visible and applies only if the Custom routing option is set] Specify here a call of the function implementing algorithm of custom path creation. The function should return the List instance. The paths in the list must be specified in the correct sequence: the first path leading from the source location, the second path, ... , the final path leading to the target location.
Type of value: List<Path>
Local variables:  unit - the transporter
             Agent agent - the current agent (material item)
                          ILocation source - the source location
                          ILocation target - the target location
Add transporters to
Here you specify whether the transporters created by this block will be stored in the default population of top-level agent, or in some custom population (specified below in the Population property).
Syntax: boolean addToCustomPopulation
Default value: Default population (false)
Population [dynamic]
[Visible if Add transporters to is set to Custom population] The name of the agent population where the transporters created by this block will be stored.
Value type: AgentList
Local variable: T unit - the transporter
Actions
On new transporter [code]
Here you can type Java code to be executed when new transporter is generated (it can be used for additional setup).
Local variable:  unit - the just created transporter
On seize [code]
Here you can type Java code to be executed when a transporter is seized.
Local variables:  unit - the transporter that is seized
                          Agent agent - the agent seizing the transporter
On release [code]
Here you can type Java code to be executed when a transporter is released.
Local variables:  unit - the transporter that is released
                          Agent agent - the agent releasing the transporter
On transporter state changed [code]
Code executed when a transporter state changes.
Local variablesunit - the transporter that changed its state
                         TransporterState state - the state of the transporter, which can be:
                         TransporterState.DELIVERING, TransporterState.GOING_TO_AGENT, TransporterState.GOING_HOME, TransporterState.IDLE, TransporterState.PROCESSING
On enter path [code]
Here you can type Java code to be executed when a transporter enters a path.
Local variables:  unit - the transporter that enters the path
                          Path path - the path the transporter enters
On exit path [code]
Here you can type Java code to be executed when a transporter exits a path.
Local variables:  unit - the transporter that exits the path
                          Path path - the path the transporter exits
On enter node [code]
Here you can type Java code to be executed when a transporter enters a node.
Local variables:  unit - the transporter that enters the node
                          Node node - the node the transporter enters
On exit node [code]
Here you can type Java code to be executed when a transporter exits a node.
Local variables:  unit - the transporter that exits the node
                          Node node - the node the transporter exits

Functions

double utilization() - Returns utilization of this transportation fleet. The returned value is the mean over all individual unit utilization, calculated from the most recent resetStats() call up to current time. 

int numberOfIdle()- Returns the number of currently idle transporters.

int numberOfBusy() - Returns the number of busy transporters.

boolean containsTransporter(Agent unit) - Checks whether the transportation fleet contains the specified transporter (Returns true, if yes; false otherwise).

int size() - Returns the total number of transporters in this transporter fleet.

void resetStats() - Resets the statistics collected for this block.

Collection<ResourceRequest> getRequests() - Returns the current queue of requests for transporters of this transporter fleet, ordered by their priority.
This list is unmodifiable.