AnyLogic AnyLogic
Expand
Font size

Class RectangularNode<T extends Agent>

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>

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

Constructor Summary

Constructors 
RectangularNode()  
RectangularNode​(Agent owner)  
RectangularNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, IAreaNodeDescriptor<T> descriptor, double x, double y, double z, double width, double height, double rotation, Slope slope, java.awt.Paint fillColor, java.awt.Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors)  
RectangularNode​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, IAreaNodeDescriptor<T> descriptor, double x, double y, double z, double width, double height, double rotation, 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 
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. in the same system with the coordinates of this shape, x and y)
BoundingRectangle getBoundingRectangle()  
Point getCenter()
Returns coordinates of the rectangle center.
Point getCenter​(Point p)
Returns coordinates of the rectangle center.
double getHeight()
Returns the height of the markup shape.
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.
Point[] getPoints()  
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 getRotation()
Returns the rotation of the shape.
double getWidth()
Returns the width of the markup shape.
Point randomPointInside​(java.util.Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
void setRotation​(double rotation)
Sets the rotation of the shape.
void setSize​(double width, double height)
Sets the width and height of the markup shape.
Area3D toArea3D()
Returns the 3D representation of this area
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

RectangularNode

public RectangularNode()

RectangularNode

public RectangularNode​(Agent owner)

RectangularNode

@Deprecated
public RectangularNode​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       double x,
                       double y,
                       double z,
                       double width,
                       double height,
                       double rotation,
                       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 -
width -
height -
rotation -
slope -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
pathEnds -
attractors -

RectangularNode

@AnyLogicInternalCodegenAPI
public RectangularNode​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       IAreaNodeDescriptor<T> descriptor,
                       double x,
                       double y,
                       double z,
                       double width,
                       double height,
                       double rotation,
                       Slope slope,
                       java.awt.Paint fillColor,
                       java.awt.Paint lineColor,
                       double lineWidth,
                       LineStyle lineStyle,
                       PositionChoiceMode positionChoiceMode,
                       PathEnd<Path>[] pathEnds,
                       Attractor... attractors)

RectangularNode

@AnyLogicInternalCodegenAPI
public RectangularNode​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       IAreaNodeDescriptor<T> descriptor,
                       double x,
                       double y,
                       double z,
                       double width,
                       double height,
                       double rotation,
                       java.awt.Paint fillColor,
                       java.awt.Paint lineColor,
                       double lineWidth,
                       LineStyle lineStyle,
                       PositionChoiceMode positionChoiceMode,
                       PathEnd<Path>[] pathEnds,
                       Attractor... attractors)

RectangularNode

@Deprecated
public RectangularNode​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       double x,
                       double y,
                       double z,
                       double width,
                       double height,
                       double rotation,
                       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 -
width -
height -
rotation -
slope -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
limitSpeed -
maxSpeedInMPS -
pathEnds -
attractors -

RectangularNode

@Deprecated
public RectangularNode​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       double x,
                       double y,
                       double z,
                       double width,
                       double height,
                       double rotation,
                       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 -
width -
height -
rotation -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
pathEnds -
attractors -

RectangularNode

@Deprecated
public RectangularNode​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       double x,
                       double y,
                       double z,
                       double width,
                       double height,
                       double rotation,
                       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 -
width -
height -
rotation -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
limitSpeed -
maxSpeedInMPS -
pathEnds -
attractors -

RectangularNode

@Deprecated
public RectangularNode​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       double x,
                       double y,
                       double z,
                       double width,
                       double height,
                       double rotation,
                       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 -
width -
height -
rotation -
slope -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
attractors -

RectangularNode

@Deprecated
public RectangularNode​(Agent owner,
                       ShapeDrawMode drawMode,
                       boolean isPublic,
                       double x,
                       double y,
                       double z,
                       double width,
                       double height,
                       double rotation,
                       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 -
width -
height -
rotation -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
attractors -

Method Detail

getWidth

public double getWidth()
Returns the width of the markup shape.
Returns:
the width of the markup shape

getHeight

public double getHeight()
Returns the height of the markup shape.
Returns:
the height of the markup shape

setSize

public void setSize​(double width,
                    double height)
Sets the width and height of the markup shape.
Parameters:
width - the new width of the markup shape
height - the new height of the markup shape

setRotation

public void setRotation​(double rotation)
Sets the rotation of the shape.
Parameters:
r - the new value of rotation in radians

getRotation

public double getRotation()
Returns the rotation of the shape.
Returns:
the rotation of the shape in radians, clockwise

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

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

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

getCenter

public Point getCenter()
Returns coordinates of the rectangle center.
Returns:
coordinates of the rectangle center

getCenter

public Point getCenter​(Point p)
Returns coordinates of the rectangle center.
Returns:
coordinates of the rectangle center

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

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()

getPoints

@AnyLogicInternalAPI
public Point[] getPoints()

toArea3D

public Area3D toArea3D()
Returns the 3D representation of this area
Returns:
the 3D representation of this area
How can we improve this article?