AnyLogic
Expand
Font size
All Implemented Interfaces:
java.io.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:
RectangularNode, PolygonalNode, Serialized Form

Constructor Summary

Constructors 
Attractor​(double x, double y, double orientation)
Creates new attractor object
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
double getOrientation()
Returns the orientation.
Position getPosition​(Position out)
Returns the position associated with this attractor.
double getRelativeX()
Returns the x coordinate relative to Area/Node
double getRelativeY()
Returns the y coordinate relative to Area/Node
double getX()
Returns the absolute x coordinate
double getY()
Returns the absolute y coordinate
double getZ()
Returns the absolute z coordinate (which is defined by container node/area)
Modifier and Type Method Description

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 Detail

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:
AreaNode.addAttractor(Attractor)

Method Detail

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
How can we improve this article?