AnyLogic AnyLogic
Expand
Font size

Class OverheadCrane<T extends Agent>

All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, IMarkupLibraryDescriptor, LevelElement, LevelMarkup, com.anylogic.engine.markup.material_handling.IMaterialFallible, com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor, com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T>, SVGElement, java.io.Serializable

public class OverheadCrane<T extends Agent>
extends Crane<T>
implements com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T>, com.anylogic.engine.markup.material_handling.IMaterialFallible
See Also:
Serialized Form

Constructor Summary

Constructors 
OverheadCrane()
Creates new OverheadCrane with 1 bridge.
OverheadCrane​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, boolean isObstacle, com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T> descriptor, double x, double y, double z, double rotation, double runwayLengthMeters, double craneWidthMeters, double craneHeightMeters, double bridgeWidthMeters, double safetyGap, java.awt.Color color, java.awt.Color trolleyColor, OverheadCraneDrawingType type, OverheadCraneGirderDrawingType girderType, OverheadCraneBridge... bridges)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons.
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
void addBridge​(OverheadCraneBridge bridge)
The method adds bridge to crane.
void attachAgentAnimation​(OverheadCraneBridge bridge, T agent)  
double averageCycleTime​(OverheadCraneBridge bridge, TimeUnits units)  
double bridgeAcceleration​(T agent, boolean isLoaded, AccelerationUnits units)
Returns the bridge acceleration specified by the parameter value of this crane in the specified units.
double bridgeDeceleration​(T agent, boolean isLoaded, AccelerationUnits units)
Returns the bridge deceleration specified by the parameter value of this crane in the specified units.
double bridgeSpeed​(T agent, boolean isLoaded, SpeedUnits units)
Returns the bridge speed specified by the parameter value of this crane in the specified units.
boolean canArriveAt​(OverheadCraneBridge bridge, Point hookDestination)  
boolean contains​(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y)
void detachAgentAnimation​(OverheadCraneBridge bridge)  
void fail()
Sets the crane to failed state
void fail​(OverheadCraneBridge overheadCraneBridge)  
Position getAbsoluteHookPosition()
Returns the current absolute hook position as an instance of Position in pixels.
Position getAbsoluteHookPosition​(OverheadCraneBridge overheadCraneBridge)
Returns the current absolute hook position of the specified bridge as an instance of Position in pixels.
Agent getAgent​(OverheadCraneBridge bridge)  
java.util.List<Agent> getAgents()  
java.util.List<Agent> getAgentsInQueue()
Returns list of agents that represents crane's general queue.
BoundingRectangle getBoundingRectangle()  
OverheadCraneBridge getBridge​(int index)
Returns crane's bridge with specified index.
double getBridgeDistanceTo​(OverheadCraneBridge bridge, Point p, LengthUnits units)  
Position getBridgePosition​(OverheadCraneBridge bridge)  
CraneProgram getBridgeProgram​(OverheadCraneBridge bridge)  
java.util.List<OverheadCraneBridge> getBridges()
Returns unmodifiable list of crane's bridges.
java.util.List<OverheadCraneBridge> getBridgesOnRouteTo​(OverheadCraneBridge bridge, Point p)  
double getBridgeWidth()
Returns width of the bridge in pixels
double getBridgeWidth​(LengthUnits units)
Returns bridge width in specified units.
java.awt.Color getColor()
Returns the color of hook and crane's rails for OVERHEAD_CRANE_BRIDGE crane type
double getCraneHeight()
Returns the crane's height in pixels.
double getCraneHeight​(LengthUnits units)
Returns the crane's height in the specified length units.
double getCraneWidth()
Returns the width of the crane in pixels.
double getCraneWidth​(LengthUnits units)
Returns the width of the crane specified units.
double getCurrentBridgeOffset​(OverheadCraneBridge bridge, LengthUnits units)  
double getCurrentHookOffset​(OverheadCraneBridge bridge, LengthUnits units)  
Point getCurrentHookPosition()  
Point getCurrentHookPosition​(OverheadCraneBridge bridge)  
double getCurrentTrolleyOffset​(OverheadCraneBridge bridge, LengthUnits units)  
BridgeDirection getDirection​(OverheadCraneBridge bridge)  
OverheadCraneGirderDrawingType getGirderType()
Returns the type of the crane's girder.
Position getHookPosition​(OverheadCraneBridge bridge)  
double getInitialBridgePosition​(LengthUnits units)
Deprecated.
the method will be removed, use OverheadCraneBridge.getInitialBridgeOffset(LengthUnits) instead
Point getInitialHookPoint()
Returns the initial hook point in pixels, calculated according to the crane's dimensions and converted to pixels with crane's space.
Point getInitialHookPoint​(LengthUnits units)
Returns the initial hook point in the specified length units.
double getInitialHookPosition​(LengthUnits units)
Deprecated.
the method will be removed, use OverheadCraneBridge.getInitialHookOffset(LengthUnits) instead
double getInitialTrolleyPosition​(LengthUnits units)
Deprecated.
the method will be removed, use OverheadCraneBridge.getInitialTrolleyOffset(LengthUnits) instead
com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T> getLibraryDescriptor()  
OverheadCraneMovementMode getMovementMode()
Returns the movement mode of the crane.
int getNumberOfBridges()
Returns number of crane's bridges
double getPriority​(OverheadCraneBridge bridge)  
java.util.List<Agent> getQueue​(Crane<Agent> crane)  
double getRotation()
Returns rotation of the crane.
double getRunwayLength()
Returns runway length in pixels.
double getRunwayLength​(LengthUnits units)
Returns runway length in specified units.
double getSafetyGap()
Returns the safety gap of the crane.
double getSafetyGap​(LengthUnits units)
Returns the safety gap of the crane.
OverheadCraneBridgeState getState​(OverheadCraneBridge bridge)  
double getStatisticsStartTime()  
Point getTargetPoint​(OverheadCraneBridge bridge)  
java.awt.Color getTrolleyColor()
Returns the color of the crane's trolley
Position getTrolleyPosition​(OverheadCraneBridge bridge)  
OverheadCraneDrawingType getType()
Returns the crane's type.
double getUtilization()
Returns the crane utilization: the value is calculated as mean of crane's bridges utilization.
double getUtilization​(OverheadCraneBridge overheadCraneBridge)  
double hoistSpeed​(T agent, boolean isLoaded, SpeedUnits units)
Returns the hoist speed specified by the parameter value of this crane in specified units.
boolean isAccelerationEnabled()
Returns value of parameter isAccelerationEnabled.
boolean isFailed()
Returns true if the crane is failed and false otherwise.
boolean isFailed​(OverheadCraneBridge overheadCraneBridge)  
boolean isLoaded()  
boolean isLoaded​(OverheadCraneBridge overheadCraneBridge)  
boolean isObstacle()
Returns true if this crane is considered an obstacle by transporters moving in free space mode.
boolean isReady()
Returns true if the crane is ready to work with new agent and false otherwise.
boolean isReady​(OverheadCraneBridge overheadCraneBridge)  
void moveBridge​(OverheadCraneBridge bridge, Point absolutePoint, double safeHeight, boolean remainsAtTarget)  
void moveBridgeByProgram​(OverheadCraneBridge bridge, CraneProgram program)  
int numberOfAgentsHandled()
Returns number of agents handled by crane: the value is calculated as sum per crane's bridges.
int numberOfAgentsHandled​(OverheadCraneBridge bridge)  
int numberOfConflicts​(OverheadCraneBridge bridge)  
void onBridgeMovementFinished​(OverheadCraneBridge bridge)
Calls the crane's onBridgeMovementFinished() callback code
void onBridgeStateChange​(T agent, OverheadCraneBridge bridge, OverheadCraneBridgeState type)
Calls the crane's onBridgeStateChange() callback code
void onFailed()
Calls the crane's onFailed() callback code
void onFailed​(OverheadCraneBridge overheadCraneBridge)  
void onLoading​(OverheadCraneBridge bridge, T agent)
Calls crane's onLoading() callback code
void onLoading​(T agent)  
void onRelease​(OverheadCraneBridge bridge, T agent)
Calls crane's onRelease() callback code
void onRepaired()
Calls the crane's onRepaired() callback code
void onRepaired​(OverheadCraneBridge overheadCraneBridge)  
void onSeize​(OverheadCraneBridge bridge, T agent)
Calls crane's onSeize() callback code
void onTargetReached​(OverheadCraneBridge bridge)
Calls the crane's onTargetReached() callback code
void onUnloading​(OverheadCraneBridge bridge, T agent)
Calls crane's onUnloading() callback code
void onUnloading​(T agent)  
void repair()
Repairs the crane from failed state
void repair​(OverheadCraneBridge overheadCraneBridge)  
void resetStats()
Resets statistics for all bridges.
void resetStats​(OverheadCraneBridge overheadCraneBridge)  
void setAccelerationEnabled​(boolean value)
Sets parameter isAccelerationEnabled.
void setBridgeWidth​(double bridgeWidth, LengthUnits units)
Sets bridge width length in specified units
void setColor​(java.awt.Color color)
Sets the specified color of hook and crane's rails for OVERHEAD_CRANE_BRIDGE crane type
void setCraneHeight​(double craneHeight, LengthUnits units)
Sets crane height in specified units.
void setCraneWidth​(double craneWidth, LengthUnits units)
Sets crane width in specified units.
void setGirderType​(OverheadCraneGirderDrawingType girderType)
Sets the crane's girder type
void setInitialBridgePosition​(double bridgePosition, LengthUnits units)
Deprecated.
void setInitialHookPosition​(double hookPosition, LengthUnits units)
Deprecated.
void setInitialTrolleyPosition​(double trolleyPosition, LengthUnits units)
Deprecated.
void setLevel​(Level level)  
void setMovementMode​(OverheadCraneMovementMode movementMode)
Sets movement mode.
void setObstacle​(boolean isObstacle)
Sets this crane as an obstacle for transporters moving in free space mode.
void setRotation​(double rotation)
Sets rotation of crane
void setRunwayLength​(double length, LengthUnits units)
Sets runway length in specified units
void setSafetyGap​(double safetyGap, LengthUnits units)
Sets the value for the safety gap of the crane.
void setTrolleyColor​(java.awt.Color trolleyColor)
Sets the specified color of the crane's trolley
void setType​(OverheadCraneDrawingType type)
Sets the crane's type
double timeInState​(OverheadCraneBridge bridge, OverheadCraneBridgeState state, TimeUnits units)  
double totalDistanceInConflict​(OverheadCraneBridge bridge, LengthUnits units)  
double totalTimeInConflicts​(OverheadCraneBridge bridge, TimeUnits units)  
double totalTransportationDistance​(OverheadCraneBridge bridge, LengthUnits units)  
double totalTravelledDistance​(OverheadCraneBridge bridge, LengthUnits units)  
double totalTravellingTime​(OverheadCraneBridge bridge, TimeUnits units)  
double trolleyAcceleration​(T agent, boolean isLoaded, AccelerationUnits units)
Returns the trolley acceleration specified by the parameter value of this crane in the specified units.
double trolleyDeceleration​(T agent, boolean isLoaded, AccelerationUnits units)
Returns the trolley deceleration specified by the parameter value of this crane in the specified units.
double trolleySpeed​(T agent, boolean isLoaded, SpeedUnits units)
Returns the trolley speed specified by the parameter value of this crane in specified units.
void updateDynamicProperties()
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties.
void validateInitialPosition​(OverheadCraneBridge bridge, double offsetM)  
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.markup.Crane

getX, getXYZ, getY, getZ, notifyDirtyState, setX, setXYZ, setY, setZ

Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup

getDrawMode, getLevel

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class com.anylogic.engine.markup.AbstractMarkup

discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicPropertiesStructural, updateSVGProperties

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged, postInitialize

Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor

getMarkup, setMarkup

Constructor Detail

OverheadCrane

public OverheadCrane()
Creates new OverheadCrane with 1 bridge. Bridges may be added by addBridge(OverheadCraneBridge). Default bridge may be accessed by getBridges(). Crane and its bridges may be modified until crane's initialization. Initial state of the crane will be verified on first attempt to use the crane.

OverheadCrane

@AnyLogicInternalCodegenAPI
public OverheadCrane​(Agent owner,
                     ShapeDrawMode drawMode,
                     boolean isPublic,
                     boolean isObstacle,
                     com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T> descriptor,
                     double x,
                     double y,
                     double z,
                     double rotation,
                     double runwayLengthMeters,
                     double craneWidthMeters,
                     double craneHeightMeters,
                     double bridgeWidthMeters,
                     double safetyGap,
                     java.awt.Color color,
                     java.awt.Color trolleyColor,
                     OverheadCraneDrawingType type,
                     OverheadCraneGirderDrawingType girderType,
                     OverheadCraneBridge... bridges)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. It is public due to technical reasons.

Method Detail

setLevel

public void setLevel​(Level level)
Specified by:
setLevel in interface LevelElement
Overrides:
setLevel in class AbstractLevelMarkup

getAgents

public java.util.List<Agent> getAgents()
Specified by:
getAgents in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

addBridge

public void addBridge​(OverheadCraneBridge bridge)
The method adds bridge to crane. Use this method only to create OverheadCrane by code. NB: bridges may be modified until initialization of the crane.

getAgentsInQueue

public java.util.List<Agent> getAgentsInQueue()
Returns list of agents that represents crane's general queue. The list is ordered by priority (from high to low). List is modifiable but changes will not affect real queue.
Specified by:
getAgentsInQueue in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Returns:
list of agents that represents crane's general queue.

onBridgeMovementFinished

public void onBridgeMovementFinished​(OverheadCraneBridge bridge)
Calls the crane's onBridgeMovementFinished() callback code
Specified by:
onBridgeMovementFinished in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

onTargetReached

public void onTargetReached​(OverheadCraneBridge bridge)
Calls the crane's onTargetReached() callback code
Specified by:
onTargetReached in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

onBridgeStateChange

public void onBridgeStateChange​(T agent,
                                OverheadCraneBridge bridge,
                                OverheadCraneBridgeState type)
Calls the crane's onBridgeStateChange() callback code
Specified by:
onBridgeStateChange in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getState

@AnyLogicInternalAPI
public OverheadCraneBridgeState getState​(OverheadCraneBridge bridge)
Specified by:
getState in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getTargetPoint

@AnyLogicInternalAPI
public Point getTargetPoint​(OverheadCraneBridge bridge)
Specified by:
getTargetPoint in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getAgent

@AnyLogicInternalAPI
public Agent getAgent​(OverheadCraneBridge bridge)
Specified by:
getAgent in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getPriority

@AnyLogicInternalAPI
public double getPriority​(OverheadCraneBridge bridge)
Specified by:
getPriority in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getDirection

@AnyLogicInternalAPI
public BridgeDirection getDirection​(OverheadCraneBridge bridge)
Specified by:
getDirection in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getBridgeDistanceTo

@AnyLogicInternalAPI
public double getBridgeDistanceTo​(OverheadCraneBridge bridge,
                                  Point p,
                                  LengthUnits units)
Specified by:
getBridgeDistanceTo in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getBridgesOnRouteTo

@AnyLogicInternalAPI
public java.util.List<OverheadCraneBridge> getBridgesOnRouteTo​(OverheadCraneBridge bridge,
                                                               Point p)
Specified by:
getBridgesOnRouteTo in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getQueue

@AnyLogicInternalAPI
public java.util.List<Agent> getQueue​(Crane<Agent> crane)
Specified by:
getQueue in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getCurrentBridgeOffset

@AnyLogicInternalAPI
public double getCurrentBridgeOffset​(OverheadCraneBridge bridge,
                                     LengthUnits units)
Specified by:
getCurrentBridgeOffset in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getCurrentTrolleyOffset

@AnyLogicInternalAPI
public double getCurrentTrolleyOffset​(OverheadCraneBridge bridge,
                                      LengthUnits units)
Specified by:
getCurrentTrolleyOffset in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getCurrentHookOffset

@AnyLogicInternalAPI
public double getCurrentHookOffset​(OverheadCraneBridge bridge,
                                   LengthUnits units)
Specified by:
getCurrentHookOffset in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

attachAgentAnimation

@AnyLogicInternalAPI
public void attachAgentAnimation​(OverheadCraneBridge bridge,
                                 T agent)
Specified by:
attachAgentAnimation in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

detachAgentAnimation

@AnyLogicInternalAPI
public void detachAgentAnimation​(OverheadCraneBridge bridge)
Specified by:
detachAgentAnimation in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getHookPosition

@AnyLogicInternalAPI
public Position getHookPosition​(OverheadCraneBridge bridge)
Specified by:
getHookPosition in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getBridgePosition

@AnyLogicInternalAPI
public Position getBridgePosition​(OverheadCraneBridge bridge)
Specified by:
getBridgePosition in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getTrolleyPosition

@AnyLogicInternalAPI
public Position getTrolleyPosition​(OverheadCraneBridge bridge)
Specified by:
getTrolleyPosition in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getInitialTrolleyPosition

public double getInitialTrolleyPosition​(LengthUnits units)
Deprecated.
the method will be removed, use OverheadCraneBridge.getInitialTrolleyOffset(LengthUnits) instead
Returns the initial offset of the crane's trolley in the specified length units.
Parameters:
units - - a constant defining the length units
Returns:
the initial offset of the crane's trolley in the specified length units.

getInitialHookPosition

public double getInitialHookPosition​(LengthUnits units)
Deprecated.
the method will be removed, use OverheadCraneBridge.getInitialHookOffset(LengthUnits) instead
Returns the initial offset of the crane's hook in the specified length units.
Parameters:
units - - a constant defining the length units
Returns:
the initial offset of the crane's hook in the specified length units.

getInitialBridgePosition

public double getInitialBridgePosition​(LengthUnits units)
Deprecated.
the method will be removed, use OverheadCraneBridge.getInitialBridgeOffset(LengthUnits) instead
Returns the initial offset of the crane's bridge in the specified length units.
Parameters:
units - - a constant defining the length units
Returns:
the initial offset of the crane's bridge in the specified length units.

setInitialHookPosition

public void setInitialHookPosition​(double hookPosition,
                                   LengthUnits units)
Deprecated.
Sets the initial hook height in the specified length units.
Parameters:
hookPosition - - the new height of the crane's hook
units - - a constant defining the length units

setInitialBridgePosition

public void setInitialBridgePosition​(double bridgePosition,
                                     LengthUnits units)
Deprecated.
Sets the initial bridge position in the specified length units.
Parameters:
bridgePosition - - the new position of the bridge
units - - a constant defining the length units

setInitialTrolleyPosition

public void setInitialTrolleyPosition​(double trolleyPosition,
                                      LengthUnits units)
Deprecated.
Sets the initial trolley position in the specified length units.
Parameters:
trolleyPosition - - the new position of the crane's trolley
units - - a constant defining the length units

canArriveAt

@AnyLogicInternalAPI
public boolean canArriveAt​(OverheadCraneBridge bridge,
                           Point hookDestination)
Specified by:
canArriveAt in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

updateDynamicProperties

@AnyLogicInternalCodegenAPI
public void updateDynamicProperties()
Description copied from class: AbstractMarkup
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
Overrides:
updateDynamicProperties in class AbstractMarkup

isReady

@AnyLogicInternalAPI
public boolean isReady()
Description copied from class: Crane
Returns true if the crane is ready to work with new agent and false otherwise.
Specified by:
isReady in class Crane<T extends Agent>
Returns:
true if the crane is ready to work with new agent and false otherwise

onLoading

@AnyLogicInternalAPI
public void onLoading​(T agent)
Specified by:
onLoading in class Crane<T extends Agent>

onLoading

public void onLoading​(OverheadCraneBridge bridge,
                      T agent)
Calls crane's onLoading() callback code
Specified by:
onLoading in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

onUnloading

@AnyLogicInternalAPI
public void onUnloading​(T agent)
Specified by:
onUnloading in class Crane<T extends Agent>

onUnloading

public void onUnloading​(OverheadCraneBridge bridge,
                        T agent)
Calls crane's onUnloading() callback code
Specified by:
onUnloading in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

onRelease

public void onRelease​(OverheadCraneBridge bridge,
                      T agent)
Calls crane's onRelease() callback code
Specified by:
onRelease in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

onSeize

public void onSeize​(OverheadCraneBridge bridge,
                    T agent)
Calls crane's onSeize() callback code
Specified by:
onSeize in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

contains

public boolean contains​(double px,
                        double py)
Description copied from class: MarkupShape
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y)
Specified by:
contains in class MarkupShape
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

resetStats

@AnyLogicInternalAPI
public void resetStats​(OverheadCraneBridge overheadCraneBridge)
Specified by:
resetStats in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getUtilization

@AnyLogicInternalAPI
public double getUtilization​(OverheadCraneBridge overheadCraneBridge)
Specified by:
getUtilization in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

onFailed

@AnyLogicInternalAPI
public void onFailed()
Description copied from class: Crane
Calls the crane's onFailed() callback code
Specified by:
onFailed in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
Specified by:
onFailed in class Crane<T extends Agent>

onRepaired

@AnyLogicInternalAPI
public void onRepaired()
Description copied from class: Crane
Calls the crane's onRepaired() callback code
Specified by:
onRepaired in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
Specified by:
onRepaired in class Crane<T extends Agent>

isFailed

@AnyLogicInternalAPI
public boolean isFailed()
Description copied from class: Crane
Returns true if the crane is failed and false otherwise.
Specified by:
isFailed in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
Specified by:
isFailed in class Crane<T extends Agent>
Returns:
true if the crane is failed and false otherwise

fail

@AnyLogicInternalAPI
public void fail()
Description copied from class: Crane
Sets the crane to failed state
Specified by:
fail in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
Specified by:
fail in class Crane<T extends Agent>

repair

@AnyLogicInternalAPI
public void repair()
Description copied from class: Crane
Repairs the crane from failed state
Specified by:
repair in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
Specified by:
repair in class Crane<T extends Agent>

isFailed

@AnyLogicInternalAPI
public boolean isFailed​(OverheadCraneBridge overheadCraneBridge)
Specified by:
isFailed in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

isReady

@AnyLogicInternalAPI
public boolean isReady​(OverheadCraneBridge overheadCraneBridge)
Specified by:
isReady in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

onFailed

public void onFailed​(OverheadCraneBridge overheadCraneBridge)
Specified by:
onFailed in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

onRepaired

public void onRepaired​(OverheadCraneBridge overheadCraneBridge)
Specified by:
onRepaired in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

fail

@AnyLogicInternalAPI
public void fail​(OverheadCraneBridge overheadCraneBridge)
Specified by:
fail in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

repair

@AnyLogicInternalAPI
public void repair​(OverheadCraneBridge overheadCraneBridge)
Specified by:
repair in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

isLoaded

@AnyLogicInternalAPI
public boolean isLoaded​(OverheadCraneBridge overheadCraneBridge)
Specified by:
isLoaded in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getAbsoluteHookPosition

public Position getAbsoluteHookPosition​(OverheadCraneBridge overheadCraneBridge)
Returns the current absolute hook position of the specified bridge as an instance of Position in pixels. Position.rotation contains the rotation of crane.
Specified by:
getAbsoluteHookPosition in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
overheadCraneBridge - specified bridge
Returns:
current absolute hook point in pixels with the rotation angle as Position.rotation

moveBridge

@AnyLogicInternalAPI
public void moveBridge​(OverheadCraneBridge bridge,
                       Point absolutePoint,
                       double safeHeight,
                       boolean remainsAtTarget)
Specified by:
moveBridge in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

moveBridgeByProgram

@AnyLogicInternalAPI
public void moveBridgeByProgram​(OverheadCraneBridge bridge,
                                CraneProgram program)
Specified by:
moveBridgeByProgram in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getBridgeProgram

@AnyLogicInternalAPI
public CraneProgram getBridgeProgram​(OverheadCraneBridge bridge)
Specified by:
getBridgeProgram in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

numberOfAgentsHandled

@AnyLogicInternalAPI
public int numberOfAgentsHandled​(OverheadCraneBridge bridge)
Specified by:
numberOfAgentsHandled in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

numberOfConflicts

@AnyLogicInternalAPI
public int numberOfConflicts​(OverheadCraneBridge bridge)
Specified by:
numberOfConflicts in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

totalTravelledDistance

@AnyLogicInternalAPI
public double totalTravelledDistance​(OverheadCraneBridge bridge,
                                     LengthUnits units)
Specified by:
totalTravelledDistance in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

totalTransportationDistance

@AnyLogicInternalAPI
public double totalTransportationDistance​(OverheadCraneBridge bridge,
                                          LengthUnits units)
Specified by:
totalTransportationDistance in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

totalDistanceInConflict

@AnyLogicInternalAPI
public double totalDistanceInConflict​(OverheadCraneBridge bridge,
                                      LengthUnits units)
Specified by:
totalDistanceInConflict in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

totalTravellingTime

@AnyLogicInternalAPI
public double totalTravellingTime​(OverheadCraneBridge bridge,
                                  TimeUnits units)
Specified by:
totalTravellingTime in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

averageCycleTime

@AnyLogicInternalAPI
public double averageCycleTime​(OverheadCraneBridge bridge,
                               TimeUnits units)
Specified by:
averageCycleTime in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

timeInState

@AnyLogicInternalAPI
public double timeInState​(OverheadCraneBridge bridge,
                          OverheadCraneBridgeState state,
                          TimeUnits units)
Specified by:
timeInState in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

totalTimeInConflicts

@AnyLogicInternalAPI
public double totalTimeInConflicts​(OverheadCraneBridge bridge,
                                   TimeUnits units)
Specified by:
totalTimeInConflicts in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getLibraryDescriptor

@AnyLogicInternalAPI
public com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T> getLibraryDescriptor()

getMovementMode

public OverheadCraneMovementMode getMovementMode()
Returns the movement mode of the crane. See OverheadCraneMovementMode
Specified by:
getMovementMode in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Returns:
the movement mode of the crane

getType

public OverheadCraneDrawingType getType()
Returns the crane's type. See OverheadCraneDrawingType
Returns:
the crane's type

getGirderType

public OverheadCraneGirderDrawingType getGirderType()
Returns the type of the crane's girder. See OverheadCraneGirderDrawingType
Returns:
the crane's type

getColor

public java.awt.Color getColor()
Returns the color of hook and crane's rails for OVERHEAD_CRANE_BRIDGE crane type
Returns:
the color of hook and crane's rails for OVERHEAD_CRANE_BRIDGE crane type

setColor

public void setColor​(java.awt.Color color)
Sets the specified color of hook and crane's rails for OVERHEAD_CRANE_BRIDGE crane type
Parameters:
color - - specified color of of hook and crane's rails for OVERHEAD_CRANE_BRIDGE crane type

getTrolleyColor

public java.awt.Color getTrolleyColor()
Returns the color of the crane's trolley
Returns:
color of the crane's trolley

setTrolleyColor

public void setTrolleyColor​(java.awt.Color trolleyColor)
Sets the specified color of the crane's trolley
Parameters:
trolleyColor - - specified color. Use null to hide the trolley.

setType

public void setType​(OverheadCraneDrawingType type)
Sets the crane's type
Parameters:
type - - see OverheadCraneDrawingType

setGirderType

public void setGirderType​(OverheadCraneGirderDrawingType girderType)
Sets the crane's girder type
Parameters:
girderType - - see OverheadCraneGirderDrawingType

getRotation

public double getRotation()
Returns rotation of the crane.
Returns:
rotation of the crane

getCraneWidth

public double getCraneWidth()
Returns the width of the crane in pixels.
Returns:
the width of the crane in pixels

getCraneWidth

public double getCraneWidth​(LengthUnits units)
Returns the width of the crane specified units.
Parameters:
units - - constant value that specifies units
Returns:
the width of the crane

setCraneWidth

public void setCraneWidth​(double craneWidth,
                          LengthUnits units)
Sets crane width in specified units.
Parameters:
craneWidth - - the width of the crane
units - - constant value that specifies units

setCraneHeight

public void setCraneHeight​(double craneHeight,
                           LengthUnits units)
Sets crane height in specified units.
Parameters:
craneHeight - - the height of the crane
units - - constant value that specifies units

getRunwayLength

public double getRunwayLength()
Returns runway length in pixels.
Returns:
runway length in pixels

getRunwayLength

public double getRunwayLength​(LengthUnits units)
Returns runway length in specified units.
Parameters:
units - - a constant defining the length units
Returns:
runway length in specified units

setRunwayLength

public void setRunwayLength​(double length,
                            LengthUnits units)
Sets runway length in specified units
Parameters:
length - - length value
units - - a constant defining the length units

setRotation

public void setRotation​(double rotation)
Sets rotation of crane
Parameters:
rotation - - angle in radians

getInitialHookPoint

@AnyLogicInternalAPI
public Point getInitialHookPoint()
Description copied from class: Crane
Returns the initial hook point in pixels, calculated according to the crane's dimensions and converted to pixels with crane's space.
Specified by:
getInitialHookPoint in class Crane<T extends Agent>
Returns:
initial hook point in pixels

getInitialHookPoint

@AnyLogicInternalAPI
public Point getInitialHookPoint​(LengthUnits units)
Description copied from class: Crane
Returns the initial hook point in the specified length units.
Specified by:
getInitialHookPoint in class Crane<T extends Agent>
Parameters:
units - - a constant defining the length units
Returns:
initial hook point in the specified LengthUnits

getBridges

public java.util.List<OverheadCraneBridge> getBridges()
Returns unmodifiable list of crane's bridges. Note: list will be sorted (and bridge's indexes will be setted) by MarkupShape.initialize() method. You may determine order of bridges via their parking position before call of MarkupShape.initialize() method. Afterwards order is unmodifiable.
Returns:
unmodifiable list of crane's bridges.

getNumberOfBridges

public int getNumberOfBridges()
Returns number of crane's bridges
Returns:
number of crane's bridges

getBridge

public OverheadCraneBridge getBridge​(int index)
Returns crane's bridge with specified index.
Parameters:
index - - index of bridge. An integer value from 0 to numberOfBridges - 1 Indexes are setted by MarkupShape.initialize() method in order of increasing bridge's offset (from left to right for crane with zero rotation). Indexes may not be changed afterwards. You may get bridge index via OverheadCraneBridge.getIndex() method
Returns:
crane's bridge with specified index.

getBridgeWidth

public double getBridgeWidth()
Returns width of the bridge in pixels
Returns:
bridge width in pixels

getBridgeWidth

public double getBridgeWidth​(LengthUnits units)
Returns bridge width in specified units.
Parameters:
units - - a constant defining the length units
Returns:
bridge width in specified units

setBridgeWidth

public void setBridgeWidth​(double bridgeWidth,
                           LengthUnits units)
Sets bridge width length in specified units
Parameters:
bridgeWidth - - width value
units - - a constant defining the length units

getSafetyGap

public double getSafetyGap()
Returns the safety gap of the crane. At any given time two bridges have to be at least one safety gap apart.
Returns:
the safety gap of the crane

getSafetyGap

public double getSafetyGap​(LengthUnits units)
Returns the safety gap of the crane. At any given time two bridges have to be at least one safety gap apart.
Parameters:
units - - a constant defining the length units
Returns:
the safety gap of the crane

setSafetyGap

public void setSafetyGap​(double safetyGap,
                         LengthUnits units)
Sets the value for the safety gap of the crane. At any given time two bridges have to be at least one safety gap apart.
Parameters:
safetyGap - - safety gap value
units - - a constant defining the length units

getCurrentHookPosition

@AnyLogicInternalAPI
public Point getCurrentHookPosition()

getCurrentHookPosition

@AnyLogicInternalAPI
public Point getCurrentHookPosition​(OverheadCraneBridge bridge)
Specified by:
getCurrentHookPosition in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getAbsoluteHookPosition

@AnyLogicInternalAPI
public Position getAbsoluteHookPosition()
Returns the current absolute hook position as an instance of Position in pixels. Also updates animation. Position.rotation contains the rotation of crane.
Specified by:
getAbsoluteHookPosition in class Crane<T extends Agent>
Returns:
current absolute hook point in pixels with the rotation angle as Position.rotation

setAccelerationEnabled

public void setAccelerationEnabled​(boolean value)
Sets parameter isAccelerationEnabled. If the value is true than crane will move with specified accelerations.
Specified by:
setAccelerationEnabled in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
value - - boolean value to be setted to parameter isAccelerationEnabled

trolleySpeed

public double trolleySpeed​(T agent,
                           boolean isLoaded,
                           SpeedUnits units)
Returns the trolley speed specified by the parameter value of this crane in specified units. Note that this value does not correspond to the actual trolley speed if the carried agent is currently in the MoveByCrane block which has useOperationTime option enabled.
Specified by:
trolleySpeed in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
agent - - the item that the crane is going to move. It is null when the crane moves without load.
isLoaded - - a flag that you can use to specify different values for the crane's movement with and without load.
units - - a constant defining the speed units
Returns:
trolley speed specified by the parameter value of this crane

hoistSpeed

public double hoistSpeed​(T agent,
                         boolean isLoaded,
                         SpeedUnits units)
Returns the hoist speed specified by the parameter value of this crane in specified units. Note that this value does not correspond to the actual hoister speed if the carried agent is currently in the MoveByCrane block which has useOperationTime option enabled.
Specified by:
hoistSpeed in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
agent - - the item that the crane is going to move. It is null when the crane moves without load.
isLoaded - - a flag that you can use to specify different values for the crane's movement with and without load.
units - - a constant defining the speed units
Returns:
hoist speed specified by the parameter value of this crane

bridgeSpeed

public double bridgeSpeed​(T agent,
                          boolean isLoaded,
                          SpeedUnits units)
Returns the bridge speed specified by the parameter value of this crane in the specified units. Note that this value does not correspond to the actual bridge speed if the carried agent is currently in the MoveByCrane block which has useOperationTime option enabled.
Specified by:
bridgeSpeed in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
agent - - the item that the crane is going to move. It is null when the crane moves without load.
isLoaded - - a flag that you can use to specify different values for the crane's movement with and without load.
units - - a constant defining the speed units
Returns:
bridge speed specified by the parameter value of this crane

setMovementMode

public void setMovementMode​(OverheadCraneMovementMode movementMode)
Sets movement mode. See OverheadCraneMovementMode
Specified by:
setMovementMode in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
movementMode - - constant value, specified crane's operation pattern.

trolleyDeceleration

public double trolleyDeceleration​(T agent,
                                  boolean isLoaded,
                                  AccelerationUnits units)
Returns the trolley deceleration specified by the parameter value of this crane in the specified units. Note that this value does not correspond to the actual trolley deceleration if the carried agent is currently in the MoveByCrane block which has useOperationTime option enabled.
Specified by:
trolleyDeceleration in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
agent - - the item that the crane is going to move. It is null when the crane moves without load.
isLoaded - - a flag that you can use to specify different values for the crane's movement with and without load.
units - - a constant defining the acceleration units
Returns:
trolley deceleration specified by the parameter value of this crane

trolleyAcceleration

public double trolleyAcceleration​(T agent,
                                  boolean isLoaded,
                                  AccelerationUnits units)
Returns the trolley acceleration specified by the parameter value of this crane in the specified units. Note that this value does not correspond to the actual trolley acceleration if the carried agent is currently in the MoveByCrane block which has useOperationTime option enabled.
Specified by:
trolleyAcceleration in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
agent - - the item that the crane is going to move. It is null when the crane moves without load.
isLoaded - - a flag that you can use to specify different values for the crane's movement with and without load.
units - - a constant defining the acceleration units
Returns:
trolley acceleration specified by the parameter value of this crane

bridgeDeceleration

public double bridgeDeceleration​(T agent,
                                 boolean isLoaded,
                                 AccelerationUnits units)
Returns the bridge deceleration specified by the parameter value of this crane in the specified units. Note that this value does not correspond to the actual bridge deceleration if the carried agent is currently in the MoveByCrane block which has useOperationTime option enabled.
Specified by:
bridgeDeceleration in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
agent - - the item that the crane is going to move. It is null when the crane moves without load.
isLoaded - - a flag that you can use to specify different values for the crane's movement with and without load.
units - - a constant defining the acceleration units
Returns:
bridge deceleration specified by the parameter value of this crane

bridgeAcceleration

public double bridgeAcceleration​(T agent,
                                 boolean isLoaded,
                                 AccelerationUnits units)
Returns the bridge acceleration specified by the parameter value of this crane in the specified units. Note that this value does not correspond to the actual bridge acceleration if the carried agent is currently in the MoveByCrane block which has useOperationTime option enabled.
Specified by:
bridgeAcceleration in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Parameters:
agent - - the item that the crane is going to move. It is null when the crane moves without load.
isLoaded - - a flag that you can use to specify different values for the crane's movement with and without load.
units - - a constant defining the acceleration units
Returns:
bridge acceleration specified by the parameter value of this crane

validateInitialPosition

@AnyLogicInternalAPI
public void validateInitialPosition​(OverheadCraneBridge bridge,
                                    double offsetM)
Specified by:
validateInitialPosition in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>

getStatisticsStartTime

@AnyLogicInternalAPI
public double getStatisticsStartTime()
Specified by:
getStatisticsStartTime in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Specified by:
getStatisticsStartTime in class Crane<T extends Agent>

getUtilization

public double getUtilization()
Returns the crane utilization: the value is calculated as mean of crane's bridges utilization. The returned value lies in the range [0..1].
Specified by:
getUtilization in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Specified by:
getUtilization in class Crane<T extends Agent>

resetStats

public void resetStats()
Resets statistics for all bridges.
Specified by:
resetStats in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Specified by:
resetStats in class Crane<T extends Agent>

numberOfAgentsHandled

public int numberOfAgentsHandled()
Returns number of agents handled by crane: the value is calculated as sum per crane's bridges.
Returns:

setObstacle

public void setObstacle​(boolean isObstacle)
Sets this crane as an obstacle for transporters moving in free space mode.
Parameters:
isObstacle - - if true, the crane is set as an obstacle. Otherwise, not.

getCraneHeight

public double getCraneHeight​(LengthUnits units)
Returns the crane's height in the specified length units.
Specified by:
getCraneHeight in class Crane<T extends Agent>
Parameters:
units - - a constant defining the length units
Returns:
crane's height in the specified units

getCraneHeight

public double getCraneHeight()
Returns the crane's height in pixels.
Specified by:
getCraneHeight in class Crane<T extends Agent>
Returns:
crane's height in pixels

isLoaded

@AnyLogicInternalAPI
public boolean isLoaded()

isAccelerationEnabled

public boolean isAccelerationEnabled()
Returns value of parameter isAccelerationEnabled. If it is true, than acceleration and deceleration values will be considered.
Specified by:
isAccelerationEnabled in interface com.anylogic.engine.markup.material_handling.IOverheadCraneDescriptor<T extends Agent>
Returns:
value of parameter isAccelerationEnabled. If it is true, than acceleration and deceleration values will be considered

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()

isObstacle

public boolean isObstacle()
Returns true if this crane is considered an obstacle by transporters moving in free space mode. Otherwise, returns false.
Returns:
true if this crane is considered an obstacle by transporters moving in free space mode. Otherwise, returns false
How can we improve this article?