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, Serializable, Iterable<T>

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

Constructor Summary

ConstructorDescription
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, 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
RectangularNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double z, double width, double height, double rotation, 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
RectangularNode(Agent owner, ShapeDrawMode drawMode, boolean isPublic, IAreaNodeDescriptor<T> descriptor, double x, double y, double z, double width, double height, double rotation, Slope slope, Paint fillColor, 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, Paint fillColor, Paint lineColor, double lineWidth, LineStyle lineStyle, PositionChoiceMode positionChoiceMode, PathEnd<Path>[] pathEnds, Attractor... attractors) 

Method Summary

Modifier and TypeMethodDescription
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() 
PointgetCenter()
Returns coordinates of the rectangle center.
PointgetCenter(Point p)
Returns coordinates of the rectangle center.
doublegetHeight()
Returns the height of the markup shape.
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.
Point[]getPoints() 
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).
doublegetRotation()
Returns the rotation of the shape.
doublegetWidth()
Returns the width of the markup shape.
PointrandomPointInside(Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
voidsetRotation(double rotation)
Sets the rotation of the shape.
voidsetSize(double width, double height)
Sets the width and height of the markup shape.
Area3DtoArea3D()
Returns the 3D representation of this area

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

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,
 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 -
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,
 Paint fillColor,
 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,
 Paint fillColor,
 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,
 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 -
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,
 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 -
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,
 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 -
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,
 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 -
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,
 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 -
width -
height -
rotation -
fillColor -
lineColor -
lineWidth -
lineStyle -
positionChoiceMode -
attractors -

Method Details

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