AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, AnimationStaticLocationProvider, HasLevel, INetworkMarkupElement, INode<ConveyorNode<?>,ConveyorPath<?>>, SVGElement, Serializable
Direct Known Subclasses:
ConveyorCustomStation, ConveyorPointNode, ConveyorPortImpl, ConveyorTransitionalNode

public abstract class ConveyorNode<T extends Agent>
extends ConveyorMarkupElement<T>
implements INode<ConveyorNode<?>,ConveyorPath<?>>
See Also:
Serialized Form

Method Summary

Modifier and TypeMethodDescription
voidaddConnection(ConveyorPath<?> path, PathEndType type) 
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
Class<? extends ExtAgentWithSpatialMetrics>getCompatibleAgentExtensionClass()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
ConveyorPath<?>getConnection(int index)
Returns connection of this node with another node by index.
List<ConveyorPath<?>>getConnections()
Returns the list of ConveyorPath<?> objects connected to this node
intgetConnectionsCount()
Amount of the node's connections to other nodes.
ColorgetFillColor()
Returns the fill color of the shape, or null if shape has no fill color or has textured fill (in this case INode.getFillTexture() should be used instead)
TexturegetFillTexture()
Returns the fill texture of the shape, if the shape has fill texture
List<ConveyorPath<?>>getIncomingPaths()
Returns the list of all incoming conveyors, i.e.
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 INode.getLineTexture() should be used instead)
TexturegetLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
doublegetNearestPoint(Point givenPoint, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given point.
ConveyorNetworkgetNetwork() 
List<ConveyorPath<?>>getOutgoingPaths()
Returns the list of all outgoing conveyors, i.e.
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).
PositiongetTransferPositionByPercent(ConveyorPath<?> path1, ConveyorPath<?> path2, double percent, Position out) 
doublegetX()
Get X coordinate of this element
PointgetXYZ(Point out)
Returns the location of this element
doublegetY()
Get Y coordinate of this element
final doublegetZ()
Get Z coordinate of this element
voidpostInitialize()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
PointrandomPointInside(Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
voidsetFillColor(Color fillColor)
Sets the fill color of the shape.
voidsetFillColor(Paint fillColor)
Sets the fill color (or Texture) of the shape.
voidsetLineColor(Color lineColor)
Sets the line color of the markup element.
voidsetLineColor(Paint lineColor)
Sets the line color (or Texture) of the markup element.
voidsetXYZ(double x, double y, double z)
Sets the location of this node.

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

getLevel, 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.AnimationStaticLocationProvider

getSpace

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

getSpace, randomPointInside, randomPointInside, randomPointInside

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

getName, getTransferDistance

Method Details

getNetwork

public ConveyorNetwork getNetwork()
Specified by:
getNetwork in interface INetworkMarkupElement
Overrides:
getNetwork in class ConveyorMarkupElement<T extends Agent>
Returns:
network this markup element belongs to or null if this element isn't a part of a network

getX

public double getX()
Get X coordinate of this element
Returns:
X coordinate of this element

getY

public double getY()
Get Y coordinate of this element
Returns:
Y coordinate of this element

getZ

public final double getZ()
Get Z coordinate of this element
Returns:
Z coordinate of this element

getXYZ

public Point getXYZ(Point out)
Returns the location of this element
Parameters:
out - output object to write to, may be null
Returns:
the Point object with coordinates of the node

setXYZ

public void setXYZ(double x,
 double y,
 double z)
Sets the location of this node. The node should be unitialized
Parameters:
x - X coordinate
y - Y coordinate
z - Z coordinate

getIncomingPaths

public List<ConveyorPath<?>> getIncomingPaths()
Returns the list of all incoming conveyors, i.e. the conveyors, transferring agents (material items) to the transfer table, returns null if none.
Returns:
the list of all incoming conveyors

getOutgoingPaths

public List<ConveyorPath<?>> getOutgoingPaths()
Returns the list of all outgoing conveyors, i.e. the conveyors, accepting agents (material items) from the transfer table, returns null if none.
Returns:
the list of all outgoing conveyors

getConnectionsCount

public int getConnectionsCount()
Description copied from interface: INode
Amount of the node's connections to other nodes.
Specified by:
getConnectionsCount in interface INode<ConveyorNode<?>,ConveyorPath<?>>
Returns:
number of connections

getConnection

public ConveyorPath<?> getConnection(int index)
Description copied from interface: INode
Returns connection of this node with another node by index.
Specified by:
getConnection in interface INode<ConveyorNode<?>,ConveyorPath<?>>
Parameters:
index - the index of required connection in range (0, this.getConnectionsCount() - 1)
Returns:
instance of com.anylogic.engine.markup.IPath interface

getConnections

public List<ConveyorPath<?>> getConnections()
Returns the list of ConveyorPath<?> objects connected to this node
Returns:
the list of connections

addConnection

public void addConnection(ConveyorPath<?> path,
 PathEndType type)
Specified by:
addConnection in interface INode<ConveyorNode<?>,ConveyorPath<?>>

getLineColor

public Color getLineColor()
Description copied from interface: INode
Returns the line color of the markup element, or null if markup element has no line color or has textured line (in this case INode.getLineTexture() should be used instead)
Specified by:
getLineColor in interface INode<ConveyorNode<?>,ConveyorPath<?>>
Returns:
the line color of the markup element

getLineTexture

public Texture getLineTexture()
Description copied from interface: INode
Returns the line texture of the markup element, if the markup element has line texture
Specified by:
getLineTexture in interface INode<ConveyorNode<?>,ConveyorPath<?>>
Returns:
the line texture of the markup element

setLineColor

public void setLineColor(Color lineColor)
Sets the line color of the markup element.
Parameters:
lineColor - the new line color, null = do not draw the markup element line

setLineColor

public void setLineColor(Paint lineColor)
Description copied from interface: INode
Sets the line color (or Texture) of the markup element.
Specified by:
setLineColor in interface INode<ConveyorNode<?>,ConveyorPath<?>>
Parameters:
lineColor - the new line color, null = do not draw the markup element line

getFillColor

public Color getFillColor()
Description copied from interface: INode
Returns the fill color of the shape, or null if shape has no fill color or has textured fill (in this case INode.getFillTexture() should be used instead)
Specified by:
getFillColor in interface INode<ConveyorNode<?>,ConveyorPath<?>>
Returns:
the fill color of the shape

getFillTexture

public Texture getFillTexture()
Description copied from interface: INode
Returns the fill texture of the shape, if the shape has fill texture
Specified by:
getFillTexture in interface INode<ConveyorNode<?>,ConveyorPath<?>>
Returns:
the fill texture of the shape

setFillColor

public void setFillColor(Color fillColor)
Sets the fill color of the shape.
Parameters:
fillColor - the new fill color, null = do not fill the shape

setFillColor

public void setFillColor(Paint fillColor)
Description copied from interface: INode
Sets the fill color (or Texture) of the shape.
Specified by:
setFillColor in interface INode<ConveyorNode<?>,ConveyorPath<?>>

getCompatibleAgentExtensionClass

public Class<? extends ExtAgentWithSpatialMetrics> getCompatibleAgentExtensionClass()
Description copied from interface: INode
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
getCompatibleAgentExtensionClass in interface INode<ConveyorNode<?>,ConveyorPath<?>>

getTransferPositionByPercent

@AnyLogicInternalAPI
public Position getTransferPositionByPercent(ConveyorPath<?> path1,
 ConveyorPath<?> path2,
 double percent,
 Position out)
Specified by:
getTransferPositionByPercent in interface INode<ConveyorNode<?>,ConveyorPath<?>>

postInitialize

@AnyLogicInternalAPI
public void postInitialize()
Description copied from interface: AggregatableAnimationElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
postInitialize in interface AggregatableAnimationElement

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

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