AnyLogic
Expand
Font size
All Implemented Interfaces:
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

Modifier and TypeMethodDescription
QcustomSelectQueue()
This method should be overridden to return queue in CUSTOM queue choice policy
BoundingRectanglegetBoundingRectangle() 
QgetClosestQueue()
Returns the queue that is the closest to the service, no matter whether it is empty or not.
QgetClosestQueueNotEmpty()
Returns the non-empty queue that is the closest to the service element.
ColorgetColor()
Returns the color of the markup shape.
ServiceQueueChoicePolicygetCustomQueueChoicePolicy()
Returns custom queue choice policy.
QgetLongestQueue()
Returns the queue containing the maximum number of pedestrians.
booleanisSuspended()
Returns true if the service element is in suspended state; returns false otherwise.
intqueuePriority(Q queue)
This method should be overridden to return queue in PRIORITY queue choice policy
voidsetColor(Color color)
Sets the color of the markup shape.
voidsetSuspended(boolean suspended)
Sets the service element to suspended state if the suspended value is true; sets the service element to active state otherwise.

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 Details

getColor

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

setColor

public void setColor(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()