AnyLogic AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, INetworkMarkupElement, MarkupPort, NetworkPort, SVGElement, java.io.Serializable

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

Constructor Summary

Constructors 
ConveyorSpur​(ConveyorPath<? extends T> conveyor, ShapeDrawMode drawMode, boolean isPublic, double offsetInPixels, boolean isOnRightSide, java.awt.Paint lineColor, java.awt.Paint fillColor)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
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. in the same system with the coordinates of this shape, x and y)
double getConnectionAngle()  
java.awt.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).
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).
double getItemEnterOffset()  
double getItemEnterOffset​(LengthUnits units)  
java.awt.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).
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).
double getMergeLength()  
double getMergeLength​(LengthUnits units)  
double getMovementAngle()  
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.
MarkupPort getPairedPort()
Returns the paired port for this conveyor spur.
ConveyorPath<T> getTransition()  
Point getXYZ()
Returns the Point where the spur connects to main conveyor.
boolean isMerge()  
boolean isOnRightSide()
Returns true if the conveyor spur is situated on the right-hand side of the main conveyor.
boolean isSplit()  
Point randomPointInside​(java.util.Random rng, Point out)
Returns Point equal to spur coordinates and writes result to out.
void setFillColor​(java.awt.Paint fillColor)
Sets the fill color (or texture) of the shape.
void setLineColor​(java.awt.Paint lineColor)
Sets the line color (or texture) of the shape.
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).
void setOnRightSide​(boolean isOnRigthSide)
Sets the conveyor spur element on the right-hand side of the main conveyor.
void setPairedPort​(MarkupPort pairedPort)
Sets the paired port for this conveyor spur.
Modifier and Type Method Description

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 com.anylogic.engine.markup.AbstractMarkup

discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties

Methods inherited from class java.lang.Object

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

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

Constructor Detail

ConveyorSpur

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

Method Detail

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

getMovementAngle

@AnyLogicInternalLibraryAPI
public double getMovementAngle()

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

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​(java.util.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​(java.awt.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​(java.awt.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 java.awt.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 java.awt.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()
How can we improve this article?