Conveyor


Conveyor is the space markup shape that graphically defines a conveyor. You simulate how material items are transported by conveyors using the AnyLogic Material Handling Library blocks Convey, ConveyorEnter and ConveyorExit.

Several conveyors can be connected together. Altogether they compose a conveyor network. In the conveyor network, movement is always performed along the shortest conveyor between the origin and the destination nodes. 

Conveyor starts with the defined initial speed and accelerates to the defined maximum speed, keeping it until stops.

Unlike many other space markup elements that just define the element's location and size graphically, the conveyor element also provides users with a set of actions, which are used to define additional agent behavior. 

Conveyor types

By default the roller conveyor is used, but if required you can set it to be of any available type:

Conveyor knows all material items that are located on it, and you can obtain them using the conveyor API.

Demo model: Cross Belt Conveyor

Drawing a conveyor 

 To draw a conveyor

  1. Double-click the  Conveyor element in the  Space Markup palette. The icon of the element should turn into . It means that the drawing mode is activated and now you can draw conveyor in the graphical editor point by point.
  2. Click in the graphical editor to draw the first point of the conveyor. Do more clicks to add more points.
  3. To draw a curved segment, press the left mouse button at the conveyor's next turning point, move the mouse with the left mouse button being pressed until you get the segment of the required shape. Release the mouse button when finished adjusting the form of the conveyor segment.
  4. Put the final point of the conveyor with the double-click.

Conveyor may contain any number of linear and/or curved segments. You can continue drawing the conveyor after you finished it with the double-click, and edit the conveyor by making segments linear or curved.

 To connect two conveyors

  1. Draw the first conveyor by double-clicking  Road in the  Space Markup palette, then adding the starting point of the conveyor with a mouse click, and finally placing the final point of the conveyor with a double-click.
  2. In the same way start drawing the second conveyor. Place its starting point in the empty spot of the graphical editor nearby the first conveyor.
  3. Drag your mouse over the first conveyor. it to place the final point. When moving the mouse over the certain points of conveyor, you will see cyan points indicating that connection is possible.
  4. Put the final point of the conveyor with the double-click. The two conveyors will connect and a new markup element will be created in the point of connection. The type of a new element depends on the type of connection you made:

Properties

General

Name – The name of the conveyor. The name is used to identify and access the conveyor from code and flowchart blocks properties.

Ignore – If selected, the conveyor is excluded from the model.

Visible on upper level – If selected, the conveyor is also visible on the upper level where this agent lives.

Lock – If selected, the conveyor 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 transferred by this conveyor. Do not change the material item type at any type of stations, turntable, or turn station, since the conveyor expects items of the same type after these markup elements.

Type – The type of the conveyor: Roller, Belt or Fixed cell

Maximum speed – The maximum speed of the conveyor. The value must be non-negative. If both the maximum speed and the initial speed are equal to zero, the conveyor will not start movement. Conveyor will only start accelerating when positive maximum speed is assigned to it by calling the setMaxSpeed(double speed, SpeedUnits units) method.

Initial speed – The initial speed of the conveyor. It must be >=0. If initial speed is less than maximum speed, the conveyor will start accelerating to its maximum speed.

Acceleration – The acceleration of the conveyor.

Deceleration – The deceleration of the conveyor.

Cell size – [Visible and applies only if Type is set to Fixed cell] The size of the cell on the fixed cell conveyor.

Gap – The minimum required gap between the material items on this conveyor (or cells if it is the Fixed cell conveyor type).

Priorities

Main conveyor – If selected, this conveyor is the magistral conveyor, i.e. it has the greater priority over other conveyors connected to it.

Priority – [Visible and applied only if the Main conveyor property is not set] Sets the priority of ths conveyor on the current connection. The priority does not apply to the whole conveyor network. If required, priority should be defined for each connection. 

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 enters the conveyor.

On trailing edge enter – Here you can type Java code that will be executed when the trailing edge of the material item enters the conveyor.

On leading edge exit – Here you can type Java code to be executed at the moment the leading edge of the material item exits the conveyor.

On trailing edge exit – Java code to be executed when the trailing edge of the material item exits the conveyor.

On started – Here you can type Java code that will be executed when the conveyor starts movement as the result of either the conveyor's start() function call or conveyor repair.

On stopped – Here you can type Java code that will be executed when the conveyor either stops as the result of either the conveyor's stop() function call or the conveyor failure.

On failed – Here you can type Java code that will be executed at the moment of the conveyor failure.

On repaired – Here you can type Java code that will be executed at the moment of the conveyor repair.

Appearance

Line color – The conveyor color.

Draw stands – If selected, conveyor stands will be drawn in 3D mode. Stands are drawn to the conveyor from the ground level or from Z level.

... from Z level – [Visible and applies only if the Draw stands property is selected] Defines the Z level from which the stands will be drawn, where 0 is the ground level.

Position and size

X – X-coordinate of the conveyor's start point.

Y – Y-coordinate of the conveyor's start point.

Z – [Enabled if Show in: 2D and 3D or 3D only options are selected] Z-coordinate of the conveyor's start point. 

Width – The width of the conveyor. The new value will affect the shape of the markup elements located on this conveyor.

Points

The table located in the Points property section enables users to view and adjust coordinates of the conveyor turning points.  

Here you define relative coordinates, not the absolute ones. The first point always has coordinates (0, 0, 0) that can not be changed.
Other rows of the table define relative coordinates of the successive points. Coordinates of each point are actually offsets of the corresponding point from the start point along X, Y (and optionally Z) axes correspondingly.

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

You can dynamically modify the conveyor properties at model runtime using the following API.
Control, speed

Function

Description

boolean isStopped()

Returns true if the conveyor is currently stopped, false otherwise.

double stop()

Stops the conveyor. 

double run()

Launches the conveyor.

double getCurrentSpeed(SpeedUnits units)

Returns the current speed of the conveyor in the specified speed units.

Parameter:
units
- a constant defining the speed units

double getMaxSpeed(SpeedUnits units)

Returns the maximum speed of the conveyor in the specified speed units.

Parameter:
units
- one of the speed unit constants

double setMaxSpeed(double speed, SpeedUnits units)

Sets the new maximum speed of the conveyor in the specified speed units.

Parameter:
speed - a new maximum speed value
units - a constant defining the speed units

double getInitialSpeed(SpeedUnits units)

Returns the initial speed of the conveyor in the specified speed units.

Parameter:
units - a constant defining the speed units


Acceleration, deceleration

Function

Description

double getAcceleration(AccelerationUnits units)

Returns the acceleration of the conveyor in the specified acceleration units.

Parameter:
units
- one of the acceleration unit constants.

double setAcceleration
(double acceleration, AccelerationUnits units)

Sets the new acceleration for the conveyor in the specified acceleration units.

Parameters:
acceleration - the new acceleration value.
units - one of the acceleration unit constants.

double getDeceleration(AccelerationUnits units)

Returns the deceleration of the conveyor in the specified acceleration units.

Parameter:
units
- one of the acceleration unit constants.

double setDeceleration
(double deceleration, AccelerationUnits units)

Sets the new deceleration for the conveyor in the specified acceleration units.

Parameters:
deceleration - the new deceleration value.
units - one of the acceleration unit constants.


Conveyor and network

Function

Description

ConveyorType getType()

Returns the type of this conveyor.  Valid values are: CONVEYOR_TYPE_ROLLER, CONVEYOR_TYPE_BELT, CONVEYOR_TYPE_CELL.

boolean isAccumulating()

Returns true if the conveyor can accumulate objects, false otherwise.

boolean isMainConveyor()

Returns true if the conveyor has the priority of the main conveyor.

ConveyorNode getSource()

Returns the source node of the conveyor. The source node is the beginning of the conveyor.

ConveyorNode getTarget()

Returns the target node of the conveyor. The target node is the end of the conveyor.

ConveyorNode getotherNode()

Returns the second (other) node of the conveyor.

ConveyorNetwork getNetwork()

Returns the network the conveyor belongs to.

Gaps

Function

Description

double getGap(LengthUnits units)

Returns the minimum required gap between material items of this conveyor (in the specified length units).

Parameter:
units
- one of the length unit constants.


Agents

Function

Description

int size()

Returns the number of agents currently being conveyed.

List getAgents()

Returns the list of agents (material items) that are currently conveyed, returns null if none. 

boolean contains(Agent agent)

Returns true if the conveyor currently contains the specified agent, false otherwise.

Parameter: agent - the agent

T getAgent(int index)

Returns the agent at a given position (counted from 0, from the exit). Throws error in case of invalid (or out-of-bounds) index.

Parameter: index - the index of the agent

boolean removeAgent(Agent agent)

Removes the given agent from the conveyor. The agent will be removed only if it is currently located on the conveyor.

If the agent was removed successfully, returns true, otherwise returns false.

Parameter: agent - the agent (material item) to be removed from the conveyor.


Failure / repair

Function

Description

boolean isFailed()

Returns true if the conveyor is currebtly failed, returns false otherwise.

boolean fail()

Initiates conveyor failure. The conveyor stops processing.

boolean repair()

Repairs conveyor, makes it available again. Resumes its processing.

Size

Function

Description

double length()

Returns the length of the conveyor (in pixels) calculated in 3D space.

double getWidth(LengthUnits units)

Returns the width of the conveyor (in the specified length units) calculated in 3D space.

Parameter: 
units - a constant defining the length units

double getCellSize(LengthUnits units)

Returns the length of the conveyor's cell in the specified length measurement units.

Parameter: 
units - a constant defining the length units


Points

Function

Description

Point getStartPoint()

Returns the Point object with coordinates of the conveyor's starting point.

Point getEndPoint()

Returns the Point object with coordinates of the conveyor's ending point.

Point randomPointInside()

Returns conveyor's random Point object for agent placement.

Position getStartPosition()

Returns the Position object with coordinates and orientation of the conveyor's starting point.

Position getEndPosition()

Returns the Position object with coordinates and orientation of the conveyor's ending point.

boolean containsSq(double px, double py, double squareDistance)

Returns true if the conveyor contains the point with the given coordinates using the given square distance tolerance; returns false otherwise.

Parameters:
px - the X-coordinate of the point.
py - the Y-coordinate of the point.
squareDistance - the square of distance tolerance to determine whether the given point lies within the markup element line proximity.

Returnstrue if the shape contains the point with the given coordinates.

Position getPositionAtOffset(double offset, Position out)

Returns the Position object with coordinates and orientation of the point that is located at the given offset distance (in pixels) from the conveyor's starting point.

Parameters:
offset - offset, non-negative value, should be less or equal to the full length.
out - output object to write to, may be null.

Position getPositionAtOffset(double offset,
LengthUnits units, Position out)

Returns the Position object with coordinates and orientation of the point that is located at the given offset distance from the conveyor's starting point.

Parameters:
offset - offset, non-negative value, should be less or equal to the full length.
units - one of the chosen length units.
out - output object to write to, may be null.

List getPositionsOnConveyor()

Returns the list of Position objects of this conveyor, returns null if none.

Segments

Function

Description

int getSegmentCount()

Returns the number of the conveyor's segments.

MarkupSegment getSegment
(int index)

Returns the segment by the provided index.

Parameter: index - the segment index, starting from zero up until the number of segments -1.


Visibility

Function

Description

boolean isVisible()

Returns true if the conveyor is visible; returns false otherwise.

void setVisible(boolean v)

Sets the visibility of the conveyor.

Parameter: v - visibility. If v is true - the conveyor is set to be visible, if it is false - not visible.


Сolor / texture

Function

Description

Color getLineColor()

Returns the color of the conveyor, or null if the conveyor has no color or uses a texture (in this case use getLineTexture() to get the conveyor's texture).

Texture getLineTexture()

Returns the texture of the conveyor or null if the conveyor has no texture but uses a color (in this case use getColor() to get the conveyor's color).

void setLineColor(Color color)

Sets the color of the conveyor.

Parameter: color - the new color.

void setLineColor(Paint color)

Sets the color (or texture) of the conveyor.

Parameter: color - the new texture.


Appearance

Function

Description

double getLineWidth()

Returns the width of the conveyor (in pixels). 

double getLineWidth(LengthUnits units)

Returns the width of the conveyor (in the specified length units). 

Parameter: units - one of the chosen length units.

void setLineWidth(double width)

Sets the width of the conveyor outline; 0 means the thinnest possible outline.

Parameter: width - the new width of the conveyor outline (in pixels).

void setLineWidth(double width, LengthUnits units)

Sets the width of the conveyor outline; 0 means the thinnest possible outline.

Parameters:
width - the new width of the conveyor.
units - one of the chosen length units.


Advanced

Function

Description

List getStations()

Returns the list of all stations of this conveyor, returns null if none. 

Movement direction

Conveyor transports agents (material items) only in one direction, from the conveyor's starting to its end point. The starting point is the point of the conveyor you draw first. 

The direction of the conveyor is indicated by arrows displayed on the conveyor shape. 

 To change the direction of the conveyor

  1. Right-click the conveyor in the graphical diagram and choose Change Direction from the context menu.
    You will see that the arrows on the conveyor changed their directions. 

Linear and curved conveyor segments

Refer to the video to learn how to draw the conveyor with linear and curved segments. While the video studies the curved walls drawing in AnyLogic, the process is exactly the same for conveyors.

How-To video: Drawing curved walls

 To add a linear segment while drawing a conveyor

  1. Just make a click.

 To add a curved segment while drawing a conveyor

  1. Press the left mouse button and do not release it. Move the mouse with the button being pressed. 
  2. Release the left mouse button when you got the segment of the required form.

To add a segment to the conveyor

  1. Right-click the conveyor you have drawn and select Append line from the context menu. You can append a line to any end point of the conveyor by clicking this point.
  2. You are now in the drawing mode. You can add as many new segments as you need, both linear and curved. 
  3. Put the final point of the conveyor with the double-click.
To make a curved segment linear
  1. Click a conveyor in the graphical editor to select it. 
  2. Press Ctrl button on your keyboard and hold it. At the same time drag end point of the curved segment.
  3. Release the buttons when the segment has the required shape.
To make a linear segment curved
  1. Right-click the conveyor and select Edit Using Guiding Lines from the context menu. The guiding lines will appear for editing points. Left-click an editing line point and drag it around without releasing the left mouse button. 
  2. Right-click the conveyor and deselect Edit Using Guiding Lines from the context menu to switch off this editing mode.