AnyLogic
Expand
Font size

Class ConveyorPath<T extends Agent>

All Implemented Interfaces:
AggregatableAnimationElement, AnimationMovingLocationProvider, AnimationStaticLocationProvider, HasLevel, IMarkupLibraryDescriptor, INetworkMarkupElement, IPath<ConveyorNode<?>>, com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<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, java.lang.Iterable<MarkupSegment>

public class ConveyorPath<T extends Agent>
extends ConveyorMarkupElement<T>
implements IPath<ConveyorNode<?>>, java.lang.Iterable<MarkupSegment>, com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T>
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:

  • Roller - It is an accumulating type of a conveyor. If an agent is stopped on it, the rollers will keep on rolling, bringing all the preceding material items to the stopped one, thus forming a line of agents. The Gap parameter defines how close the material items can be pushed to each other. If the Gap is set to 0, collisions are inevitable.
  • Belt - It is not an accumulating type of a conveyor. If an agent is stopped, the whole conveyor stops to prevent collision of material items. The distance between the items is defined by the Gap parameter.
  • Fixed cell - It is not an accumulating type of a conveyor. The conveyor is a succession of cells of specified size. Agents are placed in the center of the conveyor cell. One conveyor cell can contain only one material item. The Gap parameter defines the distance between the conveyor cells. If an agent is stopped, the whole conveyor stops.
See Also:
Serialized Form

Constructor Summary

Constructors 
ConveyorPath()  
ConveyorPath​(Agent owner, ShapeDrawMode drawMode, boolean isPublic)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
ConveyorPath​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, boolean isObstacle, double widthInMeters, java.awt.Paint color, boolean drawStands, double standsLevel, com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> descriptor, ConveyorNode<?> source, ConveyorNode<?> target, MarkupSegment... segments)
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.
ConveyorPath​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, boolean isObstacle, double widthInMeters, java.awt.Paint color, boolean drawStands, double standsLevel, com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> descriptor, MarkupSegment... segments)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Default Methods Deprecated Methods 
void addSegment​(MarkupSegment segment)
Adds segment to this markup element
void changeDirection()
Changes current direction of this conveyor to the opposite
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.
boolean contains​(Agent agent)  
boolean containsSq​(double px, double py, double squareDistance)  
default NetworkPort createPort​(IPath<?> path, PathEndType endType)  
default NetworkPort createPort​(IPath<?> path, PathEndType endType, NetworkPort pairedPort)  
NetworkPort createPort​(PathEndType endType)
Creates and returns a Network Port located on specified conveyor's end
NetworkPort createPort​(PathEndType endType, NetworkPort pairedPort)
Creates and returns a Network Port located on specified conveyor's end and pairs created port with specified one
NetworkPort createPortInternal​(PathEndType endType)  
void fail()
Initiates conveyor failure.
double getAcceleration​(AccelerationUnits units)
Returns the acceleration of the conveyor in the specified acceleration units.
T getAgent​(double offset, LengthUnits units)  
T getAgent​(int index)
Returns the agent at a given position (counted from 0, from the exit).
java.util.List<T> getAgents()
Returns the list of agents (material items) that are currently conveyed
java.util.List<T> getAgents​(double offset, double length, LengthUnits units)  
BoundingRectangle getBoundingRectangle()  
double getCellSize​(LengthUnits units)  
double getCurrentAcceleration​(AccelerationUnits units)  
double getCurrentSpeed​(SpeedUnits units)
Returns the current speed of the conveyor in the specified speed units.
double getDeceleration​(AccelerationUnits units)
Returns the deceleration of the conveyor in the specified acceleration units.
ConveyorDirection getDirection()
Returns the direction of this conveyor
Point getEndPoint()
Returns the location of the end point
Point getEndPoint​(Point out)
Returns the location of the end point
Position getEndPosition()
Returns the end position
Position getEndPosition​(Position out)
Returns the end position
double getGap​(LengthUnits units)
Returns the minimum required gap between material items of this conveyor (in the specified length units).
double getInitialSpeed​(SpeedUnits units)
Returns the initial speed of the conveyor in the specified speed units.
com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> getLibraryDescriptor()  
java.awt.Color getLineColor()
Returns the line color of the markup element, or null if markup element has no line color or has textured line (in this case IPath.getLineTexture() should be used instead)
Texture getLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
double getLineWidth()
This method is internal and shouldn't be called by user.
it may be removed in future.
double getMaxSpeed​(SpeedUnits units)
Returns the maximum speed of the conveyor in the specified speed units.
double getNearestPoint​(Point givenPoint, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given point.
ConveyorNode<?> getOtherNode​(ConveyorNode<?> n)
Returns the second (other) node of the conveyor.
Position getPosition​(double value, double maxValue, Position out)
Returns position with offset corresponding to the given value, assuming that 0 is start and maxValue is end
Position getPosition​(int index, int totalNumber, Position out)
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
Position getPositionAtOffset​(double offset, LengthUnits units, Position out)
Returns the point (+rotations) located on the markup element with the given offset distance calculated from start point.
Position getPositionAtOffset​(double offset, Position out)
Returns the point (+rotations) located on the markup element with the given offset distance calculated from start point.
java.util.List<PositionOnConveyor<T>> getPositionsOnConveyor()
Returns the list of all PositionOnConveyor elements on this conveyor
MarkupSegment getSegment​(int index)
Returns the segment by its index
int getSegmentCount()
Returns the number of segments
ConveyorNode<?> getSource()
Returns the source node of the conveyor.
java.util.List<ConveyorSpur<T>> getSplitMerges()
Deprecated.
will be removed in the next release.
java.util.List<ConveyorSpur<T>> getSpurs()
Returns the list of conveyor spur elements of this conveyor.
double getStandsLevel()
Returns the base level Z-level to draw conveyor stands from.
Point getStartPoint()
Returns the location of the start point
Point getStartPoint​(Point out)
Returns the location of the start point
Position getStartPosition()
Returns the start position
Position getStartPosition​(Position out)
Returns the start position
java.util.List<ConveyorStation<T>> getStations()
Returns the list of all stations of this conveyor.
ConveyorNode<?> getTarget()
Returns the target node of the conveyor.
ConveyorType getType()
Returns the type of this conveyor.
double getWidth​(LengthUnits units)
Returns the width of this conveyor
boolean isAccumulating()
Returns true if the conveyor can accumulate objects, false otherwise.
boolean isBidirectional()
Returns the 'bidirectional' property (true by default).
boolean isChangingDirection()
Returns true if this conveyor is in the process of changing direction, returns false otherwise
boolean isDrawStands()
Returns true if this conveyor is drawn with stands
boolean isFailed()
Returns true if the conveyor is currently failed, returns false otherwise.
boolean isMaximumPriority()
Returns true if the conveyor has the greatest priority.
boolean isObstacle()
Returns true if this conveyor is considered an obstacle by transporters moving in free space mode.
boolean isReversible()
Returns the 'reversible' property (false by default).
boolean isStopped()
Returns true if the conveyor is currently stopped, false otherwise.
java.util.Iterator<MarkupSegment> iterator()
Creates and returns read-only iterator over segments
double length()
Returns the length of markup element, used e.g.
double length​(LengthUnits units)
Returns the length of markup element, used e.g.
void onDirectionChanged​(java.util.List<T> agents)  
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 onMotionChanged()  
void onRepaired()  
void onStarted()  
void onStopped()  
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.
double priority​(T agent)  
Point randomPointInside​(java.util.Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
boolean removeAgent​(Agent agent)
Removes the given agent from the conveyor.
void repair()
Repairs conveyor, makes it available again.
void run()
Launches the conveyor.
void setAcceleration​(double acceleration, AccelerationUnits units)
Sets the new acceleration for the conveyor in the specified acceleration units.
void setBidirectional​(boolean bidirectional)
Sets the 'bidirectional' property (true by default).
void setCellSize​(double size, LengthUnits units)  
void setDeceleration​(double deceleration, AccelerationUnits units)
Sets the new deceleration for the conveyor in the specified acceleration units.
void setDirection​(ConveyorDirection direction)
Sets the direction of this conveyor.
void setDrawStands​(boolean drawStands)
Sets to draw stands for conveyor or not
void setGap​(double gapBetweenItems, LengthUnits units)  
void setInitialSpeed​(double initialSpeed, SpeedUnits units)  
void setLineColor​(java.awt.Paint lineColor)
Sets the line color (or Texture) of the markup element.
void setLineWidth​(double widthInPixels)
This method is internal and shouldn't be called by user.
it may be removed in future.
void setMaximumPriority​(boolean maximumPriority)  
void setMaxSpeed​(double maxSpeed, SpeedUnits units)
Sets the new maximum speed of the conveyor in the specified speed units.
void setObstacle​(boolean isObstacle)
Sets this conveyor as an obstacle for transporters moving in free space mode.
void setReversible​(boolean reversible)
Sets the 'reversible' property (true by default).
void setSource​(ConveyorNode<?> node)
Sets source node of this path.
void setStandsLevel​(double standsLevel)
Set the base Z-level to draw conveyor stands from.
void setTarget​(ConveyorNode<?> node)
Sets source node of this path.
void setType​(ConveyorType type)
Sets the type of this conveyor.
void setWidth​(double width, LengthUnits units)
Sets the width of this conveyor
int size()
Returns the number of agents currently being conveyed.
void stop()
Stops the conveyor.
java.lang.String toString()  
void updateDynamicProperties()
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties.
void validate()  
Modifier and Type Method Description

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

getLevel, getNetwork, 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, updateDynamicPropertiesStructural, updateSVGProperties

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

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

postInitialize

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

getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside

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

getName, getPathEnd

Methods inherited from interface java.lang.Iterable

forEach, spliterator

Constructor Detail

ConveyorPath

public ConveyorPath()

ConveyorPath

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

ConveyorPath

@AnyLogicInternalAPI
@Deprecated
public ConveyorPath​(Agent owner,
                    ShapeDrawMode drawMode,
                    boolean isPublic,
                    boolean isObstacle,
                    double widthInMeters,
                    java.awt.Paint color,
                    boolean drawStands,
                    double standsLevel,
                    com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> descriptor,
                    MarkupSegment... segments)
Deprecated.
deprecated in version 8.4, will be removed in the future releases

ConveyorPath

@AnyLogicInternalAPI
@AnyLogicInternalCodegenAPI
public ConveyorPath​(Agent owner,
                    ShapeDrawMode drawMode,
                    boolean isPublic,
                    boolean isObstacle,
                    double widthInMeters,
                    java.awt.Paint color,
                    boolean drawStands,
                    double standsLevel,
                    com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T> descriptor,
                    ConveyorNode<?> source,
                    ConveyorNode<?> target,
                    MarkupSegment... segments)
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.IConveyorPathDescriptor<T> getLibraryDescriptor()

getPositionsOnConveyor

public java.util.List<PositionOnConveyor<T>> getPositionsOnConveyor()
Returns the list of all PositionOnConveyor elements on this conveyor
Returns:
the list of all PositionOnConveyor elements on this conveyor

getStations

public java.util.List<ConveyorStation<T>> getStations()
Returns the list of all stations of this conveyor.
Returns:
the list of all stations of this conveyor.

getSpurs

public java.util.List<ConveyorSpur<T>> getSpurs()
Returns the list of conveyor spur elements of this conveyor.
Returns:
the list of conveyor spur elements of this conveyor.

getSplitMerges

@Deprecated
public java.util.List<ConveyorSpur<T>> getSplitMerges()
Deprecated.
will be removed in the next release. Please use getSpurs() instead

createPortInternal

@AnyLogicInternalAPI
public NetworkPort createPortInternal​(PathEndType endType)

createPort

public NetworkPort createPort​(PathEndType endType)
Creates and returns a Network Port located on specified conveyor's end
Parameters:
endType - determines the port's location
Returns:
new network port

createPort

public NetworkPort createPort​(PathEndType endType,
                              NetworkPort pairedPort)
Creates and returns a Network Port located on specified conveyor's end and pairs created port with specified one
Parameters:
endType - determines the port's location
pairedPort - another port to be paired with the new one. May be a port, located on another conveyor or a lift port or a conveyor spur. Should not be null
Returns:
new network port

getSource

public ConveyorNode<?> getSource()
Returns the source node of the conveyor. The source node is the beginning of the conveyor.
Specified by:
getSource in interface IPath<T extends Agent>
Returns:
the source node of the conveyor.

setSource

public void setSource​(ConveyorNode<?> node)
Description copied from interface: IPath
Sets source node of this path. This method should be called before initialize() method.
Specified by:
setSource in interface IPath<T extends Agent>
Parameters:
node - instance of com.anylogic.engine.markup.INode interface

getTarget

public ConveyorNode<?> getTarget()
Returns the target node of the conveyor. The target node is the end of the conveyor.
Specified by:
getTarget in interface IPath<T extends Agent>
Returns:
the target node of the conveyor.

setTarget

public void setTarget​(ConveyorNode<?> node)
Description copied from interface: IPath
Sets source node of this path. This method should be called before initialize() method.
Specified by:
setTarget in interface IPath<T extends Agent>
Parameters:
node - instance of com.anylogic.engine.markup.INode interface

getOtherNode

public ConveyorNode<?> getOtherNode​(ConveyorNode<?> n)
Returns the second (other) node of the conveyor.
Specified by:
getOtherNode in interface IPath<T extends Agent>
Parameters:
n - the node (one of the path endings)
Returns:
the second (other) node of the conveyor.

setDrawStands

public void setDrawStands​(boolean drawStands)
Sets to draw stands for conveyor or not
Parameters:
drawStands - true to draw stands
See Also:
setStandsLevel(double)

isDrawStands

public boolean isDrawStands()
Returns true if this conveyor is drawn with stands
See Also:
getStandsLevel()

setStandsLevel

public void setStandsLevel​(double standsLevel)
Set the base Z-level to draw conveyor stands from. If the conveyor has sloped areas, it will be drawn with stands of different height - starting from the same base level.
Parameters:
standsLevel - the base level.

getStandsLevel

public double getStandsLevel()
Returns the base level Z-level to draw conveyor stands from.
See Also:
isDrawStands()

isReversible

public boolean isReversible()
Returns the 'reversible' property (false by default).
Specified by:
isReversible in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Returns:
true for conveyors which allow movements in both directions, false for conveyors which allow movements from source to target only

setReversible

public void setReversible​(boolean reversible)
Sets the 'reversible' property (true by default).
Specified by:
setReversible in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
reversible - true for conveyors which allow movements in both directions, false for conveyors which allow movements from source to target only
See Also:
isReversible()

isBidirectional

@AnyLogicInternalAPI
public boolean isBidirectional()
Description copied from interface: IPath
Returns the 'bidirectional' property (true by default).
Specified by:
isBidirectional in interface IPath<T extends Agent>
Returns:
true for paths which allow movements in both directions, false for paths which allow movements from source to target only

setBidirectional

@AnyLogicInternalAPI
public void setBidirectional​(boolean bidirectional)
Description copied from interface: IPath
Sets the 'bidirectional' property (true by default).
Specified by:
setBidirectional in interface IPath<T extends Agent>
Parameters:
bidirectional - true for paths which allow movements in both directions, false for paths which allow movements from source to target only
See Also:
IPath.isBidirectional()

getDirection

public ConveyorDirection getDirection()
Returns the direction of this conveyor

Valid values are:

  • CONVEYOR_FORWARD
  • CONVEYOR_BACKWARD
Specified by:
getDirection in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Returns:
the direction of this conveyor

setDirection

public void setDirection​(ConveyorDirection direction)
Sets the direction of this conveyor. The conveyor should be uninitialized

Valid values are:

  • CONVEYOR_FORWARD
  • CONVEYOR_BACKWARD
Specified by:
setDirection in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
type - the direction

changeDirection

public void changeDirection()
Changes current direction of this conveyor to the opposite
See Also:
setDirection(ConveyorDirection), isChangingDirection()

isChangingDirection

public boolean isChangingDirection()
Returns true if this conveyor is in the process of changing direction, returns false otherwise
Specified by:
isChangingDirection in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Returns:
true if this conveyor is in the process of changing direction, returns false otherwise

onDirectionChanged

public void onDirectionChanged​(java.util.List<T> agents)
Specified by:
onDirectionChanged in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

getLineColor

public java.awt.Color getLineColor()
Description copied from interface: IPath
Returns the line color of the markup element, or null if markup element has no line color or has textured line (in this case IPath.getLineTexture() should be used instead)
Specified by:
getLineColor in interface IPath<T extends Agent>
Returns:
the line color of the markup element

getLineTexture

public Texture getLineTexture()
Description copied from interface: IPath
Returns the line texture of the markup element, if the markup element has line texture
Specified by:
getLineTexture in interface IPath<T extends Agent>
Returns:
the line texture of the markup element

setLineColor

public void setLineColor​(java.awt.Paint lineColor)
Description copied from interface: IPath
Sets the line color (or Texture) of the markup element.
Specified by:
setLineColor in interface IPath<T extends Agent>
Parameters:
lineColor - the new line color, null = do not draw the markup element line

getWidth

public double getWidth​(LengthUnits units)
Returns the width of this conveyor
Parameters:
units - length units
Returns:
the width of this conveyor

setWidth

public void setWidth​(double width,
                     LengthUnits units)
Sets the width of this conveyor
Parameters:
width - width
units - length units

getLineWidth

@AnyLogicInternalAPI
public double getLineWidth()
This method is internal and shouldn't be called by user.
it may be removed in future.
Specified by:
getLineWidth in interface IPath<T extends Agent>
Returns:
the line width of the markup element

setLineWidth

@AnyLogicInternalAPI
public void setLineWidth​(double widthInPixels)
This method is internal and shouldn't be called by user.
it may be removed in future.
Specified by:
setLineWidth in interface IPath<T extends Agent>
Parameters:
widthInPixels - the new line width of the markup element

addSegment

public void addSegment​(MarkupSegment segment)
Adds segment to this markup element
Parameters:
segment - the segment, should be initialized if was created using no-argument constructor

getSegmentCount

public int getSegmentCount()
Description copied from interface: IPath
Returns the number of segments
Specified by:
getSegmentCount in interface IPath<T extends Agent>
Returns:
the number of segments

getSegment

public MarkupSegment getSegment​(int index)
Description copied from interface: IPath
Returns the segment by its index
Specified by:
getSegment in interface IPath<T extends Agent>
Parameters:
index - the segment index, [0 .. IPath.getSegmentCount() - 1]
Returns:
the segment

iterator

public java.util.Iterator<MarkupSegment> iterator()
Creates and returns read-only iterator over segments
Specified by:
iterator in interface IPath<T extends Agent>
Specified by:
iterator in interface java.lang.Iterable<T extends Agent>

length

public double length()
Description copied from interface: AnimationMovingLocationProvider
Returns the length of markup element, used e.g. for desired speed calculation
Specified by:
length in interface AnimationMovingLocationProvider
Returns:
the length of markup element

length

public double length​(LengthUnits units)
Description copied from interface: AnimationMovingLocationProvider
Returns the length of markup element, used e.g. for desired speed calculation
Specified by:
length in interface AnimationMovingLocationProvider
Returns:
the length of markup element

getStartPoint

public Point getStartPoint()
Description copied from interface: IPath
Returns the location of the start point
Specified by:
getStartPoint in interface IPath<T extends Agent>
Returns:
the Point object with coordinates of the first point

getStartPoint

public Point getStartPoint​(Point out)
Description copied from interface: IPath
Returns the location of the start point
Specified by:
getStartPoint in interface IPath<T extends Agent>
Parameters:
out - output object to write to, may be null
Returns:
the Point object with coordinates of the first point

getEndPoint

public Point getEndPoint()
Description copied from interface: IPath
Returns the location of the end point
Specified by:
getEndPoint in interface IPath<T extends Agent>
Returns:
the Point object with coordinates of the last point

getEndPoint

public Point getEndPoint​(Point out)
Description copied from interface: IPath
Returns the location of the end point
Specified by:
getEndPoint in interface IPath<T extends Agent>
Parameters:
out - output object to write to, may be null
Returns:
the Point object with coordinates of the last point

getStartPosition

public Position getStartPosition()
Returns the start position
Returns:
the Position object with coordinates of the first position

getStartPosition

public Position getStartPosition​(Position out)
Description copied from interface: IPath
Returns the start position
Specified by:
getStartPosition in interface IPath<T extends Agent>
Parameters:
out - output object to write to, may be null
Returns:
the Position object with coordinates of the first position

getEndPosition

public Position getEndPosition()
Returns the end position
Returns:
the Position object with coordinates of the last position

getEndPosition

public Position getEndPosition​(Position out)
Description copied from interface: IPath
Returns the end position
Specified by:
getEndPosition in interface IPath<T extends Agent>
Parameters:
out - output object to write to, may be null
Returns:
the Position object with coordinates of the last position

contains

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 interface INetworkMarkupElement
Specified by:
contains in class MarkupShape
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

containsSq

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

getNearestPoint

public double getNearestPoint​(Point givenPoint,
                              Point out)
Description copied from interface: INetworkMarkupElement
Calculates (using the output object) the point in this space markup element nearest to the given point. Returns the square of distance to the point.
Specified by:
getNearestPoint in interface INetworkMarkupElement
Parameters:
givenPoint - given point
out - the output point to write result to.
Returns:
the square of distance to the nearest point

randomPointInside

public Point randomPointInside​(java.util.Random rng,
                               Point out)
Description copied from interface: INetworkMarkupElement
Returns the randomly chosen point inside/along the given space markup element. This method utilises the given Random Number Generator.
Specified by:
randomPointInside in interface INetworkMarkupElement
Parameters:
rng - the random number generator.
out - output object to write to, may be null
Returns:
the randomly chosen point

getPosition

public Position getPosition​(double value,
                            double maxValue,
                            Position out)
Description copied from interface: AnimationMovingLocationProvider
Returns position with offset corresponding to the given value, assuming that 0 is start and maxValue is end
Specified by:
getPosition in interface AnimationMovingLocationProvider
Returns:
position by offset

getPosition

public Position getPosition​(int index,
                            int totalNumber,
                            Position out)
Description copied from interface: AnimationStaticLocationProvider
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
Specified by:
getPosition in interface AnimationStaticLocationProvider
Parameters:
index - the index of some item positions, should be not negative and less than totalNumber
totalNumber - the total number of item positions, should be positive
out - output object to write to, may be null
Returns:
the Position object with coordinates of the requested item position

getPositionAtOffset

public Position getPositionAtOffset​(double offset,
                                    Position out)
Description copied from interface: IPath
Returns the point (+rotations) located on the markup element with the given offset distance calculated from start point.
Specified by:
getPositionAtOffset in interface IPath<T extends Agent>
Parameters:
offset - offset, non-negative value, should be less or equal to the full length.
out - output object to write to, may be null
Returns:
the Position object with coordinates of the point with the given offset and orientation along markup element line at this point

getPositionAtOffset

public Position getPositionAtOffset​(double offset,
                                    LengthUnits units,
                                    Position out)
Description copied from interface: IPath
Returns the point (+rotations) located on the markup element with the given offset distance calculated from start point.
Specified by:
getPositionAtOffset in interface IPath<T extends Agent>
Parameters:
offset - offset, non-negative value, should be less or equal to the full length.
units - the length units
out - output object to write to, may be null
Returns:
the Position object with coordinates of the point with the given offset and orientation along markup element line at this point

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getType

public ConveyorType getType()
Returns the type of this conveyor.

Valid values are:

  • CONVEYOR_TYPE_ROLLER
  • CONVEYOR_TYPE_BELT
  • CONVEYOR_TYPE_CELL
Specified by:
getType in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Returns:
the type of this conveyor

setType

public void setType​(ConveyorType type)
Sets the type of this conveyor. The conveyor should be uninitialized

Valid values are:

  • CONVEYOR_TYPE_ROLLER
  • CONVEYOR_TYPE_BELT
  • CONVEYOR_TYPE_CELL
Specified by:
setType in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
type - the type

isAccumulating

public boolean isAccumulating()
Returns true if the conveyor can accumulate objects, false otherwise.
Returns:
true if the conveyor can accumulate objects, false otherwise.

isStopped

public boolean isStopped()
Returns true if the conveyor is currently stopped, false otherwise.
Specified by:
isStopped in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Returns:
true if the conveyor is currently stopped, false otherwise.

stop

public void stop()
Stops the conveyor.
Specified by:
stop in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

run

public void run()
Launches the conveyor.
Specified by:
run in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

getMaxSpeed

public double getMaxSpeed​(SpeedUnits units)
Returns the maximum speed of the conveyor in the specified speed units.
Specified by:
getMaxSpeed in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
units - - one of the speed unit constants
Returns:
the maximum speed of the conveyor

setMaxSpeed

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

getInitialSpeed

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

setInitialSpeed

public void setInitialSpeed​(double initialSpeed,
                            SpeedUnits units)
Specified by:
setInitialSpeed in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

getCurrentSpeed

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

getCurrentAcceleration

public double getCurrentAcceleration​(AccelerationUnits units)
Specified by:
getCurrentAcceleration in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

getAcceleration

public double getAcceleration​(AccelerationUnits units)
Returns the acceleration of the conveyor in the specified acceleration units.
Specified by:
getAcceleration in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
units - - one of the acceleration unit constants.
Returns:
the acceleration of the conveyor

setAcceleration

public void setAcceleration​(double acceleration,
                            AccelerationUnits units)
Sets the new acceleration for the conveyor in the specified acceleration units.
Specified by:
setAcceleration in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
acceleration - - the new acceleration value.
units - - one of the acceleration unit constants.

getDeceleration

public double getDeceleration​(AccelerationUnits units)
Returns the deceleration of the conveyor in the specified acceleration units.
Specified by:
getDeceleration in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
units - - one of the acceleration unit constants.
Returns:
the deceleration of the conveyor

getCellSize

public double getCellSize​(LengthUnits units)
Specified by:
getCellSize in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

setCellSize

public void setCellSize​(double size,
                        LengthUnits units)
Specified by:
setCellSize in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

setDeceleration

public void setDeceleration​(double deceleration,
                            AccelerationUnits units)
Sets the new deceleration for the conveyor in the specified acceleration units.
Specified by:
setDeceleration in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
deceleration - - the new deceleration value.
units - - one of the acceleration unit constants.

getGap

public double getGap​(LengthUnits units)
Returns the minimum required gap between material items of this conveyor (in the specified length units).
Specified by:
getGap in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Parameters:
units - - one of the length unit constants.
Returns:
the minimum required gap between material items of this conveyor

setGap

public void setGap​(double gapBetweenItems,
                   LengthUnits units)
Specified by:
setGap in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

size

public int size()
Returns the number of agents currently being conveyed.
Specified by:
size in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Returns:
the number of agents currently being conveyed.

getAgent

public 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.
Specified by:
getAgent in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Returns:
the agent at a given position

getAgents

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

getAgent

public T getAgent​(double offset,
                  LengthUnits units)
Specified by:
getAgent in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

getAgents

public java.util.List<T> getAgents​(double offset,
                                   double length,
                                   LengthUnits units)
Specified by:
getAgents in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

removeAgent

public boolean removeAgent​(Agent agent)
Removes the given agent from the conveyor. If the agent is not on the conveyor, returns false, otherwise returns true.
Specified by:
removeAgent in interface com.anylogic.engine.markup.material_handling.IMaterialAreaLocation<T extends Agent>
Returns:
If the agent is not on the conveyor, returns false, otherwise returns true.

contains

public boolean contains​(Agent agent)
Specified by:
contains in interface com.anylogic.engine.markup.material_handling.IMaterialPointLocation<T extends Agent>

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.

onStarted

public void onStarted()
Specified by:
onStarted in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

onStopped

public void onStopped()
Specified by:
onStopped in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

isFailed

public boolean isFailed()
Returns true if the conveyor is currently failed, returns false otherwise.
Specified by:
isFailed in interface com.anylogic.engine.markup.material_handling.IMaterialFallible
Returns:
true if the conveyor is currently failed, returns false otherwise.

fail

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

repair

public void repair()
Repairs conveyor, makes it available again. Resumes its processing.
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

onMotionChanged

@AnyLogicInternalAPI
public void onMotionChanged()

isMaximumPriority

public boolean isMaximumPriority()
Returns true if the conveyor has the greatest priority.
Specified by:
isMaximumPriority in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>
Returns:
Returns true if the conveyor has the greatest priority.

setMaximumPriority

public void setMaximumPriority​(boolean maximumPriority)
Specified by:
setMaximumPriority in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

priority

public double priority​(T agent)
Specified by:
priority in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()

updateDynamicProperties

@AnyLogicInternalCodegenAPI
public void updateDynamicProperties()
Description copied from class: AbstractMarkup
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
Overrides:
updateDynamicProperties in class AbstractMarkup

isObstacle

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

setObstacle

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

validate

@AnyLogicInternalAPI
public void validate()

createPort

@AnyLogicInternalAPI
public default NetworkPort createPort​(IPath<?> path,
                                      PathEndType endType)

createPort

@AnyLogicInternalAPI
public default NetworkPort createPort​(IPath<?> path,
                                      PathEndType endType,
                                      NetworkPort pairedPort)
How can we improve this article?