public class OverheadCraneBridge extends Crane<Agent> implements com.anylogic.engine.markup.material_handling.IMaterialFallible
Constructor and Description |
---|
OverheadCraneBridge() |
OverheadCraneBridge(double bridgeLocation,
double trolleyLocation,
java.awt.Color bridgeColor) |
Modifier and Type | Method and Description |
---|---|
void |
attachAgentAnimation(Agent agent)
Attaches agent's position to the hook coordinates.
|
double |
averageCycleTime()
Returns average agent operation time in model time units.
|
double |
averageCycleTime(TimeUnits units)
Returns average agent operation time in specified time units.
|
boolean |
canArriveAt(Point hookDestination)
Returns
true if the hook can reach specified point. |
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()
Detaches the agent that was previously attached to hook.
|
void |
fail()
Sets the bridge to
failed state |
Position |
getAbsoluteHookPosition()
Returns the current absolute hook position as an instance of
Position in pixels. |
Agent |
getAgent()
Returns the agent that have seized the bridge.
|
java.util.List<Agent> |
getAgentsInQueue()
Returns list of agents that represents bridge's own queue.
|
java.awt.Color |
getBridgeColor()
Returns the color of the bridge
|
Position |
getBridgePosition()
Returns coordinates of bridge's center.
|
java.util.List<OverheadCraneBridge> |
getBridgesOnRouteTo(Point absolutePoint)
Returns list of bridges that are currently located between the bridge and destination point.
|
OverheadCrane |
getCrane()
Returns the crane the bridge belongs to.
|
double |
getCraneHeight() |
double |
getCraneHeight(LengthUnits units) |
double |
getCurrentBridgeOffset(LengthUnits units)
Returns current bridge offset in specified units (from left to right for crane with zero rotation).
|
double |
getCurrentHookOffset(LengthUnits units)
Returns current hook height in specified units.
|
double |
getCurrentTrolleyOffset(LengthUnits units)
Returns current trolley offset in specified units (from top to bottom for crane with zero rotation).
|
BridgeDirection |
getDirection()
Returns current direction of the bridge.
|
double |
getDistanceTo(Point absolutePoint,
LengthUnits units)
Returns bridge's distance to specified point.
|
double |
getDistanceToTarget(LengthUnits units)
Returns bridge's distance to current target.
|
Position |
getHookPosition()
Returns hook's coordinates.
|
int |
getIndex()
Returns bridge index.
|
double |
getInitialBridgeOffset(LengthUnits units)
Returns the initial offset of the bridge in the specified length units.
|
double |
getInitialHookOffset(LengthUnits units)
Returns the initial offset of the bridge's hook in the specified length units.
|
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 |
getInitialTrolleyOffset(LengthUnits units)
Returns the initial offset of the bridge's trolley in the specified length units.
|
double |
getPriority()
Returns current bridge's movement priority.
|
CraneProgram |
getProgram()
Returns clone of current bridge program.
|
OverheadCraneBridgeState |
getState()
Returns the bridge's current state.
|
double |
getStatisticsStartTime() |
Point |
getTargetPoint()
Returns bridge's target point.
|
Position |
getTrolleyPosition()
Returns coordinates of trolley's center.
|
double |
getUtilization()
Returns the bridge utilization: the fraction of time the crane was operating.
|
double |
getX()
Returns the X coordinate of this crane
|
Point |
getXYZ()
Returns the point location of this element
|
double |
getY()
Returns the Y coordinate of this crane
|
double |
getZ()
Returns Z-coordinate of this crane relative to crane's level
|
boolean |
isFailed()
Returns
true if the bridge is failed and false otherwise. |
boolean |
isReady()
Returns
true if bridge is ready to operate, i.e. idle and not failed. |
void |
moveByProgram(CraneProgram program)
Orders the bridge to move by program.
|
void |
moveTo(Point absolutePoint,
double safeHeight,
boolean remainsAtTarget)
Orders the bridge to move to specified point.
|
int |
numberOfAgentsHandled()
Returns total number of agents that have been handled by the bridge.
|
int |
numberOfConflicts() |
void |
onFailed()
Calls the bridge's
onFailed() callback code |
void |
onLoading(Agent agent) |
void |
onRepaired()
Calls the bridge's
onRepaired() callback code |
void |
onUnloading(Agent agent) |
void |
repair()
Repairs the bridge from
failed state |
void |
resetStats()
Resets the crane utilization statistics.
|
void |
setBridgeColor(java.awt.Color bridgeColor)
Sets the specified color of the bridge
|
void |
setInitialBridgeOffset(double bridgeOffset,
LengthUnits units)
Sets the initial bridge position in the specified length units.
|
void |
setInitialHookOffset(double hookOffset,
LengthUnits units)
Sets the initial hook height in the specified length units.
|
void |
setInitialTrolleyOffset(double trolleyOffset,
LengthUnits units)
Sets the initial trolley position in the specified length units.
|
void |
setX(double x)
Sets the X coordinate of this crane
|
void |
setXYZ(Point point)
Places the crane into the argument point location
|
void |
setY(double y)
Sets the Y coordinate of this crane
|
void |
setZ(double z)
Sets the Z coordinate of this crane
|
double |
timeInState(OverheadCraneBridgeState state)
Returns total time in model time units spent by the bridge in the given state.
|
double |
timeInState(OverheadCraneBridgeState state,
TimeUnits units)
Returns total time in specified time units spent by the bridge in the given state.
|
double |
totalDistanceInConflict()
Returns total distance in meters traveled by the bridge in any state while giving way to another bridge.
|
double |
totalDistanceInConflict(LengthUnits units)
Returns total distance in specified length units traveled by the bridge in any state while giving way to another bridge.
|
double |
totalTimeInConflicts()
Returns total time in model time units spent by the bridge giving way to other bridges or not moving to avoid collisions.
|
double |
totalTimeInConflicts(TimeUnits units)
Returns total time in specified time units spent by the bridge giving way to other bridges or not moving to avoid collisions.
|
double |
totalTransportationDistance()
Returns total distance in meters traveled by the bridge in MOVING_LOADED state.
|
double |
totalTransportationDistance(LengthUnits units)
Returns total distance in specified length units traveled by the bridge in MOVING_LOADED state.
|
double |
totalTravelledDistance()
Returns total distance in meters traveled by the bridge including movement in manual mode and situations where the bridge had to give way to another bridge.
|
double |
totalTravelledDistance(LengthUnits units)
Returns total distance in specified length units traveled by the bridge including movement in manual mode and situations where the bridge had to give way to another bridge.
|
double |
totalTravellingTime()
Returns total time in model time units that the bridge spent moving for any reason.
|
double |
totalTravellingTime(TimeUnits units)
Returns total time in specified time units that the bridge spent moving for any reason.
|
notifyDirtyState
getDrawMode, getLevel, setLevel
error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeInternal, onAggregatorVisibilityChanged, postInitialize
public OverheadCraneBridge()
@AnyLogicInternalCodegenAPI public OverheadCraneBridge(double bridgeLocation, double trolleyLocation, java.awt.Color bridgeColor)
public void setBridgeColor(java.awt.Color bridgeColor)
bridgeColor
- - specified color of the bridgepublic java.awt.Color getBridgeColor()
public void moveTo(Point absolutePoint, double safeHeight, boolean remainsAtTarget)
absolutePoint
- - the point to move to. Should be accessible by bridge and consider neighbor bridges (see canArriveAt(Point)
).safeHeight
- - safe height in meters from crane's Z coordinate. May be negative or even -infinity
. If bridge has attached agent, agent's height will be considered automatically.remainsAtTarget
- - set true
if you want the bridge to remain it's position while it awaits further commands.
Use false
if you want the bridge to become idle on target reach. Idle bridges may be pushed by another bridges.public void moveByProgram(CraneProgram program)
program
- - program to move crane by. Cannot be null.public CraneProgram getProgram()
public OverheadCrane getCrane()
public java.util.List<OverheadCraneBridge> getBridgesOnRouteTo(Point absolutePoint)
absolutePoint
- - destination point. Should be accessible by the bridge. Otherwise an exception will occur.public BridgeDirection getDirection()
Possible values are:
public double getDistanceTo(Point absolutePoint, LengthUnits units)
absolutePoint
- - point in pixelsunits
- - units to measure distancepublic double getDistanceToTarget(LengthUnits units)
getDistanceTo(Point, LengthUnits)
with getTargetPoint()
as destination point.absolutePoint
- - point in pixelsunits
- - units to measure distancepublic java.util.List<Agent> getAgentsInQueue()
public double getCurrentBridgeOffset(LengthUnits units)
units
- - length unitspublic double getCurrentTrolleyOffset(LengthUnits units)
units
- - length unitspublic double getCurrentHookOffset(LengthUnits units)
units
- - length unitspublic OverheadCraneBridgeState getState()
Possible values are:
public int numberOfAgentsHandled()
@AnyLogicInternalAPI public int numberOfConflicts()
public double getUtilization()
getUtilization
in class Crane<Agent>
public double totalTravelledDistance(LengthUnits units)
units
- - length unitspublic double totalTravelledDistance()
public double totalTransportationDistance()
public double totalTransportationDistance(LengthUnits units)
units
- - length unitspublic double totalDistanceInConflict()
public double totalDistanceInConflict(LengthUnits units)
units
- - length unitspublic double totalTravellingTime(TimeUnits units)
units
- - time unitspublic double totalTravellingTime()
public double averageCycleTime(TimeUnits units)
units
- - time unitspublic double averageCycleTime()
public double timeInState(OverheadCraneBridgeState state, TimeUnits units)
state
- - one of OverheadCraneBridgeState
units
- - time unitspublic double timeInState(OverheadCraneBridgeState state)
state
- - one of OverheadCraneBridgeState
public double totalTimeInConflicts(TimeUnits units)
units
- - time unitspublic double totalTimeInConflicts()
public Agent getAgent()
public double getPriority()
public void attachAgentAnimation(Agent agent)
detachAgentAnimation()
.agent
- - the agent to attach to hook.public void detachAgentAnimation()
attachAgentAnimation(Agent)
.public Position getHookPosition()
public Position getBridgePosition()
public Position getTrolleyPosition()
public boolean canArriveAt(Point hookDestination)
true
if the hook can reach specified point. And false
otherwise.hookDestination
- - absolute point in pixels.true
if the hook can reach specified point. And false
otherwise.public int getIndex()
MarkupShape.initialize()
call based on bridge's position. The index cannot be changed afterwards.@AnyLogicInternalAPI public Point getInitialHookPoint(LengthUnits units)
Crane
getInitialHookPoint
in class Crane<Agent>
units
- - a constant defining the length unitsLengthUnits
@AnyLogicInternalAPI public Point getInitialHookPoint()
Crane
getInitialHookPoint
in class Crane<Agent>
public double getInitialTrolleyOffset(LengthUnits units)
units
- - a constant defining the length unitspublic double getInitialHookOffset(LengthUnits units)
units
- - a constant defining the length unitspublic double getInitialBridgeOffset(LengthUnits units)
units
- - a constant defining the length unitspublic void setInitialTrolleyOffset(double trolleyOffset, LengthUnits units)
trolleyOffset
- - the new position of the bridge's trolleyunits
- - a constant defining the length unitspublic void setInitialHookOffset(double hookOffset, LengthUnits units)
hookOffset
- - the new height of the bridge's hookunits
- - a constant defining the length unitspublic void setInitialBridgeOffset(double bridgeOffset, LengthUnits units)
bridgeOffset
- - the new position of the bridgeunits
- - a constant defining the length unitspublic void fail()
failed
statepublic void repair()
failed
state@AnyLogicInternalAPI public void onFailed()
onFailed()
callback code@AnyLogicInternalAPI public void onRepaired()
onRepaired()
callback codeonRepaired
in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
onRepaired
in class Crane<Agent>
public boolean isFailed()
true
if the bridge is failed and false
otherwise.public boolean isReady()
true
if bridge is ready to operate, i.e. idle and not failed.public void resetStats()
resetStats
in class Crane<Agent>
@AnyLogicInternalAPI public void onLoading(Agent agent)
@AnyLogicInternalAPI public void onUnloading(Agent agent)
onUnloading
in class Crane<Agent>
@AnyLogicInternalAPI public Position getAbsoluteHookPosition()
Position
in pixels. Also updates animation.
Position.rotation
contains the rotation of crane.getAbsoluteHookPosition
in class Crane<Agent>
Position.rotation
@AnyLogicInternalAPI public double getCraneHeight()
getCraneHeight
in class Crane<Agent>
@AnyLogicInternalAPI public double getCraneHeight(LengthUnits units)
getCraneHeight
in class Crane<Agent>
public Point getTargetPoint()
@AnyLogicInternalAPI public double getStatisticsStartTime()
getStatisticsStartTime
in class Crane<Agent>
public boolean contains(double px, double py)
MarkupShape
contains
in class MarkupShape
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's containertrue
if the shape contains the point with the given
coordinatespublic void setXYZ(Point point)
Crane
public void setX(double x)
Crane
public void setY(double y)
Crane
public void setZ(double z)
Crane
public Point getXYZ()
Crane
public double getX()
Crane
public double getY()
Crane
Copyright © AnyLogic North America, LLC. All Rights Reserved.