AnyLogic
Expand
Font size

Class ConveyorPath<T extends Agent>

All Implemented Interfaces:
IMaintenanceable, AggregatableAnimationElement, AnimationMovingLocationProvider, AnimationStaticLocationProvider, HasLevel, IMaintenanceableMarkup, 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, Serializable, Iterable<MarkupSegment>

public class ConveyorPath<T extends Agent>
extends ConveyorMarkupElement<T>
implements IPath<ConveyorNode<?>>, Iterable<MarkupSegment>, IMaintenanceableMarkup, 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

ConstructorDescription
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, 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, 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

Method Summary

Modifier and TypeMethodDescription
voidaddSegment(MarkupSegment segment)
Adds segment to this markup element
voidchangeDirection()
Changes current direction of this conveyor to the opposite
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
booleancontains(Agent agent) 
booleancontainsSq(double px, double py, double squareDistance) 
default NetworkPortcreatePort(IPath<?> path, PathEndType endType) 
default NetworkPortcreatePort(IPath<?> path, PathEndType endType, NetworkPort pairedPort) 
NetworkPortcreatePort(PathEndType endType)
Creates and returns a Network Port located on specified conveyor's end
NetworkPortcreatePort(PathEndType endType, NetworkPort pairedPort)
Creates and returns a Network Port located on specified conveyor's end and pairs created port with specified one
NetworkPortcreatePortInternal(PathEndType endType) 
voidfail()
Initiates conveyor failure.
doublegetAcceleration(AccelerationUnits units)
Returns the acceleration of the conveyor in the specified acceleration units.
TgetAgent(double offset, LengthUnits units) 
TgetAgent(int index)
Returns the agent at a given position (counted from 0, from the exit).
List<T>getAgents()
Returns the list of agents (material items) that are currently conveyed
List<T>getAgents(double offset, double length, LengthUnits units) 
BoundingRectanglegetBoundingRectangle() 
doublegetCellSize(LengthUnits units) 
doublegetCurrentAcceleration(AccelerationUnits units) 
doublegetCurrentSpeed(SpeedUnits units)
Returns the current speed of the conveyor in the specified speed units.
doublegetDeceleration(AccelerationUnits units)
Returns the deceleration of the conveyor in the specified acceleration units.
ConveyorDirectiongetDirection()
Returns the direction of this conveyor
IDowntime<?>[]getDowntimeBlocks() 
PointgetEndPoint()
Returns the location of the end point
PointgetEndPoint(Point out)
Returns the location of the end point
PositiongetEndPosition()
Returns the end position
PositiongetEndPosition(Position out)
Returns the end position
doublegetGap(LengthUnits units)
Returns the minimum required gap between material items of this conveyor (in the specified length units).
doublegetInitialSpeed(SpeedUnits units)
Returns the initial speed of the conveyor in the specified speed units.
com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T>getLibraryDescriptor() 
ColorgetLineColor()
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)
TexturegetLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
doublegetLineWidth()
This method is internal and shouldn't be called by user.
it may be removed in future.
doublegetMaxSpeed(SpeedUnits units)
Returns the maximum speed of the conveyor in the specified speed units.
doublegetNearestPoint(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.
PositiongetPosition(double value, double maxValue, Position out)
Returns position with offset corresponding to the given value, assuming that 0 is start and maxValue is end
PositiongetPosition(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).
PositiongetPositionAtOffset(double offset, LengthUnits units, Position out)
Returns the point (+rotations) located on the markup element with the given offset distance calculated from start point.
PositiongetPositionAtOffset(double offset, Position out)
Returns the point (+rotations) located on the markup element with the given offset distance calculated from start point.
List<PositionOnConveyor<T>>getPositionsOnConveyor()
Returns the list of all PositionOnConveyor elements on this conveyor
MarkupSegmentgetSegment(int index)
Returns the segment by its index
intgetSegmentCount()
Returns the number of segments
ConveyorNode<?>getSource()
Returns the source node of the conveyor.
List<ConveyorSpur<T>>getSplitMerges()
Deprecated.
will be removed in the next release.
List<ConveyorSpur<T>>getSpurs()
Returns the list of conveyor spur elements of this conveyor.
doublegetStandsLevel()
Returns the base level Z-level to draw conveyor stands from.
PointgetStartPoint()
Returns the location of the start point
PointgetStartPoint(Point out)
Returns the location of the start point
PositiongetStartPosition()
Returns the start position
PositiongetStartPosition(Position out)
Returns the start position
List<ConveyorStation<T>>getStations()
Returns the list of all stations of this conveyor.
ConveyorNode<?>getTarget()
Returns the target node of the conveyor.
ConveyorTypegetType()
Returns the type of this conveyor.
doublegetWidth(LengthUnits units)
Returns the width of this conveyor
booleanisAccumulating()
Returns true if the conveyor can accumulate objects, false otherwise.
booleanisBidirectional()
Returns the 'bidirectional' property (true by default).
booleanisChangingDirection()
Returns true if this conveyor is in the process of changing direction, returns false otherwise
booleanisDrawStands()
Returns true if this conveyor is drawn with stands
booleanisFailed()
Returns true if the conveyor is currently failed, returns false otherwise.
booleanisMaintenanceActive(IDowntime<?> block) 
booleanisMaximumPriority()
Returns true if the conveyor has the greatest priority.
booleanisObstacle()
Returns true if this conveyor is considered an obstacle by transporters moving in free space mode.
booleanisReversible()
Returns the 'reversible' property (false by default).
booleanisStopped()
Returns true if the conveyor is currently stopped, false otherwise.
Iterator<MarkupSegment>iterator()
Creates and returns read-only iterator over segments
doublelength()
Returns the length of markup element, used e.g.
doublelength(LengthUnits units)
Returns the length of markup element, used e.g.
voidonDirectionChanged(List<T> agents) 
voidonLeadingEdgeEnter(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.
voidonLeadingEdgeExit(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.
voidonMotionChanged() 
voidonStarted() 
voidonStopped() 
voidonTrailingEdgeEnter(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.
voidonTrailingEdgeExit(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.
doublepriority(T agent) 
PointrandomPointInside(Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
booleanremoveAgent(Agent agent)
Removes the given agent from the conveyor.
voidrepair()
Repairs conveyor, makes it available again.
voidrestartMaintenanceTriggers(IDowntime<?> block) 
voidrun()
Launches the conveyor.
voidsetAcceleration(double acceleration, AccelerationUnits units)
Sets the new acceleration for the conveyor in the specified acceleration units.
voidsetBidirectional(boolean bidirectional)
Sets the 'bidirectional' property (true by default).
voidsetCellSize(double size, LengthUnits units) 
voidsetDeceleration(double deceleration, AccelerationUnits units)
Sets the new deceleration for the conveyor in the specified acceleration units.
voidsetDirection(ConveyorDirection direction)
Sets the direction of this conveyor.
voidsetDowntimeBlocks(IDowntime<?>[] downtimeBlocks) 
voidsetDrawStands(boolean drawStands)
Sets to draw stands for conveyor or not
voidsetGap(double gapBetweenItems, LengthUnits units) 
voidsetInitialSpeed(double initialSpeed, SpeedUnits units) 
voidsetLineColor(Paint lineColor)
Sets the line color (or Texture) of the markup element.
voidsetLineWidth(double widthInPixels)
This method is internal and shouldn't be called by user.
it may be removed in future.
voidsetMaximumPriority(boolean maximumPriority) 
voidsetMaxSpeed(double maxSpeed, SpeedUnits units)
Sets the new maximum speed of the conveyor in the specified speed units.
voidsetObstacle(boolean isObstacle)
Sets this conveyor as an obstacle for transporters moving in free space mode.
voidsetReversible(boolean reversible)
Sets the 'reversible' property (true by default).
voidsetSource(ConveyorNode<?> node)
Sets source node of this path.
voidsetStandsLevel(double standsLevel)
Set the base Z-level to draw conveyor stands from.
voidsetTarget(ConveyorNode<?> node)
Sets source node of this path.
voidsetType(ConveyorType type)
Sets the type of this conveyor.
voidsetWidth(double width, LengthUnits units)
Sets the width of this conveyor
intsize()
Returns the number of agents currently being conveyed.
voidstartMaintenanceManually(IDowntime<?> block) 
voidstop()
Stops the conveyor.
voidstopMaintenanceManually(IDowntime<?> block) 
StringtoString() 
voidupdateDynamicProperties()
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.
voidvalidate() 

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 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.IMaintenanceableMarkup

error, getName

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 Details

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,
 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,
 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 Details

getLibraryDescriptor

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

getPositionsOnConveyor

public 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 List<ConveyorStation<T>> getStations()
Returns the list of all stations of this conveyor.
Returns:
the list of all stations of this conveyor.

getSpurs

public 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 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:

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(List<T> agents)
Specified by:
onDirectionChanged in interface com.anylogic.engine.markup.material_handling.IConveyorPathDescriptor<T extends Agent>

getLineColor

public 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(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 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 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(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 String toString()
Overrides:
toString in class 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 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 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

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()

getDowntimeBlocks

public IDowntime<?>[] getDowntimeBlocks()
Specified by:
getDowntimeBlocks in interface IMaintenanceableMarkup

setDowntimeBlocks

public void setDowntimeBlocks(IDowntime<?>[] downtimeBlocks)

restartMaintenanceTriggers

@AnyLogicInternalAPI
public void restartMaintenanceTriggers(IDowntime<?> block)
Specified by:
restartMaintenanceTriggers in interface IMaintenanceableMarkup

startMaintenanceManually

@AnyLogicInternalAPI
public void startMaintenanceManually(IDowntime<?> block)
Specified by:
startMaintenanceManually in interface IMaintenanceableMarkup

stopMaintenanceManually

@AnyLogicInternalAPI
public void stopMaintenanceManually(IDowntime<?> block)
Specified by:
stopMaintenanceManually in interface IMaintenanceableMarkup

isMaintenanceActive

@AnyLogicInternalAPI
public boolean isMaintenanceActive(IDowntime<?> block)
Specified by:
isMaintenanceActive in interface IMaintenanceableMarkup

createPort

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

createPort

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