AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, LevelElement, LevelMarkup, com.anylogic.engine.markup.material_handling.IMaterialFallible, SVGElement, Serializable
Direct Known Subclasses:
JibCrane, OverheadCrane, OverheadCraneBridge

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

Method Summary

Modifier and TypeMethodDescription
abstract voidfail()
Sets the crane to failed state
abstract PositiongetAbsoluteHookPosition()
Returns the current hook position as an instance of Position in pixels.
abstract doublegetCraneHeight() 
abstract doublegetCraneHeight(LengthUnits units) 
abstract PointgetInitialHookPoint()
Returns the initial hook point in pixels, calculated according to the crane's dimensions and converted to pixels with crane's space.
abstract PointgetInitialHookPoint(LengthUnits units)
Returns the initial hook point in the specified length units.
abstract doublegetStatisticsStartTime() 
abstract doublegetUtilization()
Returns the crane utilization: the fraction of time the crane was operating.
doublegetX()
Returns the X coordinate of this crane
PointgetXYZ()
Returns the point location of this element
doublegetY()
Returns the Y coordinate of this crane
doublegetZ()
Returns Z-coordinate of this crane relative to crane's level
abstract booleanisFailed()
Returns true if the crane is failed and false otherwise.
abstract booleanisReady()
Returns true if the crane is ready to work with new agent and false otherwise.
voidnotifyDirtyState()
should be called by controller, when it forces the changing of markup's state
abstract voidonFailed()
Calls the crane's onFailed() callback code
abstract voidonLoading(T agent) 
abstract voidonRepaired()
Calls the crane's onRepaired() callback code
abstract voidonUnloading(T agent) 
abstract voidrepair()
Repairs the crane from failed state
abstract voidresetStats()
Resets the crane utilization statistics.
voidsetX(double x)
Sets the X coordinate of this crane
voidsetXYZ(Point point)
Places the crane into the argument point location
voidsetY(double y)
Sets the Y coordinate of this crane
voidsetZ(double z)
Sets the Z coordinate of this crane

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

getDrawMode, getLevel, setLevel

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

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

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

Method Details

notifyDirtyState

@AnyLogicInternalAPI
public void notifyDirtyState()
should be called by controller, when it forces the changing of markup's state
Parameters:
currentPosition -

getX

public double getX()
Returns the X coordinate of this crane
Returns:
the X coordinate of this crane

getY

public double getY()
Returns the Y coordinate of this crane
Returns:
the Y coordinate of this crane

getInitialHookPoint

public abstract Point getInitialHookPoint()
Returns the initial hook point in pixels, calculated according to the crane's dimensions and converted to pixels with crane's space.
Returns:
initial hook point in pixels

getInitialHookPoint

public abstract Point getInitialHookPoint(LengthUnits units)
Returns the initial hook point in the specified length units.
Parameters:
units - - a constant defining the length units
Returns:
initial hook point in the specified LengthUnits

getZ

public double getZ()
Returns Z-coordinate of this crane relative to crane's level

getXYZ

public Point getXYZ()
Returns the point location of this element
Returns:
the Point object with coordinates of the node

setX

public void setX(double x)
Sets the X coordinate of this crane
Parameters:
x - the X coordinate of this crane

setY

public void setY(double y)
Sets the Y coordinate of this crane
Parameters:
y - the Y coordinate of this crane

setZ

public void setZ(double z)
Sets the Z coordinate of this crane
Parameters:
z - the Z coordinate of this crane

setXYZ

public void setXYZ(Point point)
Places the crane into the argument point location
Parameters:
point - the location that the crane should be placed into

fail

public abstract void fail()
Sets the crane to failed state
Specified by:
fail in interface com.anylogic.engine.markup.material_handling.IMaterialFallible

repair

public abstract void repair()
Repairs the crane from failed state
Specified by:
repair in interface com.anylogic.engine.markup.material_handling.IMaterialFallible

onFailed

public abstract void onFailed()
Calls the crane's onFailed() callback code
Specified by:
onFailed in interface com.anylogic.engine.markup.material_handling.IMaterialFallible

onRepaired

public abstract void onRepaired()
Calls the crane's onRepaired() callback code
Specified by:
onRepaired in interface com.anylogic.engine.markup.material_handling.IMaterialFallible

isFailed

public abstract boolean isFailed()
Returns true if the crane is failed and false otherwise.
Specified by:
isFailed in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
Returns:
true if the crane is failed and false otherwise

isReady

public abstract boolean isReady()
Returns true if the crane is ready to work with new agent and false otherwise.
Returns:
true if the crane is ready to work with new agent and false otherwise

getUtilization

public abstract double getUtilization()
Returns the crane utilization: the fraction of time the crane was operating. The returned crane utilization value lies in the range [0..1].

resetStats

public abstract void resetStats()
Resets the crane utilization statistics.

onLoading

public abstract void onLoading(T agent)

onUnloading

public abstract void onUnloading(T agent)

getAbsoluteHookPosition

public abstract Position getAbsoluteHookPosition()
Returns the current hook position as an instance of Position in pixels. Also updates animation. Position.rotation contains the hook's current rotation angle in radians.
Returns:
current hook point in pixels with the angle as Position.rotation

getCraneHeight

public abstract double getCraneHeight()

getCraneHeight

public abstract double getCraneHeight(LengthUnits units)

getStatisticsStartTime

@AnyLogicInternalAPI
public abstract double getStatisticsStartTime()