Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- size
- getPeds
- setCapacity
- isCapacityLimited
- capacity
- getExceededQueuePolicy
- isReverse
- contains
- contains
- containsSq
- startDrawing
- lineTo
- arcTo
- addSegment
- getSegmentCount
- getSegment
- iterator
- getStartPoint
- getStartPoint
- getEndPoint
- getEndPoint
- getStartPosition
- getStartPosition
- getEndPosition
- getEndPosition
- length
- getBounds
- getPositionAtOffset
- getPositionAtOffsetFromEnd
- getNearestPoint
- getBoundingRectangle
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkupSubunit<ServiceWLine<?>>
- com.anylogic.engine.markup.QueuePath
- All Implemented Interfaces:
QueueUnit
,Serializable
- Direct Known Subclasses:
QueueSerpentine
public class QueuePath extends AbstractMarkupSubunit<ServiceWLine<?>> implements QueueUnit
- See Also:
- Serialized Form
Constructor | Description |
---|---|
QueuePath | |
QueuePath |
Creates queue with unlimited capacity and the given policy for processing in case of full queue
|
QueuePath |
Creates queue with unlimited capacity
|
Modifier and Type | Method | Description |
---|---|---|
void | addSegment |
Adds segment to this markup element
|
void | arcTo |
Adds arc segment with two circular arcs (available for markup elements created with no-argument constructor)
|
int | capacity() |
Returns the capacity of the queue
|
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
boolean | containsSq |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
BoundingRectangle | getBoundingRectangle() | |
Rectangle2D | getBounds() |
Deprecated.
|
Point | getEndPoint() |
Returns the location of the end point
|
Point | getEndPoint |
Returns the location of the end point
|
Position | getEndPosition() |
Returns the end position
|
Position | getEndPosition |
Returns the end position
|
ExceededQueuePolicy | getExceededQueuePolicy() |
Returns the behavior policy to handle the case when queue capacity is exceeded
|
double | getNearestPoint |
Calculates (using the
output object) the point in this space markup element
nearest to the given (x, y) point. |
List<Agent> | getPeds() |
Returns the list of peds currently staying in the queue
|
final Position | getPositionAtOffset |
Returns the point located on the markup element with the given
offset
distance calculated from start point. |
final Position | getPositionAtOffsetFromEnd |
Returns the point located on the markup element with the given
offset
distance calculated from end point. |
MarkupSegment | getSegment |
Returns the segment by its index
|
int | getSegmentCount() |
Returns the number of segments
|
Point | getStartPoint() |
Returns the location of the start point
|
Point | getStartPoint |
Returns the location of the start point
|
Position | getStartPosition() |
Returns the start position
|
Position | getStartPosition |
Returns the start position
|
boolean | isCapacityLimited() |
Returns
true if this queue has limited capacity |
boolean | isReverse() |
Returns true if the queue is reverse; returns false otherwise.
|
Iterator<MarkupSegment> | iterator() |
Creates and returns read-only iterator over segments
|
final double | length() |
Returns the length of the markup element.
|
void | lineTo |
Adds line segment (available for markup elements created with no-argument constructor)
|
void | setCapacity |
Sets the capacity of queue
|
int | size() |
Returns the number of agents (pedestrians) staying in the queue
|
void | startDrawing |
Starts drawing (available for markup elements created with no-argument constructor)
|
public QueuePath(MarkupSegment... segments)
Creates queue with unlimited capacity
- Parameters:
segments
-
public QueuePath(ExceededQueuePolicy exceededQueuePolicy, MarkupSegment... segments)
Creates queue with unlimited capacity and the given policy for processing in case of full queue
- Parameters:
segments
-the
- policy for the case when the queue is full
public QueuePath(int capacity, ExceededQueuePolicy exceededQueuePolicy, MarkupSegment... segments)
public int size()
Returns the number of agents (pedestrians) staying in the queue
public List<Agent> getPeds()
Returns the list of peds currently staying in the queue
public void setCapacity(int capacity)
Sets the capacity of queue
- Parameters:
capacity
- the new capacity value
public boolean isCapacityLimited()
Description copied from interface:
QueueUnit
Returns
true
if this queue has limited capacity- Specified by:
isCapacityLimited
in interfaceQueueUnit
- Returns:
true
if this queue has limited capacity,false
otherwise- See Also:
-
QueueUnit.capacity()
public int capacity()
Description copied from interface:
QueueUnit
Returns the capacity of the queue
- Specified by:
capacity
in interfaceQueueUnit
- Returns:
- the capacity of the queue
- See Also:
-
QueueUnit.isCapacityLimited()
public ExceededQueuePolicy getExceededQueuePolicy()
Returns the behavior policy to handle the case when queue capacity is exceeded
- Returns:
- possible return values are:
- EXCEEDED_QUEUE_EXTEND_TO_THE_FREE_SPACE
- EXCEEDED_QUEUE_CROWD_ROUND_AT_THE_END
public boolean isReverse()
Returns true if the queue is reverse; returns false otherwise.
- Returns:
- true if the queue is reverse; returns false otherwise.
public 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)
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's container- Returns:
true
if the shape contains the point with the given coordinates
public boolean contains(double px, double py, double distance)
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), using
the given tolerance
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's containersquareDistance
- the square of distance tolerance to determine whether the given point lies on the markup element line or not- Returns:
true
if the shape contains the point with the given coordinates
public boolean containsSq(double px, double py, double squareDistance)
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), using
the given tolerance
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's containersquareDistance
- the square of distance tolerance to determine whether the given point lies on the markup element line or not- Returns:
true
if the shape contains the point with the given coordinates
public void startDrawing(double x, double y)
Starts drawing (available for markup elements created with no-argument constructor)
- Parameters:
x
- the x coordinate of the first pointy
- the y coordinate of the first point
public void lineTo(double x, double y)
Adds line segment (available for markup elements created with no-argument constructor)
- Parameters:
x
- the x coordinate of the segment end pointy
- the y coordinate of the segment end point
public void arcTo(double x, double y, double startAngle, double endAngle, double ratioStartToEnd)
Adds arc segment with two circular arcs (available for markup elements created with no-argument constructor)
- Parameters:
x
- the x coordinate of the segment end pointy
- the y coordinate of the segment end pointstartAngle
- orientation of segment line startendAngle
- orientation of segment line endratioStartToEnd
- ratio between two circular arcs
public void addSegment(MarkupSegment segment)
Adds segment to this markup element
- Parameters:
segment
- the segment, should be initialized if was created using no-argument constructor
public int getSegmentCount()
Returns the number of segments
- Returns:
- the number of segments
public MarkupSegment getSegment(int index)
Returns the segment by its index
- Parameters:
index
- the segment index, [0 ..getSegmentCount()
- 1]- Returns:
- the segment
public Iterator<MarkupSegment> iterator()
Creates and returns read-only iterator over segments
public Point getStartPoint(Point out)
Returns the location of the start point
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the first point
public Point getStartPoint()
Returns the location of the start point
- Returns:
- the Point object with coordinates of the first point
public Point getEndPoint(Point out)
Returns the location of the end point
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Point object with coordinates of the last point
public Point getEndPoint()
Returns the location of the end point
- Returns:
- the Point object with coordinates of the last point
public Position getStartPosition(Position out)
Returns the start position
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the first position
public Position getStartPosition()
Returns the start position
- Returns:
- the Position object with coordinates of the first position
public Position getEndPosition(Position out)
Returns the end position
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the last position
public Position getEndPosition()
Returns the end position
- Returns:
- the Position object with coordinates of the last position
public final double length()
Returns the length of the markup element.
- Returns:
- the length of the markup element (measured in pixels), a positive number
@Deprecated public Rectangle2D getBounds()
Deprecated.
public final Position getPositionAtOffset(double offset, Position out)
Returns the point located on the markup element with the given
offset
distance calculated from start point.- Parameters:
offset
- offset, non-negative value, should be less or equal to the full length.out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the point with the given offset and orientation along markup element line at this point
public final Position getPositionAtOffsetFromEnd(double offset, Position out)
Returns the point located on the markup element with the given
offset
distance calculated from end point.- Parameters:
offset
- offset, non-negative value, should be less or equal to the full length.out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the point with the given offset and orientation along markup element line at this point
public double getNearestPoint(double x, double y, Point out)
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).- Parameters:
x
- x coordinate of the pointy
- y coordinate of the pointoutput
- the output point to write result to. Note thatoutput.z
is left unchanged.- Returns:
- the square of distance to the nearest point in the horizontal (XY) projection
@AnyLogicInternalAPI public BoundingRectangle getBoundingRectangle()