AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, LevelElement, LevelMarkup, SVGElement, Serializable

public class ServiceWLine<S extends ServiceUnit<QueuePath>>
extends ServiceBase<S,QueuePath>
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
ServiceWLine() 
ServiceWLine(Agent owner, ShapeDrawMode drawMode, boolean isPublic, ServiceWLineType type, boolean bidirectional, S[] services, QueuePath[] queues, QueuePath[] reverseQueues, ServiceQueueChoicePolicy queueChoicePolicy, boolean waitForExit, Color serviceColor, Color queueColor, Color reverseQueueColor)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
ServiceWLine(Agent owner, ShapeDrawMode drawMode, boolean isPublic, ServiceWLineType type, boolean bidirectional, S[] services, QueuePath[] queues, QueuePath[] reverseQueues, ServiceQueueChoicePolicy queueChoicePolicy, boolean waitForExit, Color serviceColor, Color queueColor, Color reverseQueueColor, ServiceGroupBehaviorMode groupBehaviorMode, ServiceGroupBehavior groupBehavior, AreaNode groupWaitingArea)
Deprecated.
deprecated in version 8.4, will be removed in the future releases

Method Summary

Modifier and TypeMethodDescription
voidaddQueue(QueuePath queue)
Adds a queue to this service.
voidaddReverseQueue(QueuePath queue)
Adds a reverse queue to this service.
QueuePathcustomSelectQueue(S serviceUnit)
This method should be overridden to return queue in CUSTOM queue choice policy
BoundingRectanglegetBoundingRectangle() 
ServiceGroupBehaviorgetGroupBehavior()
Returns the currently set group behavior for this service with lines
ServiceGroupBehaviorModegetGroupBehaviorMode()
Returns currently set group behavior mode for this service with lines
AreaNodegetGroupWaitingArea()
Returns the area markup element (if any) associated with the current service with lines.
ServiceQueueChoicePolicygetQueueChoicePolicy()
Returns the queue choice policy for this service with lines
ColorgetQueueColor()
Returns the color of the queue elements.
List<QueuePath>getQueues()
Returns the list of all queues of this service
ColorgetReverseQueueColor()
Returns the color of the reverse queue elements.
List<QueuePath>getReverseQueues()
Returns the list of all reverse queues of this service
QueuePathgetShortestQueue(Agent agent, boolean reverse)
Returns the queue containing the least number of pedestrians.
ServiceWLineTypegetType()
Returns the type of this service
booleanisBidirectional()
Returns true if the service with lines is bidirectional, i.e.
booleanisWaitForExit()
Returns true if the service with lines is set to wait for exit, i.e.
voidpostInitialize()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
intqueuePriority(QueuePath queue)
This method should be overridden to return queue in PRIORITY queue choice policy
voidsetBidirectional(boolean bidirectional)
Sets this service to be bidirectional allowing pedestrians to pass services in both directions if the argument is true.
voidsetGroupBehavior(ServiceGroupBehavior groupBehavior)
Sets the group behavior for this service with lines
voidsetGroupBehaviorMode(ServiceGroupBehaviorMode groupBehaviorMode)
Sets the behavior mode for groups in this service with lines
voidsetGroupWaitingArea(AreaNode groupWaitingArea)
Sets the area markup element for the group members to wait in.
voidsetQueueChoicePolicy(ServiceQueueChoicePolicy queueChoicePolicy)
Sets the policy for choosing a queue to enter by a pedestrian.
voidsetQueueColor(Color queueColor)
Sets the color of the queue elements.
voidsetReverseQueueColor(Color reverseQueueColor)
Sets the color of the reverse queue elements.
voidsetType(ServiceWLineType type)
Sets the type of this service.
voidsetWaitForExit(boolean waitForExit)
If the argument is true, the service with lines will be set to make pedestrians wait for exit, i.e.

Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup

getDrawMode, getLevel, setLevel

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged

Constructor Details

ServiceWLine

public ServiceWLine()

ServiceWLine

@Deprecated
public ServiceWLine(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 ServiceWLineType type,
 boolean bidirectional,
 S[] services,
 QueuePath[] queues,
 QueuePath[] reverseQueues,
 ServiceQueueChoicePolicy queueChoicePolicy,
 boolean waitForExit,
 Color serviceColor,
 Color queueColor,
 Color reverseQueueColor)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
type -
bidirectional -
services -
queues -
reverseQueues -
queueChoicePolicy -
waitForExit -
serviceColor -
queueColor -
reverseQueueColor -

ServiceWLine

@Deprecated
public ServiceWLine(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 ServiceWLineType type,
 boolean bidirectional,
 S[] services,
 QueuePath[] queues,
 QueuePath[] reverseQueues,
 ServiceQueueChoicePolicy queueChoicePolicy,
 boolean waitForExit,
 Color serviceColor,
 Color queueColor,
 Color reverseQueueColor,
 ServiceGroupBehaviorMode groupBehaviorMode,
 ServiceGroupBehavior groupBehavior,
 AreaNode groupWaitingArea)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
type -
bidirectional -
services -
queues -
reverseQueues -
queueChoicePolicy -
waitForExit -
serviceColor -
queueColor -
reverseQueueColor -
groupBehaviorMode -
groupBehavior -
groupWaitingArea -

Method Details

setType

public void setType(ServiceWLineType type)
Sets the type of this service. The element should be uninitialized
Parameters:
type - new type, possible values are:
  • SERVICE_TYPE_POINT
  • SERVICE_TYPE_LINEAR
  • getType

    public ServiceWLineType getType()
    Returns the type of this service
    Returns:
    the type of this service, possible values are
  • SERVICE_TYPE_POINT
  • SERVICE_TYPE_LINEAR
  • isBidirectional

    public boolean isBidirectional()
    Returns true if the service with lines is bidirectional, i.e. pedestrians can pass services in both directions. Returns false otherwise.
    Returns:

    setBidirectional

    public void setBidirectional(boolean bidirectional)
    Sets this service to be bidirectional allowing pedestrians to pass services in both directions if the argument is true. The element should be uninitialized
    Parameters:
    bidirectional -

    setWaitForExit

    public void setWaitForExit(boolean waitForExit)
    If the argument is true, the service with lines will be set to make pedestrians wait for exit, i.e. the service will not start servicing other pedestrians if a pedestrian is currently being serviced.

    isWaitForExit

    public boolean isWaitForExit()
    Returns true if the service with lines is set to wait for exit, i.e. the service cannot start servicing other pedestrians if a pedestrian is currently being serviced. Returns false otherwise.

    setQueueChoicePolicy

    public void setQueueChoicePolicy(ServiceQueueChoicePolicy queueChoicePolicy)
    Sets the policy for choosing a queue to enter by a pedestrian. The element should be uninitialized
    Parameters:
    queueChoicePolicy - new policy, possible values are:
  • SERVICE_QUEUE_LONGEST
  • SERVICE_QUEUE_CLOSEST_STRICT
  • SERVICE_QUEUE_CLOSEST_NON_EMPTY
  • SERVICE_QUEUE_NEXT_ROUND_ROBIN
  • SERVICE_QUEUE_PRIORITY
  • SERVICE_QUEUE_CUSTOM
  • getQueueChoicePolicy

    public ServiceQueueChoicePolicy getQueueChoicePolicy()
    Returns the queue choice policy for this service with lines
    Returns:
    queue choice policy, possible values are:
  • SERVICE_QUEUE_LONGEST
  • SERVICE_QUEUE_CLOSEST_STRICT
  • SERVICE_QUEUE_CLOSEST_NON_EMPTY
  • SERVICE_QUEUE_NEXT_ROUND_ROBIN
  • SERVICE_QUEUE_PRIORITY
  • SERVICE_QUEUE_CUSTOM
  • setGroupBehaviorMode

    public void setGroupBehaviorMode(ServiceGroupBehaviorMode groupBehaviorMode)
    Sets the behavior mode for groups in this service with lines
    Parameters:
    groupBehaviorMode - behavior for groups mode. Either SERVICE_GROUP_BEHAVIOR_SAME_FOR_ALL_GROUPS or SERVICE_GROUP_BEHAVIOR_DEPENDS_ON_INCOMING_GROUP

    getGroupBehaviorMode

    public ServiceGroupBehaviorMode getGroupBehaviorMode()
    Returns currently set group behavior mode for this service with lines
    Returns:
    behavior for groups mode. Either SERVICE_GROUP_BEHAVIOR_SAME_FOR_ALL_GROUPS or SERVICE_GROUP_BEHAVIOR_DEPENDS_ON_INCOMING_GROUP

    setGroupBehavior

    public void setGroupBehavior(ServiceGroupBehavior groupBehavior)
    Sets the group behavior for this service with lines
    Parameters:
    groupBehavior - new behavior. Possible values are:
  • SERVICE_GROUP_INDIVIDUAL_SERVING
  • SERVICE_GROUP_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_QUEUE
  • SERVICE_GROUP_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_AREA
  • getGroupBehavior

    public ServiceGroupBehavior getGroupBehavior()
    Returns the currently set group behavior for this service with lines
    Returns:
    group behavior for this service with lines. Possible values are:
  • SERVICE_GROUP_INDIVIDUAL_SERVING
  • SERVICE_GROUP_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_QUEUE
  • SERVICE_GROUP_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_AREA
  • setGroupWaitingArea

    public void setGroupWaitingArea(AreaNode groupWaitingArea)
    Sets the area markup element for the group members to wait in. The service should be uninitialized
    Parameters:
    groupWaitingArea - new area for group waiting

    getGroupWaitingArea

    public AreaNode getGroupWaitingArea()
    Returns the area markup element (if any) associated with the current service with lines.
    Returns:
    the area markup element (if any) associated with the current service with lines.

    addQueue

    public void addQueue(QueuePath queue)
    Adds a queue to this service. The service should be uninitialized
    Parameters:
    queue - queue to be added

    addReverseQueue

    public void addReverseQueue(QueuePath queue)
    Adds a reverse queue to this service. The service should be uninitialized
    Parameters:
    queue - queue to be added

    getQueues

    public List<QueuePath> getQueues()
    Description copied from class: ServiceBase
    Returns the list of all queues of this service
    Specified by:
    getQueues in class ServiceBase<S extends ServiceUnit<QueuePath>,QueuePath>
    Returns:
    the list of all queues of this service

    getReverseQueues

    public List<QueuePath> getReverseQueues()
    Returns the list of all reverse queues of this service
    Returns:
    the list of all reverse queues of this service

    customSelectQueue

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

    queuePriority

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

    postInitialize

    @AnyLogicInternalAPI
    public void postInitialize()
    Description copied from interface: AggregatableAnimationElement
    This method is internal and shouldn't be called by user.
    it may be removed/renamed in future.
    Specified by:
    postInitialize in interface AggregatableAnimationElement
    Overrides:
    postInitialize in class ServiceBase<S extends ServiceUnit<QueuePath>,QueuePath>

    getQueueColor

    public Color getQueueColor()
    Returns the color of the queue elements.
    Returns:
    the color of the queue elements.

    setQueueColor

    public void setQueueColor(Color queueColor)
    Sets the color of the queue elements.
    Parameters:
    queueColor - new color

    getReverseQueueColor

    public Color getReverseQueueColor()
    Returns the color of the reverse queue elements.
    Returns:
    the color of the reverse queue elements.

    setReverseQueueColor

    public void setReverseQueueColor(Color reverseQueueColor)
    Sets the color of the reverse queue elements.
    Parameters:
    reverseQueueColor - new color

    getBoundingRectangle

    @AnyLogicInternalAPI
    public BoundingRectangle getBoundingRectangle()

    getShortestQueue

    public QueuePath getShortestQueue(Agent agent,
     boolean reverse)
    Returns the queue containing the least number of pedestrians.
    Parameters:
    agent - the agent
    reverse - reverse or forward queues to choose from
    Returns:
    the queue containing the least number of pedestrians.