AnyLogic
Expand
Font size
All Implemented Interfaces:
AbstractPositionalMarkup, AggregatableAnimationElement, HasLevel, INetworkMarkupElement, MarkupPort, NetworkPort, SVGElement, UsdElement, Serializable

public class ConveyorSpur<T extends Agent>
extends ConveyorPathPart<T>
implements NetworkPort, AbstractPositionalMarkup
See Also:
Serialized Form

Field Summary

Fields inherited from interface com.anylogic.engine.presentation.UsdElement

ID_NOT_SET

Constructor Summary

ConstructorDescription
ConveyorSpur(ConveyorPath<? extends T> conveyor, ShapeDrawMode drawMode, boolean isPublic, double offsetInPixels, boolean isOnRightSide, Paint lineColor, Paint fillColor) 

Method Summary

Modifier and TypeMethodDescription
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
ConveyorPath<?>getConnectedPath() 
doublegetConnectionAngle() 
ColorgetFillColor()
Returns the fill color of the shape, or null if the shape has no color or uses a texture (in this case use getLineTexture() to get the shape's texture).
TexturegetFillTexture()
Returns the fill texture of the shape or null if the shape has no texture but uses a color (in this case use getLineColor() to get the shape's color).
doublegetItemEnterOffset() 
doublegetItemEnterOffset(LengthUnits units) 
ColorgetLineColor()
Returns the line color of the shape, or null if the shape has no color or uses a texture (in this case use getLineTexture() to get the shape's texture).
TexturegetLineTexture()
Returns the line texture of the shape or null if the shape has no texture but uses a color (in this case use getLineColor() to get the shape's color).
doublegetMergeLength() 
doublegetMergeLength(LengthUnits units) 
doublegetNearestPoint(Point givenPoint, Point out)
Calculates the distance to the givenPoint and writes the nearest point (same as spur coordinates) to the output Point object.
MarkupPortgetPairedPort()
Returns the paired port for this conveyor spur.
ConveyorPath<T>getTransition() 
doublegetX() 
PointgetXYZ()
Returns the Point where the spur connects to main conveyor.
doublegetY() 
doublegetZ() 
booleanisMerge() 
booleanisOnRightSide()
Returns true if the conveyor spur is situated on the right-hand side of the main conveyor.
booleanisSplit() 
PointrandomPointInside(Random rng, Point out)
Returns Point equal to spur coordinates and writes result to out.
voidsetFillColor(Paint fillColor)
Sets the fill color (or texture) of the shape.
voidsetLineColor(Paint lineColor)
Sets the line color (or texture) of the shape.
voidsetOffset(double offset, LengthUnits units)
Sets the distance from the starting point of the main conveyor to the center of the conveyor spur element (in the specified length units).
voidsetOnRightSide(boolean isOnRigthSide)
Sets the conveyor spur element on the right-hand side of the main conveyor.
voidsetPairedPort(MarkupPort pairedPort)
Sets the paired port for this conveyor spur.

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

getConveyor, getOffset, getOffset, setConveyor, setOffset

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, toString, wait, wait, wait

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

getRotation, getSpace, isVisible

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

postInitialize

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

getSpace, randomPointInside, randomPointInside, randomPointInside

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

getFullName, getLevel, getName

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

getNetwork

Methods inherited from interface com.anylogic.engine.presentation.SVGElement

executeUserAction, findSVGElement, getSVGId, removeSVGFromOwner, resetSVGState, updateSVGProperties

Methods inherited from interface com.anylogic.engine.presentation.UsdElement

getOrGenerateUSDId

Constructor Details

ConveyorSpur

public ConveyorSpur(ConveyorPath<? extends T> conveyor,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double offsetInPixels,
 boolean isOnRightSide,
 Paint lineColor,
 Paint fillColor)

Method Details

getConnectedPath

@AnyLogicInternalAPI
public ConveyorPath<?> getConnectedPath()

isOnRightSide

public boolean isOnRightSide()
Returns true if the conveyor spur is situated on the right-hand side of the main conveyor. Otherwise returns false.
Returns:
true if the conveyor spur is situated on the right-hand side of the main conveyor. Otherwise returns false

setOnRightSide

public void setOnRightSide(boolean isOnRigthSide)
Sets the conveyor spur element on the right-hand side of the main conveyor.
Parameters:
isOnRigthSide - - true if the conveyor spur should be situated on the right-hand side of the main conveyor and false otherwise

getItemEnterOffset

@AnyLogicInternalLibraryAPI
public double getItemEnterOffset()

getItemEnterOffset

@AnyLogicInternalLibraryAPI
public double getItemEnterOffset(LengthUnits units)

getMergeLength

@AnyLogicInternalLibraryAPI
public double getMergeLength()

getMergeLength

@AnyLogicInternalLibraryAPI
public double getMergeLength(LengthUnits units)

getConnectionAngle

@AnyLogicInternalLibraryAPI
public double getConnectionAngle()

setPairedPort

public void setPairedPort(MarkupPort pairedPort)
Sets the paired port for this conveyor spur.
Specified by:
setPairedPort in interface MarkupPort
Parameters:
pairedPort - - a network port from another network

getTransition

@AnyLogicInternalLibraryAPI
public ConveyorPath<T> getTransition()

setOffset

public void setOffset(double offset,
 LengthUnits units)
Sets the distance from the starting point of the main conveyor to the center of the conveyor spur element (in the specified length units).
Overrides:
setOffset in class ConveyorPathPart<T extends Agent>
Parameters:
offset - - a new distance value
units - - one of the length unit constants

getPairedPort

public MarkupPort getPairedPort()
Returns the paired port for this conveyor spur.
Specified by:
getPairedPort in interface MarkupPort
Returns:
the paired port for this conveyor spur

getXYZ

public Point getXYZ()
Returns the Point where the spur connects to main conveyor.
Specified by:
getXYZ in interface MarkupPort
Returns:
the Point where the spur connects to main conveyor

getX

public double getX()
Specified by:
getX in interface AbstractPositionalMarkup

getY

public double getY()
Specified by:
getY in interface AbstractPositionalMarkup

getZ

public double getZ()
Specified by:
getZ in interface AbstractPositionalMarkup

getNearestPoint

public double getNearestPoint(Point givenPoint,
 Point out)
Calculates the distance to the givenPoint and writes the nearest point (same as spur coordinates) to the output Point object. Returns the square of the distance to the point. All calculations are performed in the horizontal XY-projection (i.e. z-coordinates are treated as zeros).
Specified by:
getNearestPoint in interface INetworkMarkupElement
Parameters:
givenPoint - - the point to calculate distance to
out - - the output point to write result to, may be null
Returns:
the square of distance to the nearest point

randomPointInside

public Point randomPointInside(Random rng,
 Point out)
Returns Point equal to spur coordinates and writes result to out.
Specified by:
randomPointInside in interface INetworkMarkupElement
Parameters:
rng - - unused, may be null
out - - the output point to write result to, may be null
Returns:
the randomly chosen point

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

setLineColor

public void setLineColor(Paint lineColor)
Sets the line color (or texture) of the shape.
Parameters:
lineColor - - Color or Paint if you want to use texture, may be null

setFillColor

public void setFillColor(Paint fillColor)
Sets the fill color (or texture) of the shape.
Parameters:
lineColor - - Color or Paint if you want to use texture, may be null

getLineColor

public Color getLineColor()
Returns the line color of the shape, or null if the shape has no color or uses a texture (in this case use getLineTexture() to get the shape's texture).
Returns:
the line color of the shape

getLineTexture

public Texture getLineTexture()
Returns the line texture of the shape or null if the shape has no texture but uses a color (in this case use getLineColor() to get the shape's color).
Returns:
the line texture

getFillColor

public Color getFillColor()
Returns the fill color of the shape, or null if the shape has no color or uses a texture (in this case use getLineTexture() to get the shape's texture).
Returns:
the fill color of the shape

getFillTexture

public Texture getFillTexture()
Returns the fill texture of the shape or null if the shape has no texture but uses a color (in this case use getLineColor() to get the shape's color).
Returns:
the fill texture

isSplit

@AnyLogicInternalAPI
public boolean isSplit()

isMerge

@AnyLogicInternalAPI
public boolean isMerge()