MoveByCrane

This block performs transportation of an agent (material item) by a crane.

When describing the crane's operation, the two major parameters are speed and time. The crane operation speed is usually defined by the movement speed of the crane's individual parts, such as jib, hoisting winch and trolley. You can specify these values from the corresponding Crane space markup element and the system will automatically calculate the time it takes the crane to move an agent from one point to another. In case where this level of detail is excessive or the data available to you are incomplete, you can simply select option Use operation time in the block's Properties view and specify the time directly.

You can set the safe height for agent transportation to satisfy the conditions of the environment you are modeling.

The default pattern in which this block selects agents for transportation is based on FIFO rule (first-in, first-out). You can customize the selection pattern to fit your simulation requirements.

Demo model: MoveByCrane

Parameters

Crane [dynamic]
The crane that moves the agent (material item).
Type of value: Crane
Local variable:  Agent agent - the agent (material item).
Destination is
Defines where the crane will take the agent to. The possible destinations are:
Node
- agent is moved to the specified network node.
Attractor - agent is moved to the specified attractor.
Conveyor - agent is moved to the specified conveyor.
Position on conveyor - agent is moved to the specified position on conveyor.
(x, y, z) - agent is moved to the point with the specified coordinates.
Agent - agent is moved to the specified Agent.
Syntax: DestinationType destinationType
Set new value at runtime: set_destinationType(new value)
Valid values: MoveByCrane.DEST_NODE; MoveByCrane.DEST_ATTRACTORMoveByCrane.DEST_CONVEYORMoveByCrane.DEST_POSITION_ON_CONVEYORMoveByCrane.DEST_XYZMoveByCrane.DEST_AGENT
Node [dynamic]
[Visible and applies only if the Destination is option is set to Node] The network node the crane will move to.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: Node
Local variable:  T agent - the agent (material item).
Attractor [dynamic]
[Visible and applies only if the Destination is option is set to Attractor] The attractor the crane will move to.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: Attractor
Local variable:  T agent - the agent (material item).
Conveyor [dynamic]
[Visible and applies only if the Destination is option is set to Conveyor] The conveyor the crane will move to.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: ConveyorPath
Local variable:  T agent - the agent (material item).
Offset from [dynamic]
[Visible and applies only if the Destination is option is set to Conveyor] Defines how to calculate the offset of the exact point on a conveyor the crane will move to: either from the beginning of the conveyor, or from the end of the conveyor.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: boolean
Local variable:  T agent - the agent (material item).
Offset [dynamic]
[Visible and applies only if the Destination is option is set to Conveyor] The distance from the start or end point of the conveyor (depends on the Offset from parameter) defining the exact destination point for the crane.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: double
Local variable:  T agent - the agent (material item).
Position on conveyor [dynamic]
[Visible and applies only if the Destination is option is set to Position on conveyor] The position on conveyor the crane will move to.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: PositionOnConveyor
Local variable:  T agent - the agent
Change orientation [dynamic]
[Visible and applies only if the Destination is option is set to Position on conveyor] If selected, you will be able to change the Orientation of the material item that enters the conveyor by selecting the new leading edge of the item in the Orientation field below.
Type of value: boolean
Local variable:  T agent - the agent
Orientation [dynamic]
[Visible and applies only if the Destination is option is set to Position on conveyor] If you need to rotate the material item when it is placed on the conveyor, here you can choose the side of the item that must be facing the direction of travel: Front, Rear, Left or Right.
Type of value: AgentOrientation
Local variable:  T agent - the agent
X [dynamic]
[Visible and applies only if the Destination is option is set to (x, y, z)] X coordinate of the point the crane will move to.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: double
Local variable:  T agent - the agent (material item)
Y [dynamic]
[Visible and applies only if the Destination is option is set to (x, y, z)] Y coordinate of the point the crane will move to.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: double
Local variable:  T agent - the agent (material item)
Z [dynamic]
[Visible and applies only if the Destination is option is set to (x, y, z)] Z coordinate of the point the crane will move to.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: double
Local variable:  T agent - the agent (material item)
... in the network [dynamic]
[Visible and applies only if the Destination is option is set to (x, y, z)] If the option is selected, the agent (material item) will be added to the network specified below when the crane drops it off.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: boolean
Local variable:  T agent - the agent (material item)
Network [dynamic]
[Visible and applies only if the ...in the network option is set] The network the agent (material item) will be added to once the crane drops it off.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: INetwork
Local variable:  T agent - the agent (material item)
Agent [dynamic]
[Visible and applies only if the Destination is option is set to Agent] The agent the crane will move to.
Note that the value is evaluated right after the crane picks up the agent.
Type of value: Agent
Local variable:  T agent - the agent (material item)
Loading time [dynamic]
Specifies the amount of time the crane will spend to pick up the agent (material item).
Note that the value is evaluated right before the crane picks up the agent.
Type of value: double
Local variable:  T agent - the agent (material item)
Unloading time [dynamic]
Specifies the amount of time the crane will spend to drop off the agent (material item).
Note that the value is evaluated right before the crane drops off the agent.
Type of value: double
Local variable:  T agent - the agent (material item)
Use operation time
If this option is selected, you can directly specify the time it takes the crane to transport the agent from one point to another. Speed values will be recalculated for every agent to satisfy operation time.
Syntax: boolean useOperationTime
Set new value at runtime: set_useOperationTime(new value)
Operation time [dynamic]
[Visible and applies only if the Use operation time option is set] The amount of time provided to the crane to transport the agent. The total operation time includes Loading time and Unloading time.
The value is evaluated for every agent after On at enter action is executed and is remembered until the agent is released.
Type of value: double
Local variable:  T agent - the agent (material item)
Agent selection pattern
Defines how the crane selects agents for transportation: based either on FIFO pattern (default setting) or on Custom pattern specified by expression you have to enter in the Custom pattern parameter.
Syntax: boolean customPriority
Set new value at runtime: set_customPriority(new value)
Valid values: true - Custom
           false - FIFO
Custom pattern [dynamic]
[Visible and applies only if the Custom option is selected] Defines the custom pattern for the crane to select agents.
Type of value: int
Local variable:  T agent - the agent (material item)
Minimum safe height [dynamic]
Specifies the minimum height the crane should raise the agent to in order to transport it (e.g., to avoid obstacles).
Type of value: double
Local variable:  T agent - the agent (material item)
Actions
On at enter [code]
Here you can type Java code that will be executed when the agent (material item) decides that it will most likely go through the block.
Local variable:  T agent - the agent (material item)
On cancel enter [code]
Here you can type Java code that will be executed when an agent (material item) currently living in preceding block decides not to go through this block.
Local variable:  T agent - the agent (material item)
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 (material item)
On at exit [code]
Here you can type Java code that will be executed when the agent (material item) decides that it will most likely exit the block.
Local variable:  T agent - the agent (material item)
On exit [code]
Here you can type Java code that will be executed when the agent (material item) leaves the block.
Local variable:  T agent - the agent (material item)
On cancel [code]
Here you can type Java code that will be executed when the agent (material item) exits the block via ccl port.
Local variable:  T agent - the agent (material item)
On remove [code]
Here you can type Java code that will be executed when the agent (material item) is removed from a crane.
Local variable:  T agent - the agent (material item)

Functions

int size() - Returns the number of agents that are currently transported by this crane.

T remove(Agent agent) - Removes the given agent from the crane it is transported by.

T get(int index) - Returns the agent by its index number. The order of the agents corresponds to the order in which they are picked up by the crane.

boolean contains(Agent agent) - Returns true if the block contains the given agent.

void cancel(T agent) - Causes the specified agent to immediately leave the block via ccl port. "On cancel" code section is executed for the agent.

Ports

in
The input port.
out
The output port.
ccl
The output port for agents leaving the block because of "cancel" event (caused by a call of cancel() function).