AnyLogic AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, AnimationStaticLocationProvider, HasLevel, IMarkupLibraryDescriptor, INetworkMarkupElement, INode<ConveyorNode<?>,​ConveyorPath<?>>, com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T>, com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T>, com.anylogic.engine.markup.material_handling.IMaterialFallible, com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor, com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T>, SVGElement, java.io.Serializable

public class ConveyorTurnStation<T extends Agent>
extends ConveyorNode<T>
implements com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T>
Turn station is the graphical space markup element that is used to define turn stations. Turn station rotates agents (material items) passing through it. Items can be rotated by any angle divisible by 90°.

Once placed on a conveyor, the turn station divides it into two independent conveyors, working in the same conveyor network. Turn station can connect only two conveyors forming a straight line.

Turn station has its own transportation speed (it may differ from the speed of the connected conveyors).

See Also:
Serialized Form

Constructor Summary

Constructors 
ConveyorTurnStation()  
ConveyorTurnStation​(Agent owner, ShapeDrawMode drawMode, boolean isPublic)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
ConveyorTurnStation​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, boolean isObstacle, double x, double y, double z, java.awt.Paint fillColor, java.awt.Paint lineColor, com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T> descriptor, PathEnd<ConveyorPath<?>>... pathEnds)
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 
double angle​(T agent, AngleUnits units)  
boolean contains​(Agent agent)
Returns true is the given agent (material item) is on the turn station, returns false otherwise.
void fail()
Initiates turn station failure.
T getAgent​(int index)
Returns the agent (material item) that is currently located on the turn station.
java.util.List<T> getAgents()
Returns the list of agents (material items) that are currently located on the turn station.
com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T> getLibraryDescriptor()  
ConveyorTurnStationMode getMode()
Returns the turn station's rotation mode.
double getRotationSpeed​(RotationSpeedUnits units)
Returns the turn station's rotation speed (in the specified rotation units).
double getSpeed​(SpeedUnits units)
Returns the speed of the turn station in the specified speed units.
double getTransferDistance​(ConveyorPath<?> path1, ConveyorPath<?> path2)  
ConveyorPath<T> getTransition​(ConveyorPath<?> path)  
java.util.List<? extends ConveyorPath<T>> getTransitions()  
boolean isFailed()
Returns true if the turn station failed (broke down) and is not operating, returns false otherwise.
boolean isObstacle()
Returns true if this turnstation is considered an obstacle by transporters moving in free space mode.
void onFailed()  
void onLeadingEdgeEnter​(T agent)
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.

Callback action.
void onLeadingEdgeExit​(T agent)
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.

Callback action.
void onRepaired()  
void onTrailingEdgeEnter​(T agent)
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.

Callback action.
void onTrailingEdgeExit​(T agent)
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.

Callback action.
AgentOrientation orientation​(T agent)  
void postInitialize()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
boolean removeAgent​(Agent agent)
Removes the given agent from the turn station.
void repair()
Repairs the turn station, makes it available again.
void setMode​(ConveyorTurnStationMode mode)
Sets the turn station's rotation mode.
void setObstacle​(boolean isObstacle)
Sets this turnstation as an obstacle for transporters moving in free space mode.
void setRotationSpeed​(double rotationSpeed, RotationSpeedUnits units)
Sets the turn station's rotation speed (in the specified speed units) when switching from one conveyor to another.
void setSpeed​(double speed, SpeedUnits units)
Sets the new speed of the turn station in the specified speed units.
int size()
Returns the current number of agents (material items) on the turn station.
Modifier and Type Method Description

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

addConnection, contains, getCompatibleAgentExtensionClass, getConnection, getConnections, getConnectionsCount, getFillColor, getFillTexture, getIncomingPaths, getLineColor, getLineTexture, getNearestPoint, getNetwork, getOutgoingPaths, getPosition, getTransferPositionByPercent, getX, getXYZ, getY, getZ, randomPointInside, setFillColor, setFillColor, setLineColor, setLineColor, setXYZ

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

getLevel, setNetwork

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

error, getDrawMode, 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, updateDynamicProperties, 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.AnimationStaticLocationProvider

getSpace

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

getMarkup, setMarkup

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

getSpace, randomPointInside, randomPointInside, randomPointInside

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

getName

Constructor Detail

ConveyorTurnStation

public ConveyorTurnStation()

ConveyorTurnStation

@Deprecated
public ConveyorTurnStation​(Agent owner,
                           ShapeDrawMode drawMode,
                           boolean isPublic)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -

ConveyorTurnStation

@AnyLogicInternalCodegenAPI
@SafeVarargs
public ConveyorTurnStation​(Agent owner,
                           ShapeDrawMode drawMode,
                           boolean isPublic,
                           boolean isObstacle,
                           double x,
                           double y,
                           double z,
                           java.awt.Paint fillColor,
                           java.awt.Paint lineColor,
                           com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T> descriptor,
                           PathEnd<ConveyorPath<?>>... pathEnds)
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

getLibraryDescriptor

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

getTransition

@AnyLogicInternalCodegenAPI
public ConveyorPath<T> getTransition​(ConveyorPath<?> path)

getTransitions

@AnyLogicInternalCodegenAPI
public java.util.List<? extends ConveyorPath<T>> getTransitions()

postInitialize

@AnyLogicInternalAPI
public void postInitialize()
Description copied from interface: AggregatableAnimationElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
postInitialize in interface AggregatableAnimationElement
Overrides:
postInitialize in class ConveyorNode<T extends Agent>

getTransferDistance

public double getTransferDistance​(ConveyorPath<?> path1,
                                  ConveyorPath<?> path2)
Specified by:
getTransferDistance in interface INode<ConveyorNode<?>,​ConveyorPath<?>>

getSpeed

public double getSpeed​(SpeedUnits units)
Returns the speed of the turn station in the specified speed units.
Specified by:
getSpeed in interface com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T extends Agent>
Parameters:
units - - a constant defining the speed units
Returns:
the speed of the turn station

setSpeed

public void setSpeed​(double speed,
                     SpeedUnits units)
Sets the new speed of the turn station in the specified speed units.
Specified by:
setSpeed in interface com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T extends Agent>
Parameters:
speed - - a new speed value
units - - a constant defining the speed units

setRotationSpeed

public void setRotationSpeed​(double rotationSpeed,
                             RotationSpeedUnits units)
Sets the turn station's rotation speed (in the specified speed units) when switching from one conveyor to another.
Specified by:
setRotationSpeed in interface com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T extends Agent>
Parameters:
rotationSpeed - - a new speed value
units - - a constant defining the speed units

getRotationSpeed

public double getRotationSpeed​(RotationSpeedUnits units)
Returns the turn station's rotation speed (in the specified rotation units).
Specified by:
getRotationSpeed in interface com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T extends Agent>
Parameters:
units - - a constant defining the rotation units
Returns:
the turn station's rotation speed

setMode

public void setMode​(ConveyorTurnStationMode mode)
Sets the turn station's rotation mode.

Valid values:

  • TURN_STATION_MODE_ANGLE - the agent (material item) is rotated by the specified angle.
  • TURN_STATION_MODE_ORIENTATION - the agent's orientation is changed, making one of its four sides face the conveyor's travel direction.
Specified by:
setMode in interface com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T extends Agent>

getMode

public ConveyorTurnStationMode getMode()
Returns the turn station's rotation mode.
Specified by:
getMode in interface com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T extends Agent>
Returns:
the turn station's rotation mode.

angle

@AnyLogicInternalCodegenAPI
public double angle​(T agent,
                    AngleUnits units)
Specified by:
angle in interface com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T extends Agent>

orientation

@AnyLogicInternalCodegenAPI
public AgentOrientation orientation​(T agent)
Specified by:
orientation in interface com.anylogic.engine.markup.material_handling.IConveyorTurnStationDescriptor<T extends Agent>

size

public int size()
Returns the current number of agents (material items) on the turn station.
Specified by:
size in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Returns:
the current number of agents

getAgent

public T getAgent​(int index)
Returns the agent (material item) that is currently located on the turn station.
Specified by:
getAgent in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Parameters:
index - - the index
Returns:
the agent that is currently located on the turn station

getAgents

public java.util.List<T> getAgents()
Returns the list of agents (material items) that are currently located on the turn station.
Specified by:
getAgents in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Returns:
the list of agents

contains

public boolean contains​(Agent agent)
Returns true is the given agent (material item) is on the turn station, returns false otherwise.
Specified by:
contains in interface com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
Parameters:
agent - - the agent
Returns:
true is the given agent is on the turn station, returns false otherwise

removeAgent

public boolean removeAgent​(Agent agent)
Removes the given agent from the turn station. The agent will be removed only if it is currently located on the turn station.
Specified by:
removeAgent in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Parameters:
agent - - the agent (material item) to be removed from the turn station.
Returns:
If the agent was removed successfully, returns true, otherwise returns false.

onLeadingEdgeEnter

public void onLeadingEdgeEnter​(T agent)
Description copied from interface: com.anylogic.engine.markup.material_handling.IMaterialPointLocation
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.

Callback action.
Specified by:
onLeadingEdgeEnter in interface com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
Parameters:
agent - the agent.

onTrailingEdgeEnter

public void onTrailingEdgeEnter​(T agent)
Description copied from interface: com.anylogic.engine.markup.material_handling.IMaterialAreaLocation
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.

Callback action.
Specified by:
onTrailingEdgeEnter in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Parameters:
agent - the agent.

onLeadingEdgeExit

public void onLeadingEdgeExit​(T agent)
Description copied from interface: com.anylogic.engine.markup.material_handling.IMaterialAreaLocation
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.

Callback action.
Specified by:
onLeadingEdgeExit in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Parameters:
agent - the agent.

onTrailingEdgeExit

public void onTrailingEdgeExit​(T agent)
Description copied from interface: com.anylogic.engine.markup.material_handling.IMaterialPointLocation
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.

Callback action.
Specified by:
onTrailingEdgeExit in interface com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>
Parameters:
agent - the agent.

isFailed

public boolean isFailed()
Returns true if the turn station failed (broke down) and is not operating, returns false otherwise.
Specified by:
isFailed in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
Returns:
true if the turn station failed (broke down) and is not operating, returns false otherwise.

fail

public void fail()
Initiates turn station failure. The turn station stops.
Specified by:
fail in interface com.anylogic.engine.markup.material_handling.IMaterialFallible

repair

public void repair()
Repairs the turn station, makes it available again.
Specified by:
repair in interface com.anylogic.engine.markup.material_handling.IMaterialFallible

onFailed

public void onFailed()
Specified by:
onFailed in interface com.anylogic.engine.markup.material_handling.IMaterialFallible

onRepaired

public void onRepaired()
Specified by:
onRepaired in interface com.anylogic.engine.markup.material_handling.IMaterialFallible

isObstacle

public boolean isObstacle()
Returns true if this turnstation is considered an obstacle by transporters moving in free space mode. Otherwise, returns false.
Returns:
a flag that tells whether this turnstation is an obstacle or not

setObstacle

public void setObstacle​(boolean isObstacle)
Sets this turnstation as an obstacle for transporters moving in free space mode. The station should be uninitialized.
Parameters:
isObstacle - if true, the turnstation is set as an obstacle. Otherwise, not.
How can we improve this article?