Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.Crane
- Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Methods inherited from interface com.anylogic.engine.markup.IMaintenanceableMarkup
- Constructor Details
- Method Details
- setBridgeColor
- getBridgeColor
- moveTo
- moveByProgram
- getProgram
- getCrane
- getBridgesOnRouteTo
- getDirection
- getDistanceTo
- getDistanceToTarget
- getAgentsInQueue
- getCurrentBridgeOffset
- getCurrentTrolleyOffset
- getCurrentHookOffset
- getState
- numberOfAgentsHandled
- numberOfConflicts
- getUtilization
- totalTravelledDistance
- totalTravelledDistance
- totalTransportationDistance
- totalTransportationDistance
- totalDistanceInConflict
- totalDistanceInConflict
- totalTravellingTime
- totalTravellingTime
- averageCycleTime
- averageCycleTime
- timeInState
- timeInState
- totalTimeInConflicts
- totalTimeInConflicts
- getAgent
- getPriority
- attachAgentAnimation
- detachAgentAnimation
- getHookPosition
- getBridgePosition
- getTrolleyPosition
- canArriveAt
- getIndex
- getInitialHookPoint
- getInitialHookPoint
- getInitialHookPoint
- getInitialTrolleyOffset
- getInitialHookOffset
- getInitialBridgeOffset
- setInitialTrolleyOffset
- setInitialHookOffset
- setInitialBridgeOffset
- fail
- repair
- isFailed
- isReady
- resetStats
- onLoading
- onUnloading
- getAbsoluteHookPosition
- getCraneHeight
- getCraneHeight
- getTargetPoint
- getStatisticsStartTime
- contains
- setXYZ
- setX
- setY
- setZ
- getXYZ
- getX
- getY
- getZ
- getDowntimeBlocks
- restartMaintenanceTriggers
- startMaintenanceManually
- stopMaintenanceManually
- isMaintenanceActive
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkup
- com.anylogic.engine.markup.MarkupShape
- com.anylogic.engine.markup.AbstractLevelMarkup
- com.anylogic.engine.markup.Crane<Agent>
- com.anylogic.engine.markup.OverheadCraneBridge
- All Implemented Interfaces:
IMaintenanceable
,AggregatableAnimationElement
,HasLevel
,IMaintenanceableMarkup
,LevelElement
,LevelMarkup
,com.anylogic.engine.markup.material_handling.IMaterialFallible
,SVGElement
,Serializable
public class OverheadCraneBridge extends Crane<Agent> implements com.anylogic.engine.markup.material_handling.IMaterialFallible, IMaintenanceableMarkup
- See Also:
- Serialized Form
Constructor | Description |
---|---|
OverheadCraneBridge() | |
OverheadCraneBridge |
Modifier and Type | Method | Description |
---|---|---|
void | attachAgentAnimation |
Attaches agent's position to the hook coordinates.
|
double | averageCycleTime() |
Returns average agent operation time in model time units.
|
double | averageCycleTime |
Returns average agent operation time in specified time units.
|
boolean | canArriveAt |
Returns
true if the hook can reach specified point. |
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
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.
|
List<Agent> | getAgentsInQueue() |
Returns list of agents that represents bridge's own queue.
|
Color | getBridgeColor() |
Returns the color of the bridge
|
Position | getBridgePosition() |
Returns coordinates of bridge's center.
|
List<OverheadCraneBridge> | getBridgesOnRouteTo |
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 | |
double | getCurrentBridgeOffset |
Returns current bridge offset in specified units (from left to right for crane with zero rotation).
|
double | getCurrentHookOffset |
Returns current hook height in specified units.
|
double | getCurrentTrolleyOffset |
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 |
Returns bridge's distance to specified point.
|
double | getDistanceToTarget |
Returns bridge's distance to current target.
|
IDowntime<?>[] | getDowntimeBlocks() | |
Position | getHookPosition() |
Returns hook's coordinates.
|
int | getIndex() |
Returns bridge index.
|
double | getInitialBridgeOffset |
Returns the initial offset of the bridge in the specified length units.
|
double | getInitialHookOffset |
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 |
Returns the initial hook point in the specified length units.
|
Point | getInitialHookPoint | |
double | getInitialTrolleyOffset |
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 | isMaintenanceActive | |
boolean | isReady() |
Returns
true if bridge is ready to operate, i.e. |
void | moveByProgram |
Orders the bridge to move by program.
|
void | moveTo |
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 | onLoading | |
void | onUnloading | |
void | repair() |
Repairs the bridge from
failed state |
void | resetStats() |
Resets the crane utilization statistics.
|
void | restartMaintenanceTriggers | |
void | setBridgeColor |
Sets the specified color of the bridge
|
void | setInitialBridgeOffset |
Sets the initial bridge position in the specified length units.
|
void | setInitialHookOffset |
Sets the initial hook height in the specified length units.
|
void | setInitialTrolleyOffset |
Sets the initial trolley position in the specified length units.
|
void | setX |
Sets the X coordinate of this crane
|
void | setXYZ |
Places the crane into the argument point location
|
void | setY |
Sets the Y coordinate of this crane
|
void | setZ |
Sets the Z coordinate of this crane
|
void | startMaintenanceManually | |
void | stopMaintenanceManually | |
double | timeInState |
Returns total time in model time units spent by the bridge in the given state.
|
double | timeInState |
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 |
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 |
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 |
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 |
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 |
Returns total time in specified time units that the bridge spent moving for any reason.
|
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
public OverheadCraneBridge()
@AnyLogicInternalCodegenAPI public OverheadCraneBridge(double bridgeLocation, double trolleyLocation, Color bridgeColor)
public void setBridgeColor(Color bridgeColor)
Sets the specified color of the bridge
- Parameters:
bridgeColor
- - specified color of the bridge
public Color getBridgeColor()
Returns the color of the bridge
- Returns:
- color of the bridge
public void moveTo(Point absolutePoint, double safeHeight, boolean remainsAtTarget)
Orders the bridge to move to specified point.
Note: this method should not conflict with bridge movement induced by blocks: SeizeCrane, MoveByCrane.
Otherwise an exception will occur.
- Parameters:
absolutePoint
- - the point to move to. Should be accessible by bridge and consider neighbor bridges (seecanArriveAt(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
- - settrue
if you want the bridge to remain it's position while it awaits further commands. Usefalse
if you want the bridge to become idle on target reach. Idle bridges may be pushed by another bridges.
public void moveByProgram(CraneProgram program)
Orders the bridge to move by program.
Note: this method should not conflict with bridge movement induced by blocks: SeizeCrane, MoveByCrane.
Otherwise an exception will occur.
- Parameters:
program
- - program to move crane by. Cannot be null.
public CraneProgram getProgram()
Returns clone of current bridge program.
The program may be modified. The modifications will not affect the bridge's current program.
Returned program may be used for any bridge.
- Returns:
- clone of bridge's current program
public OverheadCrane getCrane()
Returns the crane the bridge belongs to.
- Returns:
public List<OverheadCraneBridge> getBridgesOnRouteTo(Point absolutePoint)
Returns list of bridges that are currently located between the bridge and destination point.
- Parameters:
absolutePoint
- - destination point. Should be accessible by the bridge. Otherwise an exception will occur.- Returns:
- list of bridges that are currently located between the bridge and destination point.
public BridgeDirection getDirection()
Returns current direction of the bridge.
Possible values are:
- FORWARD - bridge is moving forward: offset increases (from left to right for crane with zero rotation)
- BACKWARD - bridge is moving forward: offset decreases (from right to left for crane with zero rotation)
- NONE - bridge is still at the moment
- Returns:
- current direction of the bridge.
public double getDistanceTo(Point absolutePoint, LengthUnits units)
Returns bridge's distance to specified point. Ignores trolley and hook movement.
- Parameters:
absolutePoint
- - point in pixelsunits
- - units to measure distance- Returns:
- bridge's distance to specified point.
public double getDistanceToTarget(LengthUnits units)
Returns bridge's distance to current target. Ignores trolley and hook movement.
The same result may be achieved via
getDistanceTo(Point, LengthUnits)
with getTargetPoint()
as destination point.- Parameters:
absolutePoint
- - point in pixelsunits
- - units to measure distance- Returns:
- bridge's distance to specified point.
public List<Agent> getAgentsInQueue()
Returns list of agents that represents bridge's own queue. The list is ordered by priority (from high to low).
List is modifiable but changes will not affect real queue.
- Returns:
- list of agents that represents bridge's own queue.
public double getCurrentBridgeOffset(LengthUnits units)
Returns current bridge offset in specified units (from left to right for crane with zero rotation).
- Parameters:
units
- - length units- Returns:
- current bridge offset in specified units (from left to right for crane with zero rotation).
public double getCurrentTrolleyOffset(LengthUnits units)
Returns current trolley offset in specified units (from top to bottom for crane with zero rotation).
- Parameters:
units
- - length units- Returns:
- current bridge offset in specified units (from top to bottom for crane with zero rotation).
public double getCurrentHookOffset(LengthUnits units)
Returns current hook height in specified units.
- Parameters:
units
- - length units- Returns:
- Returns current hook height in specified units.
public OverheadCraneBridgeState getState()
Returns the bridge's current state.
Possible values are:
- IDLE - the bridge has no tasks, may move to give way another bridge or stay still
- WAITING - the bridge stays unmovable awaiting further tasks
- LOADING - the bridge stays unmovable during agent loading in MoveByCrane block
- UNLOADING - the bridge stays unmovable during agent unloading in MoveByCrane block
- MOVING_UNLOADED - the bridge moves without any attached agent except movement to its parking position
- MOVING_LOADED - the bridge moves with attached agent
- MOVING_HOME - the bridge moves to its parking position
- FAILED - the bridge stays unmovable awaiting of repairment
- MAINTENANCE - the bridge stays unmovable during maintenance
- CUSTOM_DOWNTIME - the bridge stays unmovable durnig downtime
- Returns:
- the bridge's current state.
public int numberOfAgentsHandled()
Returns total number of agents that have been handled by the bridge.
- Returns:
- total number of agents that have been handled by the bridge.
@AnyLogicInternalAPI public int numberOfConflicts()
public double getUtilization()
Returns the bridge utilization: the fraction of time the crane was operating. The returned crane utilization value lies in the range [0..1].
- Specified by:
getUtilization
in classCrane<Agent>
public 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.
- Parameters:
units
- - length 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.
public 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.
- 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.
public double totalTransportationDistance()
Returns total distance in meters traveled by the bridge in MOVING_LOADED state.
- Returns:
- total distance in meters traveled by the bridge in MOVING_LOADED state.
public double totalTransportationDistance(LengthUnits units)
Returns total distance in specified length units traveled by the bridge in MOVING_LOADED state.
- Parameters:
units
- - length units- Returns:
- total distance in specified length units traveled by the bridge in MOVING_LOADED state.
public double totalDistanceInConflict()
Returns total distance in meters traveled by the bridge in any state while giving way to another bridge.
- Returns:
- total distance in meters traveled by the bridge in any state while giving way to another bridge.
public double totalDistanceInConflict(LengthUnits units)
Returns total distance in specified length units traveled by the bridge in any state while giving way to another bridge.
- Parameters:
units
- - length units- Returns:
- total distance in specified length units traveled by the bridge in any state while giving way to another bridge.
public double totalTravellingTime(TimeUnits units)
Returns total time in specified time units that the bridge spent moving for any reason.
- Parameters:
units
- - time units- Returns:
- total time in specified time units that the bridge spent moving for any reason.
public double totalTravellingTime()
Returns total time in model time units that the bridge spent moving for any reason.
- Returns:
- total time in model time units that the bridge spent moving for any reason.
public double averageCycleTime(TimeUnits units)
Returns average agent operation time in specified time units.
This statistics does not include the bridge's movement in manual mode.
- Parameters:
units
- - time units- Returns:
- average agent operation time in specified time units.
public double averageCycleTime()
Returns average agent operation time in model time units.
This statistics does not include the bridge's movement in manual mode.
- Returns:
- average agent operation time in model time units.
public double timeInState(OverheadCraneBridgeState state, TimeUnits units)
Returns total time in specified time units spent by the bridge in the given state.
- Parameters:
state
- - one ofOverheadCraneBridgeState
units
- - time units- Returns:
- total time in specified time units spent by the bridge in the given state.
public double timeInState(OverheadCraneBridgeState state)
Returns total time in model time units spent by the bridge in the given state.
- Parameters:
state
- - one ofOverheadCraneBridgeState
- Returns:
- total time in model time units spent by the bridge in the given state.
public 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.
- Parameters:
units
- - time units- Returns:
- total time in specified time units spent by the bridge giving way to other bridges or not moving to avoid collisions.
public double totalTimeInConflicts()
Returns total time in model time units spent by the bridge giving way to other bridges or not moving to avoid collisions.
- Returns:
- total time in model time units spent by the bridge giving way to other bridges or not moving to avoid collisions.
public Agent getAgent()
Returns the agent that have seized the bridge.
- Returns:
- the agent that have seized the bridge.
public double getPriority()
Returns current bridge's movement priority.
Note current state is principal to say what bridge will push another.
- Returns:
- current bridge's movement priority.
public void attachAgentAnimation(Agent agent)
Attaches agent's position to the hook coordinates.
Note: the method considers agent's height. The hook should be located in agent's dimensions (width, length, height).
Otherwise an exception will occur. Only one agent may be attached to hook. See
detachAgentAnimation()
.- Parameters:
agent
- - the agent to attach to hook.
public void detachAgentAnimation()
Detaches the agent that was previously attached to hook.
See
attachAgentAnimation(Agent)
.public Position getHookPosition()
Returns hook's coordinates.
- Returns:
- hook's coordinates.
public Position getBridgePosition()
Returns coordinates of bridge's center.
- Returns:
- coordinates of bridge's center.
public Position getTrolleyPosition()
Returns coordinates of trolley's center.
- Returns:
- coordinates of trolley's center.
public boolean canArriveAt(Point hookDestination)
Returns
true
if the hook can reach specified point. And false
otherwise.- Parameters:
hookDestination
- - absolute point in pixels.- Returns:
true
if the hook can reach specified point. Andfalse
otherwise.
public int getIndex()
Returns bridge index.
Note: The index is setted on
MarkupShape.initialize()
call based on bridge's position. The index cannot be changed afterwards.- Returns:
- bridge index.
@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 classCrane<Agent>
- Parameters:
units
- - a constant defining the length units- Returns:
- initial hook point in the specified
LengthUnits
@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 classCrane<Agent>
- Returns:
- initial hook point in pixels
@AnyLogicInternalAPI public Point getInitialHookPoint(Function<Double, Double> meterToPx)
public double getInitialTrolleyOffset(LengthUnits units)
Returns the initial offset of the bridge's trolley in the specified length units.
- Parameters:
units
- - a constant defining the length units- Returns:
- the initial offset of the bridge's trolley in the specified length units.
public double getInitialHookOffset(LengthUnits units)
Returns the initial offset of the bridge's hook in the specified length units.
- Parameters:
units
- - a constant defining the length units- Returns:
- the initial offset of the bridge's hook in the specified length units.
public double getInitialBridgeOffset(LengthUnits units)
Returns the initial offset of the bridge in the specified length units.
- Parameters:
units
- - a constant defining the length units- Returns:
- the initial offset of the bridge in the specified length units.
public void setInitialTrolleyOffset(double trolleyOffset, LengthUnits units)
Sets the initial trolley position in the specified length units.
- Parameters:
trolleyOffset
- - the new position of the bridge's trolleyunits
- - a constant defining the length units
public void setInitialHookOffset(double hookOffset, LengthUnits units)
Sets the initial hook height in the specified length units.
- Parameters:
hookOffset
- - the new height of the bridge's hookunits
- - a constant defining the length units
public void setInitialBridgeOffset(double bridgeOffset, LengthUnits units)
Sets the initial bridge position in the specified length units.
- Parameters:
bridgeOffset
- - the new position of the bridgeunits
- - a constant defining the length units
public void fail()
Sets the bridge to
failed
statepublic void repair()
Repairs the bridge from
failed
statepublic boolean isFailed()
Returns
true
if the bridge is failed and false
otherwise.public boolean isReady()
Returns
true
if bridge is ready to operate, i.e. idle and not failed.public void resetStats()
Resets the crane utilization statistics.
- Specified by:
resetStats
in classCrane<Agent>
@AnyLogicInternalAPI public void onLoading(Agent agent)
@AnyLogicInternalAPI public void onUnloading(Agent agent)
- Specified by:
onUnloading
in classCrane<Agent>
@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 classCrane<Agent>
- Returns:
- current absolute hook point in pixels with the rotation angle as
Position.rotation
@AnyLogicInternalAPI public double getCraneHeight()
- Specified by:
getCraneHeight
in classCrane<Agent>
@AnyLogicInternalAPI public double getCraneHeight(LengthUnits units)
- Specified by:
getCraneHeight
in classCrane<Agent>
public Point getTargetPoint()
Returns bridge's target point.
NB: if bridge has no tasks, current hook position will be returned.
- Returns:
- bridge's target point.
@AnyLogicInternalAPI public double getStatisticsStartTime()
- Specified by:
getStatisticsStartTime
in classCrane<Agent>
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 classMarkupShape
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's container- Returns:
true
if the shape contains the point with the given coordinates
public void setXYZ(Point point)
Description copied from class:
Crane
Places the crane into the argument point location
public void setX(double x)
Description copied from class:
Crane
Sets the X coordinate of this crane
public void setY(double y)
Description copied from class:
Crane
Sets the Y coordinate of this crane
public void setZ(double z)
Description copied from class:
Crane
Sets the Z coordinate of this crane
public Point getXYZ()
Description copied from class:
Crane
Returns the point location of this element
public double getX()
Description copied from class:
Crane
Returns the X coordinate of this crane
public double getY()
Description copied from class:
Crane
Returns the Y coordinate of this crane
public double getZ()
Description copied from class:
Crane
Returns Z-coordinate of this crane relative to crane's level
public IDowntime<?>[] getDowntimeBlocks()
- Specified by:
getDowntimeBlocks
in interfaceIMaintenanceableMarkup
@AnyLogicInternalAPI public void restartMaintenanceTriggers(IDowntime<?> block)
- Specified by:
restartMaintenanceTriggers
in interfaceIMaintenanceableMarkup
@AnyLogicInternalAPI public void startMaintenanceManually(IDowntime<?> block)
- Specified by:
startMaintenanceManually
in interfaceIMaintenanceableMarkup
@AnyLogicInternalAPI public void stopMaintenanceManually(IDowntime<?> block)
- Specified by:
stopMaintenanceManually
in interfaceIMaintenanceableMarkup
@AnyLogicInternalAPI public boolean isMaintenanceActive(IDowntime<?> block)
- Specified by:
isMaintenanceActive
in interfaceIMaintenanceableMarkup