AnyLogic
Expand
Font size
All Implemented Interfaces:
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, java.io.Serializable, java.lang.Iterable<T>
Direct Known Subclasses:
QueueArea

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

Constructor Summary

Constructors 
PolygonalNode()  
PolygonalNode​(Agent owner)  
PolygonalNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double[] dx, double[] dy, Slope slope, java.awt.Paint fillColor, java.awt.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, java.awt.Paint fillColor, java.awt.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, java.awt.Paint fillColor, java.awt.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, java.awt.Paint fillColor, java.awt.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, java.awt.Paint fillColor, java.awt.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, java.awt.Paint fillColor, java.awt.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, java.awt.Paint fillColor, java.awt.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, java.awt.Paint fillColor, java.awt.Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
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.
double area​(AreaUnits units)
Returns the area of this area, measured in area units
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.
BoundingRectangle getBoundingRectangle()  
double getNearestPoint​(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.
double getNearestPoint​(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.
int getNPoints()
Returns the number of points in the markup element.
double getPointDx​(int i)
Returns the x coordinate of a particular point of the markup element relative to the start point.
double getPointDy​(int i)
Returns the y coordinate of a particular point of the markup element relative to the start point.
Position getPosition​(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).
double getXMax()
Returns the x coordinate of the bottom-right corner of bounding rectangle for this markup element.
double getXMin()
Returns the x coordinate of the top-left corner of bounding rectangle for this markup element.
double getYMax()
Returns the y coordinate of the bottom-right corner of bounding rectangle for this markup element.
double getYMin()
Returns the y coordinate of the top-left corner of bounding rectangle for this markup element.
Point randomPointInside​(java.util.Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
Modifier and Type Method Description

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

accessRestrictionCondition, addAgent, addAreaDataSource, addAttractor, agents, close, contains, density, getAccessRestrictionType, getAdmittedTransporters, getAgentsWaitingToEnter, getAttractors, getCapacity, getFillColor, getFillTexture, getLineColor, getLineStyle, getLineTexture, getLineWidth, getMaxSpeed, getNumberOfAdmittedAgents, getNumberOfAdmittedTransporters, getPeds, getPositionChoiceMode, getRestrictedAgentClass, getSchedule, getSlope, getThroughput, getX, getY, getZ, getZ, isAccessRestricted, isAllowedToEnter, isApplied, isAvoidedIfClosed, isLimitSpeed, isOpen, isReadyToEnter, isSpeedRestricted, iterator, notifyCancelReadyToEnter, notifyReadyToEnter, notifyReadyToEnter2, notifyReadyToExit, onClose, onEnter, onEnterDenied, onExit, onOpen, open, recalculateAccessibility, removeAgent, removeAreaDataSource, removeFromQueue, restrictAccessByCapacity, restrictAccessBySchedule, restrictAccessByThroughput, restrictAccessManually, restrictSpeed, setAccessRestricted, setAccessRestrictionType, setAvoidedIfClosed, setCapacity, setLimitSpeed, setLineColor, setLineColor, setLineStyle, setLineWidth, setMaxSpeed, setOpen, setPos, setPositionChoiceMode, setRestrictedAgentClass, setSchedule, setSlope, setSpeedRestricted, setThroughput

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

addConnection, getCompatibleAgentExtensionClass, getConnection, getConnectionsCount, getMaterialLibraryDescriptor, getNumberOfTransporters, getTransferDistance, getTransferPositionByPercent, getTransporter, getTransporters, setFillColor, setFillColor

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

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

Constructor Detail

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,
                     java.awt.Paint fillColor,
                     java.awt.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,
                     java.awt.Paint fillColor,
                     java.awt.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,
                     java.awt.Paint fillColor,
                     java.awt.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,
                     java.awt.Paint fillColor,
                     java.awt.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,
                     java.awt.Paint fillColor,
                     java.awt.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,
                     java.awt.Paint fillColor,
                     java.awt.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,
                     java.awt.Paint fillColor,
                     java.awt.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,
                     java.awt.Paint fillColor,
                     java.awt.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 Detail

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