AnyLogic
Expand
Font size

Class PolygonalNode<T extends Agent>

All Implemented Interfaces:
AbstractPositionalMarkup, AggregatableAnimationElement, AnimationStaticLocationProvider, IAreaNodeDescriptor<T>, IDescriptor, 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, Iterable<T>
Direct Known Subclasses:
QueueArea

public class PolygonalNode<T extends Agent>
extends AreaNode<T>
See Also:
Serialized Form

Field Summary

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

ID_NOT_SET

Constructor Summary

ConstructorDescription
PolygonalNode() 
PolygonalNode(Agent owner) 
PolygonalNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double[] dx, double[] dy, Slope slope, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, boolean limitSpeed, double maxSpeedInMPS, PathEnd<Path>[] pathEnds, Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
PolygonalNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double[] dx, double[] dy, Slope slope, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
PolygonalNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double[] dx, double[] dy, Slope slope, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
PolygonalNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double[] dx, double[] dy, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, boolean limitSpeed, double maxSpeedInMPS, PathEnd<Path>[] pathEnds, Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
PolygonalNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double[] dx, double[] dy, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
PolygonalNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double[] dx, double[] dy, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
PolygonalNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, IAreaNodeDescriptor<T> descriptor, double x, double y, double z, double[] dx, double[] dy, Slope slope, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors) 
PolygonalNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, IAreaNodeDescriptor<T> descriptor, double x, double y, double z, double[] dx, double[] dy, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors) 

Method Summary

Modifier and TypeMethodDescription
voidaddVertex(double x, double y)
Adds a point to the collection of vertices that will be used to initialize the polygon of this node.
doublearea(AreaUnits units)
Returns the area of this area, measured in area units
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
BoundingRectanglegetBoundingRectangle() 
doublegetNearestPoint(double x, double y, double z, Point output)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y, z) point.
doublegetNearestPoint(double px, double py, Point output)
Calculates (using the output object) the point in this space markup element nearest to the given (x, y) point.
intgetNPoints()
Returns the number of points in the markup element.
doublegetPointDx(int i)
Returns the x coordinate of a particular point of the markup element relative to the start point.
doublegetPointDy(int i)
Returns the y coordinate of a particular point of the markup element relative to the start point.
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).
doublegetXMax()
Returns the x coordinate of the bottom-right corner of bounding rectangle for this markup element.
doublegetXMin()
Returns the x coordinate of the top-left corner of bounding rectangle for this markup element.
doublegetYMax()
Returns the y coordinate of the bottom-right corner of bounding rectangle for this markup element.
doublegetYMin()
Returns the y coordinate of the top-left corner of bounding rectangle for this markup element.
PointrandomPointInside(Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.

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

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

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

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

getRotation, getSpace, isVisible

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

initializeInternal, onAggregatorVisibilityChanged, postInitialize

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

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

getNearestPoint, getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside

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

getName

Methods inherited from interface java.lang.Iterable

forEach, spliterator

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

setLevel

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

PolygonalNode

public PolygonalNode()

PolygonalNode

public PolygonalNode(Agent owner)

PolygonalNode

@Deprecated
public PolygonalNode(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double x,
 double y,
 double z,
 double[] dx,
 double[] dy,
 Slope slope,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle lineStyle,
 PositionChoiceMode positionChoiceMode,
 PathEnd<Path>[] pathEnds,
 Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
x -
y -
z -
dx -
dy -
slope -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
pathEnds -
attractors -

PolygonalNode

@AnyLogicInternalCodegenAPI
public PolygonalNode(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 IAreaNodeDescriptor<T> descriptor,
 double x,
 double y,
 double z,
 double[] dx,
 double[] dy,
 Slope slope,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle lineStyle,
 PositionChoiceMode positionChoiceMode,
 PathEnd<Path>[] pathEnds,
 Attractor... attractors)

PolygonalNode

@AnyLogicInternalCodegenAPI
public PolygonalNode(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 IAreaNodeDescriptor<T> descriptor,
 double x,
 double y,
 double z,
 double[] dx,
 double[] dy,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle lineStyle,
 PositionChoiceMode positionChoiceMode,
 PathEnd<Path>[] pathEnds,
 Attractor... attractors)

PolygonalNode

@Deprecated
public PolygonalNode(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double x,
 double y,
 double z,
 double[] dx,
 double[] dy,
 Slope slope,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle lineStyle,
 PositionChoiceMode positionChoiceMode,
 boolean limitSpeed,
 double maxSpeedInMPS,
 PathEnd<Path>[] pathEnds,
 Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
x -
y -
z -
dx -
dy -
slope -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
limitSpeed -
maxSpeedInMPS -
pathEnds -
attractors -

PolygonalNode

@Deprecated
public PolygonalNode(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double x,
 double y,
 double z,
 double[] dx,
 double[] dy,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle lineStyle,
 PositionChoiceMode positionChoiceMode,
 PathEnd<Path>[] pathEnds,
 Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
x -
y -
z -
dx -
dy -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
pathEnds -
attractors -

PolygonalNode

@Deprecated
public PolygonalNode(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double x,
 double y,
 double z,
 double[] dx,
 double[] dy,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle lineStyle,
 PositionChoiceMode positionChoiceMode,
 boolean limitSpeed,
 double maxSpeedInMPS,
 PathEnd<Path>[] pathEnds,
 Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
x -
y -
z -
dx -
dy -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
limitSpeed -
maxSpeedInMPS -
pathEnds -
attractors -

PolygonalNode

@Deprecated
public PolygonalNode(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double x,
 double y,
 double z,
 double[] dx,
 double[] dy,
 Slope slope,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle lineStyle,
 PositionChoiceMode positionChoiceMode,
 Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
x -
y -
z -
dx -
dy -
slope -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
attractors -

PolygonalNode

@Deprecated
public PolygonalNode(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double x,
 double y,
 double z,
 double[] dx,
 double[] dy,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle lineStyle,
 PositionChoiceMode positionChoiceMode,
 Attractor... attractors)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
x -
y -
z -
dx -
dy -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
attractors -

Method Details

addVertex

public void addVertex(double x,
 double y)
Adds a point to the collection of vertices that will be used to initialize the polygon of this node. The element should be uninitialized
Parameters:
x - x coordinate of the point
y - y coordinate of the 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

getNearestPoint

public double getNearestPoint(double px,
 double py,
 Point output)
Description copied from class: NetworkMarkupElement
Calculates (using the output object) the point in this space markup element nearest to the given (x, y) point. Returns the square of distance to the point (in the XY-projection). All the calculations are performed in the horizontal projection (z-coordinates aren't used, as if all of the z coordinates were zero).
Specified by:
getNearestPoint in class NetworkMarkupElement
Parameters:
px - x coordinate of the point
py - y coordinate of the point
output - the output point to write result to. Note that output.z is left unchanged.
Returns:
the square of distance to the nearest point in the horizontal (XY) projection

getNearestPoint

public double getNearestPoint(double x,
 double y,
 double z,
 Point output)
Description copied from class: NetworkMarkupElement
Calculates (using the output object) the point in this space markup element nearest to the given (x, y, z) point. Returns the square of distance to the point.
Specified by:
getNearestPoint in class NetworkMarkupElement
Parameters:
x - x coordinate of the point
y - y coordinate of the point
z - z coordinate of the point
output - the output point to write result to.
Returns:
the square of distance to the nearest 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
Overrides:
getPosition in class AreaNode<T extends Agent>
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

getXMin

public double getXMin()
Returns the x coordinate of the top-left corner of bounding rectangle for this markup element. (AreaNode.getX() is included)
Returns:
the minimum x coordinate of the markup element

getXMax

public double getXMax()
Returns the x coordinate of the bottom-right corner of bounding rectangle for this markup element. (AreaNode.getX() is included)
Returns:
the maximum x coordinate of the markup element
Since:
6.8

getYMin

public double getYMin()
Returns the y coordinate of the top-left corner of bounding rectangle for this markup element. (AreaNode.getY() is included)
Returns:
the minimum y coordinate of the markup element
Since:
6.8

getYMax

public double getYMax()
Returns the y coordinate of the bottom-right corner of bounding rectangle for this markup element. (AreaNode.getY() is included)
Returns:
the maximum y coordinate of the markup element
Since:
6.8

getNPoints

public int getNPoints()
Returns the number of points in the markup element.
Returns:
the number of points in the markup element

getPointDx

public double getPointDx(int i)
Returns the x coordinate of a particular point of the markup element relative to the start point.
Parameters:
i - the index of the point (starting from 0)
Returns:
the x coordinate of the point relative to the start point (AreaNode.getX(), AreaNode.getY())

getPointDy

public double getPointDy(int i)
Returns the y coordinate of a particular point of the markup element relative to the start point.
Parameters:
i - the index of the point (starting from 0)
Returns:
the y coordinate of the point relative to the start point (AreaNode.getX(), AreaNode.getY())

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

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()

area

@AnyLogicInternalAPI
public double area(AreaUnits units)
Description copied from class: AreaNode
Returns the area of this area, measured in area units
Specified by:
area in class AreaNode<T extends Agent>
Parameters:
units - the area units
Returns:
area of this area, measured in area units