AnyLogic
Expand
Font size
All Implemented Interfaces:
Serializable

public class Attractor
extends AbstractMarkupSubunit<AreaNode>
Attractor markup element: defines (x, y) location + orientation (rotation) of a point within some area / node markup.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
RectangularNodePolygonalNodeSerialized Form

Constructor Summary

ConstructorDescription
Attractor(double x, double y, double orientation)
Creates new attractor object

Method Summary

Modifier and TypeMethodDescription
doublegetOrientation()
Returns the orientation.
PositiongetPosition(Position out)
Returns the position associated with this attractor.
doublegetRelativeX()
Returns the x coordinate relative to Area/Node
doublegetRelativeY()
Returns the y coordinate relative to Area/Node
doublegetX()
Returns the absolute x coordinate
doublegetY()
Returns the absolute y coordinate
doublegetZ()
Returns the absolute z coordinate (which is defined by container node/area)

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

getName, getOwner

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

Attractor

public Attractor(double x,
 double y,
 double orientation)
Creates new attractor object
Parameters:
x - the x coordinate relative to Area/Node, measured in pixels
y - the y coordinate relative to Area/Node, measured in pixels
orientation - the orientation in radians, clockwise, see also Math.toRadians(double)
See Also:

Method Details

getRelativeX

public double getRelativeX()
Returns the x coordinate relative to Area/Node
Returns:
the x coordinate relative to Area/Node

getRelativeY

public double getRelativeY()
Returns the y coordinate relative to Area/Node
Returns:
the y coordinate relative to Area/Node

getX

public double getX()
Returns the absolute x coordinate
Returns:
the absolute x coordinate

getY

public double getY()
Returns the absolute y coordinate
Returns:
the absolute y coordinate

getZ

public double getZ()
Returns the absolute z coordinate (which is defined by container node/area)
Returns:
the absolute z coordinate

getOrientation

public double getOrientation()
Returns the orientation.
Returns:
the orientation in radians, clockwise
See Also:
Math.toDegrees(double)

getPosition

public Position getPosition(Position out)
Returns the position associated with this attractor. The vertical rotation is set to NaN
Parameters:
out - the Position object to write to, may be null
Returns:
the given out object, if was not null, or new instance otherwise