Crane

   

Crane in graphical editor         Crane at model runtime in 3D animation

Crane is the space markup element that graphically defines a tower crane. You can use Material Handling Library block MoveByCrane to simulate how the crane transports agents (material items) between two points of simulated environment.

Crane has two different modes of operation depending on how its components move in relation to each other.

The maximum height an agent (material item) can reach when raised by crane equals the height of the crane itself.

Crane can serve as an obstacle on the way of transporters moving in free space navigation mode.

Crane element provides users with a set of actions, which are used to define additional agent behavior.

 To draw a crane
  1. Drag the  Crane element from the Material Handling section of the Space Markup palette into the graphical editor. You will see the circle shape with the single horizontal shape of crane's jib.

  1. Crane can pick up / drop off material items directly from/to a path, a conveyor, and a railway track. In this case you should connect the crane to the corresponding space markup element by placing it close enough so that the crane shape is highlighted in green (it means the connection has been established).

  1. After crane has been successfully connected, the crane shape will change color as displayed in the image below.

  1. You can adjust the initial angle of the jib and its length.
  2. The crane can have a sector in its rotational periphery where the jib cannot enter. To enable this feature for the crane, select Has blocked zone option in Properties view. Blocked zone can be adjusted from the graphical editor.
  3. To customize the crane's appearance, select the type of crane in Properties view: either Industrial jib crane, Cat-head tower crane or Flat-top tower crane. You can change Crane color in Properties view for all the types and Cabin color for the last two.

Properties

General

Name - The name of the crane. The name is used to identify and access the crane from code and Material Handling Library blocks.

Ignore - If selected, the crane is excluded from the model.

Visible on upper level - If selected, the crane is also visible on the upper level where this agent lives.

Lock - If selected, the crane's shape is locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them. It is frequently needed when you want to prevent editing this shape while drawing other shapes over it.

Visible - Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.

Material item type - The type of the material item that is transported by this crane

Is obstacle - If selected, this crane will be considered an obstacle for transporters moving in free space mode.

Components movement mode - Here you can choose how the crane's jib, trolley, and hook should move in relation to each other. The options are:
Step-by-step - the components will move one at a time. This mode satisfies the safety conditions of operating a crane.
Concurrent - the movement of all components will be executed at the same time. This mode is considerably faster than Step-by-step mode, but not as safe.

Trolley speed - Here you can specify the crane's trolley moving speed.

Lifting speed - Here you can define the hoist lifting speed.

Jib rotation speed - Here you can define the rotation speed of the crane's jib.

Actions

In all the actions, the current material item is accessible as the local variable agent.

On failed - Here you can type Java code that will be executed in case of crane failure.

On repaired - Here you can type Java code that will be executed when the crane is repaired.

On loading - Here you can type Java code that will be executed directly after the crane takes hold of the material item.

On unloading - Here you can type Java code that will be executed directly after the crane releases the material item.

Appearance

Style - Here you can choose the type of crane: either Industrial jib crane, Cat-head tower crane or Flat-top tower crane.




Industrial jib crane

Cat-head tower crane

Flat-top tower crane

Note that you only change the visual appearance of your crane: your choice doesn't affect the logic of its operation.

Cabin color - [Visible if Style option is set to either Cat-head tower crane or Flat-top tower crane] Crane cabin's fill color. Choose No color, if you do not want the area to be filled.

Crane color - Crane shape's color. Choose No color, if you do not want the area to be filled.

Position and size

X - X-coordinate of the point where the crane is located.

Y - Y-coordinate of the point where the crane is located.

Z - Z-coordinate of the point where the crane is located.

Jib length - Here you can specify the crane's jib length.

Crane height - Here you can specify the height of the crane itself.

Initial jib angle - Here you can specify the initial angle of the crane's jib in either positive or negative degrees/radians. A graphical tip located to the right of the control element displays the specified angle.

Has blocked zone - If selected, this option allows you to define a sector in the crane's rotational periphery where the jib will not be able to enter. 
Zone start angle - [Visible if Has blocked zone is selected] Here you can specify the angle where the blocked zone will start. A graphical tip located to the right of the control element displays the specified angle.
Zone angle, ° - [Visible if Has blocked zone is selected] Here you will specify the sector of the blocked zone itself. It will be calculated starting from

Advanced

Show in - Here you can choose whether you want the shape to be shown both in 2D and 3D animation, or in 2D only, or in 3D only.

Show name - If selected, the shape's name is displayed on the graphical diagram.

To adjust the initial angle of the jib
  1. Drag the handle located at the end on the jib's shape either clockwise or counter-clockwise to specify the initial angle of the jib. To prevent changing the current length of the jib in the process, press and hold the Shift key while dragging the handle.
  1. As you move the handle, the actual jib angle will be displayed in the AnyLogic status bar.
To adjust the length of the jib
  1. Drag the handle along the jib's shape to change the length of the jib. To prevent changing the initial angle of the jib in the process, press and hold the Ctrl key while dragging the handle.
  1. As you move the handle, the actual jib length will be displayed in the AnyLogic status bar.
To adjust the crane's blocked zone
  1. To enable the crane's blocked zone, select Has blocked zone option in the crane's Properties view. In the graphic editor it will be displayed as a blue-colored sector of the crane's circle shape. The sector will have two handles for adjustment.
  2. Drag the blue handle either clockwise or counter-clockwise to specify where the angle where the blocked zone of the crane should start.
  1. To prevent changing current size of the blocked zone, press and hold Ctrl button while dragging the blue handle.
  2. Drag the white handle to adjust the size of the blocked zone.
  1. If you want to increase / decrease the blocked zone by changing both start and end angles in equal measure, press and hold Shift key while dragging either handle.

Functions

You can dynamically modify crane properties at model runtime using the following API.
Working state

Function

Description

boolean isReady()

Returns true if the crane is ready to operate, otherwise returns false.

boolean isFailed()

Returns true if the crane failed (broke down) and is not operating, otherwise returns false.

void fail()

Initiates the crane's failure. The crane stops working.

void repair()

Repairs the crane. The crane becomes available again.

Utilization statistics

Function

Description

double getUtilization()

Returns the crane utilization: the fraction of the time the crane was busy. The returned crane utilization value lies in the range [0..1].

void resetStats()

Resets the crane utilization statistics.

Ground

Function

Description

Ground getGround()

Returns the ground where this crane is located, or null if the crane does not belong to any ground.

void setGround(Ground ground)

Sets the new ground where this crane will be located.

Parameter:
ground - the new ground.


Obstacle

Function

Description

boolean isObstacle()

Returns true if this crane is considered an obstacle by transporters moving in free space mode. Otherwise, returns false.

void setObstacle(boolean isObstacle)

Sets this crane as an obstacle for transporters moving in free space mode.

Parameter:
isObstacle - if true, the crane is set as an obstacle. Otherwise, not.


Movement

Function

Description

JibCraneMovementMode getMovementMode()

Returns the mode for the movement of the crane's trolley, jib and hook in relation to each other. Valid values are: JIB_CRANE_MOVEMENT_STEP_BY_STEPJIB_CRANE_MOVEMENT_CONCURRENT.

void setMovementMode(JibCraneMovementMode movementMode)

Sets the mode for the movement of crane's trolley, jib, and hook in relation to each other.

Parameter:
movementMode - components movement mode. Valid values are: JIB_CRANE_MOVEMENT_STEP_BY_STEPJIB_CRANE_MOVEMENT_CONCURRENT.

double getTrolleySpeed(SpeedUnits units)

Returns the speed of the crane's trolley in the specified speed units. Note that the actual trolley speed can differ from this value if the corresponding MoveByCrane block has Use operation time option enabled.

Parameter:
units
- a constant defining the speed units

void setTrolleySpeed(double speed, SpeedUnits units)

Sets the new speed of the crane's trolley in the specified speed units.

Parameters:
speed - a new speed value
units - a constant defining the speed units

double getLiftingSpeed(SpeedUnits units)

Returns the speed of the hoisting winch speed in the specified speed units. Note that the actual hoisting winch speed can differ from this value if the corresponding MoveByCrane block has Use operation time option enabled.

Parameter:
units
- a constant defining the speed units

void setLiftingSpeed(double speed, SpeedUnits units)

Sets the new speed of the hoisting winch operation in the specified speed units.

Parameters:
speed - a new speed value
units - a constant defining the speed units

double getRotationSpeed(RotationSpeedUnits units)

Returns the speed of the crane's jib rotation in the specified speed units. Note that the actual jib rotation speed can differ from this value if the corresponding MoveByCrane block has Use operation time option enabled.

Parameter:
units
- a constant defining the speed units

void setRotationSpeed(double speed, RotationSpeedUnits units)

Sets the new speed of the crane's jib rotation in the specified speed units.

Parameters:
speed - a new speed value
units - a constant defining the speed units

Position getCurrentHookPosition()

Returns current hook position in pixels with the crane's jib angle as Position.rotation.


Dimensions and components

Function

Description

double getCraneHeight(LengthUnits units)

Returns the crane's height in specified units.

Parameter:
units
- a constant defining the length units

void setCraneHeight(double height,
LengthUnits units)

Sets the crane's height in specified units.

Parameters:
height - a new height value
units - a constant defining the length units

double getJibLength()

Returns the crane's jib length in pixels.

double getJibLength(LengthUnits units)

Returns the crane's jib length in specified units.

Parameter:
units
- a constant defining the length units

void setJibLength(double length,
LengthUnits units)

Sets the crane's jib length in specified units.

Parameters:
length - a new length value
units - a constant defining the length units

double getInitialJibAngle(AngleUnits units)

Returns initial angle of the crane's jib location.

Parameter:
units - a constant defining the angle units

void setInitialJibAngle(double angle,
AngleUnits units)

Sets initial angle of the crane's jib location.

Parameters:
angle - a new angle value
units - a constant defining the angle units


Blocked zone

Function

Description

boolean isBlockedZoneEnabled()

Returns true if the crane's blocked zone is enabled, otherwise returns false.

double getBlockedZoneStartAngle()

Returns the angle where the crane's blocked zone starts.

double getBlockedZoneAngle()

Returns the delta angle of the crane's blocked zone.

void setBlockedZoneEnabled(boolean hasBlockedZone)

Enables/disables the blocked zone.

Parameter:
hasBlockedZone - blocked zone. If this parameter is true, blocked zone is enabled. If false, blocked zone is disabled.

void setBlockedZoneStartAngle(double angle,
AngleUnits units
)

Sets the angle where the crane's blocked zone starts.

Parameters:
angle - a new angle value
units - a constant defining the angle units

void setBlockedZoneAngle(double angle,
AngleUnits units
)

Sets the delta angle of the crane's blocked zone.

Parameters:
angle - a new angle value
units - a constant defining the angle units

void setBlockedZone(double startAngle,
double deltaAngle, AngleUnits units)

Enables blocked zone with specified parameters.

Parameters:
startAngle - a start angle of blocked zone value
deltaAngle - a delta angle of blocked zone value
units - a constant defining the angle units


Crane type

Function

Description

JibCraneType getType()

Returns the type of the crane's appearance.

Valid values are: JIB_CRANE_INDUSTRIAL, JIB_CRANE_CAT_HEAD, JIB_CRANE_FLAT_TOP.

void setType(JibCraneType type)

Sets the type of the crane's appearance.

Parameter:
type - new type of the crane's appearance. Valid values are: JIB_CRANE_INDUSTRIAL, JIB_CRANE_CAT_HEAD, JIB_CRANE_FLAT_TOP.


Сolor

Function

Description

Color getColor()

Returns the color of the crane, or null if the crane has no color.

void setColor(Color color)

Sets the color of the crane.

Parameter:
color - the new color

Color getCabinColor()

Returns the color of the crane's cabin, or null if the crane's cabin has no color.

void setCabinColor(Color cabinColor)

Sets the color of the crane's cabin.

Parameter:
cabinColor - the new color


Visibility

Function

Description

boolean isVisible()

Returns true if the crane is visible; returns false otherwise.

void setVisible(boolean v)

Sets the visibility of the crane.

Parameter:
v - visibility. If v is true - the crane is set to be visible, if it is false - not visible.


Position

Function

Description

double getX()

Returns the X coordinate of the center point of the crane.

double getY()

Returns the Y coordinate of the center point of the crane.

double getZ()

Returns the Z coordinate of the center point of the crane.

Point getXYZ(Point out)

Returns the (X, Y, Z) coordinates of the center point of the given crane

Parameter:
out - the output Point object to write the result to. The object may be null.


Removal

Function

Description

void remove()

Removes the crane from the presentation. If the crane is not a part of presentation, the function does nothing. Note, that removal from the presentation does not necessarily mean removing from the model logic, since logical networks and routes may have been created before the removal and survive it.



Related topics

 Space markup for material handling models

 Material Handling Library

 API reference: Crane class