- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkupSubunit<ServiceBase<?,
- com.anylogic.engine.markup.ServiceUnit<Q>
- 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
Modifier and Type | Method | Description |
---|---|---|
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.
|
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 |
This method should be overridden to return queue in
PRIORITY queue choice policy |
void | setColor |
Sets the color of the markup shape.
|
void | setSuspended |
Sets the service element to suspended state if the suspended value is true;
sets the service element to active state otherwise.
|
public Color getColor()
Returns the color of the markup shape.
- Returns:
- the color of the markup shape
- Since:
- 7.2
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
public ServiceQueueChoicePolicy getCustomQueueChoicePolicy()
Returns custom queue choice policy. If not defined returns
null
.@AnyLogicInternalCodegenAPI public Q customSelectQueue()
This method should be overridden to return queue in
CUSTOM
queue choice policy@AnyLogicInternalCodegenAPI public int queuePriority(Q queue)
This method should be overridden to return queue in
PRIORITY
queue choice policypublic 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
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
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.
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
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
@AnyLogicInternalAPI public BoundingRectangle getBoundingRectangle()