AnyLogic
Expand
Font size
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ServiceLine, ServicePoint

public abstract class ServiceUnit<Q extends QueueUnit>
extends AbstractMarkupSubunit<ServiceBase<?,​Q>>
Base class for service units which are used in Service space markup elements
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Method Summary

All Methods Instance Methods Concrete Methods 
Q customSelectQueue()
This method should be overridden to return queue in CUSTOM queue choice policy
BoundingRectangle getBoundingRectangle()  
Q getClosestQueue()
Returns the queue that is the closest to the service, no matter whether it is empty or not.
Q getClosestQueueNotEmpty()
Returns the non-empty queue that is the closest to the service element.
java.awt.Color getColor()
Returns the color of the markup shape.
ServiceQueueChoicePolicy getCustomQueueChoicePolicy()
Returns custom queue choice policy.
Q getLongestQueue()
Returns the queue containing the maximum number of pedestrians.
boolean isSuspended()
Returns true if the service element is in suspended state; returns false otherwise.
int queuePriority​(Q queue)
This method should be overridden to return queue in PRIORITY queue choice policy
void setColor​(java.awt.Color color)
Sets the color of the markup shape.
void setSuspended​(boolean suspended)
Sets the service element to suspended state if the suspended value is true; sets the service element to active state otherwise.
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

Method Detail

getColor

public java.awt.Color getColor()
Returns the color of the markup shape.
Returns:
the color of the markup shape
Since:
7.2

setColor

public void setColor​(java.awt.Color color)
Sets the color of the markup shape.
Parameters:
color - the new color, null = do not draw the shape
Since:
7.2

getCustomQueueChoicePolicy

public ServiceQueueChoicePolicy getCustomQueueChoicePolicy()
Returns custom queue choice policy. If not defined returns null.

customSelectQueue

@AnyLogicInternalCodegenAPI
public Q customSelectQueue()
This method should be overridden to return queue in CUSTOM queue choice policy

queuePriority

@AnyLogicInternalCodegenAPI
public int queuePriority​(Q queue)
This method should be overridden to return queue in PRIORITY queue choice policy

getClosestQueue

public Q getClosestQueue()
Returns the queue that is the closest to the service, no matter whether it is empty or not.
Returns:
the queue that is the closest to the service

getClosestQueueNotEmpty

public Q getClosestQueueNotEmpty()
Returns the non-empty queue that is the closest to the service element.
Parameters:
serviceUnit - service point
Returns:
the closest non-empty queue

getLongestQueue

public Q getLongestQueue()
Returns the queue containing the maximum number of pedestrians.
Parameters:
serviceUnit - service point
Returns:
the queue containing the maximum number of pedestrians.

isSuspended

public boolean isSuspended()
Returns true if the service element is in suspended state; returns false otherwise. A suspended element is inactive and does not accept pedestrians.
Returns:
true if the service element is in suspended state; returns false otherwise

setSuspended

public void setSuspended​(boolean suspended)
Sets the service element to suspended state if the suspended value is true; sets the service element to active state otherwise.
Parameters:
suspended - the suspended value

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()
How can we improve this article?