AnyLogic
Expand
Font size

Turn station

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 can serve as an obstacle on the way of pedestrians and transporters moving in the free space navigation mode.

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

If you simply need to transfer material items to another conveyor, you should use either of the following elements:

  • Transfer Table — connects up to 4 conveyors at right angle (90°). Material items keep their current orientation in space.
  • Turntable — connects unlimited number of conveyors at any required angle. Material items do not change their orientation on the conveyor.

The time required to switch to another conveyor depends on the defined Rotation speed of the turn station.

The width of the turn station is automatically adjusted once you change the width of the conveyor.

Conveyor expects items of the same type after the turn station.

To draw a turn station

  1. Drag the Turn station element from the Space Markup section of the Material Handling Library palette to the agent diagram and place it either at any desired location of the graphical editor or over a straight conveyor.
    You can place the turn station over the straight segment of a conveyor only.
  2. Release the mouse button when done. You may change the element’s location by dragging it along the conveyor.
    The turntable element divides the conveyor once placed on it.

To adjust position of a turn station

  1. Click the turn station you need to edit.
  2. Drag the turn station to the desired position on the current conveyor. The connected conveyors will adjust their shapes in accordance with the turn station’s new position.

Properties

General

Name — The name of this turn station. The name is used to identify and access the element from code and Material Handling Library blocks' properties.

Ignore — If selected, the turn station is excluded from the model.

Visible on upper agent — If selected, the turn station is also visible on the upper agent where this agent lives.

Lock — If selected, the turn station is locked. Locked shapes do not react to mouse clicks — it is impossible to select them in the graphical editor until you unlock them.

Visible — Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.

Material item type — The type of the material item that is processed at this turn station. This type is automatically taken from the conveyor this turn station is located on. Do not change the material item type since the conveyor expects items of the same type after the turn station.

Is obstacle — If selected, this turn station will be considered an obstacle for pedestrians and transporters moving in free space mode.

Rotate — The rotation mode that will be used to rotate agents (material items).

  • By the given angle — the agent (material item) will be rotated by the specified Angle, which must be divisible by 90°.
  • To achieve orientation — rotates the agent (material item), to achieve the defined orientation on the conveyor.

Rotate by — [Visible if Rotate: By the given angle] The agent will be rotated by this angle.

Orientation — [Visible if Rotate: To achieve orientation] Sets the side of the agent (material item) that must be facing the direction of travel:

  • Front
  • Rear
  • Left
  • Right

Speed — The speed at which the turn station moves the agents (material items).

Rotation speed — The speed of turn station rotation.

Actions

In all the actions, the current material item is accessible as the local variable agent.

On leading edge enter — Here you can type Java code that will be executed when the leading edge of the material item reaches the turn station on the conveyor.

On trailing edge enter — Here you can type Java code that will be executed when the trailing edge of the material item reaches the turn station.

On leading edge exit — Here you can type Java code that will be executed when the leading edge of the material item leaves the turn station.

On trailing edge exit — Here you can type Java code that will be executed when the trailing edge of the material item leaves the turn station.

On failed — Here you can type Java code that will be executed in case of turn station failure.

On repaired —  Here you can type Java code that will be executed when the turn station is repaired.

Appearance

Fill color — Shape’s fill color. Choose No color, if you do not want the area to be filled.

Line color — Outline color. Choose No color, if you do not want outline to be drawn.

Position and size

X — X-coordinate of the area’s start point.

Y — Y-coordinate of the area’s start point.

Z — Z-coordinate of the area’s start point. On the turn station placement on the conveyor with specified Z-height, this value will automatically match the Z-coordinate value of the conveyor.

Advanced

Show in — Here you can choose whether you want the shape to be shown both in 2D and 3D animation, or in 2D only, or in 3D only.

Show name — If selected, the shape name is displayed on the graphical diagram.

Functions

Speed and type of rotation
Function Description
double getSpeed(SpeedUnits units) Returns the speed of the turn station in the specified speed units.

units — a constant defining the speed units
double setSpeed(double speed, SpeedUnits units) Sets the new speed of the turn station in the specified speed units.

speed — a new speed value
units — a constant defining the speed units
double getRotationSpeed(RotationSpeedUnits units) Returns the turn station’s speed (in the specified time units).

units — a constant defining the time units
double setRotationSpeed(double rotationSpeed, RotationSpeedUnits units) Sets the turn station’s rotation speed (in the specified speed units) when switching from one conveyor to another.

rotationSpeed — a new speed value
units — a constant defining the speed units
ConveyorTurnStationMode getMode() Returns the turn station’s rotation mode.
double 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
Level
Function Description
Level getLevel() Returns the level on which this turn station is located.
Obstacle
Function Description
boolean isObstacle() Returns true if this turn station is considered an obstacle by pedestrians and transporters moving in free space mode. Otherwise, returns false.
void setObstacle(boolean isObstacle) Sets this turn station as an obstacle for pedestrians and transporters moving in free space mode.

isObstacle — if true, the turn station is set as an obstacle. Otherwise, not.
Agents (material items)
Function Description
int size() Returns the current number of agents (material items) on the turn station, returns null if none.
T getAgent() Returns the agent (material item) that is currently located on the turn station, returns null if none.
List<T> getAgents() Returns the list of agents (material items) that are currently located on the turn station, returns null if none.
boolean contains(Agent agent) Returns true is the given agent (material item) is on the turn station, returns false otherwise.
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. If the agent was removed successfully, returns true, otherwise returns false.

agent — the agent (material item) to be removed from the turn station
Conveyors and network
Function Description
List getIncomingPaths() Returns the list of all incoming conveyors, i.e. the conveyors, transferring agents (material items) to the turn station, returns null if none.
List getOutgoingPaths() Returns the list of all outgoing conveyors, i.e. the conveyors, accepting agents (material items) from the turn station, returns null if none.
ConveyorPath getConnection(int index) Returns conveyor connected to the turn station by the provided index.

index — the connection index
List getConnections() Returns the list of conveyors connected to the turn station, returns null if none.
int getConnectionsCount() Returns the number of conveyors connected to the turn station, returns null if none.
ConveyorNetwork getNetwork() Returns the network the turn station belongs to.
Failure / repair
Function Description
boolean isFailed() Returns true if the turn station failed (broke down) and is not operating, returns false otherwise.
boolean fail() Initiates turn station failure. The turn station stops.
boolean repair() Repairs the turn station, makes it available again.
Visibility
Function Description
boolean isVisible() Returns true if the turn station is visible; returns false otherwise.
void setVisible(boolean v) Sets the visibility of the turn station.

v — visibility. If v is true — the turn station is set to be visible, if it is false — not visible.
Color / texture
Function Description
Color getLineColor() Returns the line color of the turn station, or null if the turn station has no color or uses a texture (in this case use getLineTexture() to get the turn station’s texture).
Texture getLineTexture() Returns the line texture of the turn station or null if the turn station has no texture but uses a color (in this case use getLineColor() to get the turn station’s color).
void setLineColor(Color lineColor) Sets the line color of the turn station.

lineColor — the new color
void setLineColor(Paint lineColor) Sets the line color (or texture) of the turn station.

lineColor — the new texture
Color getFillColor() Returns the fill color of the turn station, or null if shape has no fill color or has textured fill (in this case getFillTexture() should be used instead)
Texture getFillTexture() Returns the fill texture of the turn station, if the turn station has fill texture, or null if the turn station has no texture but uses a color (in this case use getFillColor() to get the turn station’s color).
void setFillColor(Color fillColor) Sets the fill color of the turn station.

fillColor — the new fill color, if null, the turn station is not filled
void setFillColor(Paint fillColor) Sets the fill color (or Texture) of the shape.

fillColor — the new fill color, if null, the shape is not filled
Position
Function Description
double getX() Returns the X coordinate of the center point of the turn station.
double getY() Returns the Y coordinate of the center point of the turn station.
double getZ() Returns the Z coordinate of the center point of the turn station.
Point getXYZ(Point out) Returns the (X, Y, Z) coordinates of the center point of the given turn station

out — the output Point object to write the result to. The object may be null.
Removal
Function Description
void remove() Removes the turn station from the presentation. If the turn station is not a part of presentation, the function does nothing.
Removal from the presentation does not necessarily mean removing from the model logic, since logical networks and routes may have been created before the removal and survive it.
How can we improve this article?