AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, AnimationStaticLocationProvider, HasLevel, IMarkupLibraryDescriptor, INetworkMarkupElement, INode<Node,Path>, LevelElement, LevelMarkup, com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor, com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent>, SVGElement, UsdElement, Serializable
Direct Known Subclasses:
AreaNode, NetworkPortImpl, PointNode

public abstract class Node
extends NetworkMarkupElement
implements INode<Node,Path>, com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent>, LevelMarkup
Implementation of INode for network in continuous space.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Field Summary

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

ID_NOT_SET

Constructor Summary

ConstructorDescription
Node() 
Node(Agent owner) 
Node(Agent owner, ShapeDrawMode drawMode, boolean isPublic, Paint fillColor, boolean limitSpeed, double maxSpeedInMPS, PathEnd<Path>... pathEnds)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Node(Agent owner, ShapeDrawMode drawMode, boolean isPublic, Paint fillColor, PathEnd<Path>... pathEnds)
Deprecated.
deprecated in version 8.4, will be removed in the future releases

Method Summary

Modifier and TypeMethodDescription
voidaddConnection(Path path, PathEndType type) 
final Class<? extends ExtAgentWithSpatialMetrics>getCompatibleAgentExtensionClass()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
final PathgetConnection(int index)
Returns connection of this node with another node by index.
final 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 getFillTexture() should be used instead)
TexturegetFillTexture()
Returns the fill texture of the shape, if the shape has fill texture
abstract 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 getLineTexture() should be used instead)
abstract TexturegetLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent>getMaterialLibraryDescriptor() 
doublegetMaxSpeed(SpeedUnits units)
Returns max allowed speed in this node in specified speed units
intgetNumberOfTransporters()
Returns the number of path-guided transporters inside node which is a part of a network.
final doublegetTransferDistance(Path path1, Path path2) 
PositiongetTransferPositionByPercent(Path path1, Path path2, double percent, Position out) 
AgentgetTransporter(int index)
Returns the path-guided transporter with specified index inside the node which is a part of a network.
List<Agent>getTransporters()
Returns the list of path-guided transporters inside the node which is a part of a network.
abstract doublegetZ()
Returns the z coordinate of the node.
booleanisLimitSpeed()
Return true if speed is limited in this node, false otherwise
voidsetFillColor(Color fillColor)
Sets the fill color of the shape.
voidsetFillColor(Paint fillColor)
Sets the fill color (or Texture) of the shape.
voidsetLimitSpeed(boolean limitSpeed)
Enables speed limit in this node if the argument is true, disables it if the argument is false The element should be uninitialized
abstract voidsetLineColor(Color lineColor)
Sets the line color of the markup element.
abstract voidsetLineColor(Paint lineColor)
Sets the line color (or Texture) of the markup element.
voidsetMaxSpeed(double maxSpeed, SpeedUnits units)
Sets the maximum allowed speed in specified units

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

getDrawMode, getLevel, getNearestPoint, getNearestPoint, getNearestPoint, getNearestPoint, getNearestPoint, getNetwork, setLevel

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

contains, error, 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.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged, postInitialize

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

getPosition, getSpace

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

getLevel

Methods inherited from interface com.anylogic.engine.markup.material_handling.IMaterialMarkupLibraryDescriptor

getMarkup, setMarkup

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

contains, getNearestPoint, getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside, randomPointInside

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

getName

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

setLevel

Constructor Details

Node

public Node()

Node

public Node(Agent owner)

Node

@SafeVarargs
@Deprecated
public Node(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 Paint fillColor,
 PathEnd<Path>... pathEnds)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
fillColor -
pathEnds -

Node

@SafeVarargs
@Deprecated
public Node(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 Paint fillColor,
 boolean limitSpeed,
 double maxSpeedInMPS,
 PathEnd<Path>... pathEnds)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
fillColor -
limitSpeed -
maxSpeedInMPS -
pathEnds -

Method Details

getMaterialLibraryDescriptor

@AnyLogicInternalAPI
public com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent> getMaterialLibraryDescriptor()

addConnection

public void addConnection(Path path,
 PathEndType type)
Specified by:
addConnection in interface INode<Node,Path>

isLimitSpeed

public boolean isLimitSpeed()
Return true if speed is limited in this node, false otherwise

setLimitSpeed

public void setLimitSpeed(boolean limitSpeed)
Enables speed limit in this node if the argument is true, disables it if the argument is false The element should be uninitialized
Parameters:
limitSpeed - argument flag

getMaxSpeed

public double getMaxSpeed(SpeedUnits units)
Returns max allowed speed in this node in specified speed units
Parameters:
units - speed units
Returns:
max speed

setMaxSpeed

public void setMaxSpeed(double maxSpeed,
 SpeedUnits units)
Sets the maximum allowed speed in specified units
Parameters:
maxSpeed - new max speed
units - speed units

getZ

public abstract double getZ()
Returns the z coordinate of the node.
Returns:
the z coordinate of the node

getConnectionsCount

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

getConnection

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

getTransferDistance

@AnyLogicInternalAPI
public final double getTransferDistance(Path path1,
 Path path2)
Specified by:
getTransferDistance in interface INode<Node,Path>

setLineColor

public abstract 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 abstract void setLineColor(Paint lineColor)
Sets the line color (or Texture) of the markup element.
Specified by:
setLineColor in interface INode<Node,Path>
Parameters:
lineColor - the new line color, null = do not draw the markup element line

getLineColor

public abstract 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 getLineTexture() should be used instead)
Specified by:
getLineColor in interface INode<Node,Path>
Returns:
the line color of the markup element

getLineTexture

public abstract Texture getLineTexture()
Returns the line texture of the markup element, if the markup element has line texture
Specified by:
getLineTexture in interface INode<Node,Path>
Returns:
the line texture of the markup element

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)
Sets the fill color (or Texture) of the shape.
Specified by:
setFillColor in interface INode<Node,Path>
Parameters:
fillColor - the new fill color, null = do not fill the shape

getFillColor

public Color getFillColor()
Returns the fill color of the shape, or null if shape has no fill color or has textured fill (in this case getFillTexture() should be used instead)
Specified by:
getFillColor in interface INode<Node,Path>
Returns:
the fill color of the shape

getFillTexture

public Texture getFillTexture()
Returns the fill texture of the shape, if the shape has fill texture
Specified by:
getFillTexture in interface INode<Node,Path>
Returns:
the fill texture of the shape

getTransferPositionByPercent

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

getCompatibleAgentExtensionClass

@AnyLogicInternalAPI
public final 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<Node,Path>

getTransporters

public List<Agent> getTransporters()
Returns the list of path-guided transporters inside the node which is a part of a network.
Specified by:
getTransporters in interface com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent>
Returns:
list of path-guided transporters inside node.

getNumberOfTransporters

public int getNumberOfTransporters()
Returns the number of path-guided transporters inside node which is a part of a network.
Specified by:
getNumberOfTransporters in interface com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent>
Returns:
number of path-guided transporters inside the node.

getTransporter

public Agent getTransporter(int index)
Returns the path-guided transporter with specified index inside the node which is a part of a network.
Specified by:
getTransporter in interface com.anylogic.engine.markup.material_handling.INodeDescriptor<Agent>
Returns:
path-guided transporter with a specified index.