Service element is an integral part of the Service with Lines and Service with Area markup elements. The queue choice policy that you define for the Service with Lines or Service with Area elements is applied uniformly to all Service elements contained in them. Each individual Service element, however, allows you to select a different queue choice policy, which will override the policy set for the parent element.
There are two types of services:
Name – The name of the service. The name is used to identify and access the service from code.
Show name – If selected, the service name is displayed in the graphical editor.
Visible on upper level – If selected, the service is also visible on the upper level where this agent lives.
Override queue choice policy – The selection
overrides the policy defined for the Service
with Lines or Service
with Area markup element. It defines
the queue from which the service
will serve pedestrians. When the service becomes vacant, it chooses the
queue anew according to the selected option. The following alternative
options define the queue to be selected:
Longest queue - the queue containing the maximum number of pedestrians.
Closest queue (strict) - the queue that is closest to the service, no matter whether it is empty or not.
Closest not empty queue - the non-empty queue that is closest to the service.
Next queue (round robin) - the queues are selected sequentially in circular order.
Priority queue - the queue with the highest priority is selected (according to the expression provided in the Queue priority field below),
Other queue - the queue is returned by the expression specified in the Queue field below.
Queue – [Visible if Serve pedestrians from is set to Other] Here you can enter Java expression that returns the selected queue. Typically you place the call of your custom Java function here.
X – X-coordinate of the service point (if service type is Point) or the service line's start point (if service type is Linear).
Y – Y-coordinate of the service point (if service type is Point) or the service line's start point (if service type is Linear).
Pedestrian orientation – [Visible if service type is Point]. The option defines the rotation angle set for the 2D / 3D model of the pedestrian and allows to make the agent face the certain direction at the service point.
dX – [Visible if service type is Linear] X-coordinate of the service line's end point.
dY – [Visible if service type is Linear] Y-coordinate of the service line's end point.
getLongestQueue() - Returns the queue containing the maximum number of pedestrians..
getClosestQueue() - Returns the queue that is closest to the service, no matter whether it is empty or not.
getClosestQueueNotEmpty() - Returns the non-empty queue that is closest to the service element.
queuePriority(queue) - This method should be overridden
to return the queue priority in Priority queue choice policy.
Parameter: queue - the local variable available for the service element.
customSelectQueue() - This method should be
overridden to return a queue in Custom
queue choice policy.
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.
suspended) - Sets the service element to suspended state if suspended value is true; sets the service element to active state otherwise.
Color getColor() - Returns the color of the service element.
color) - Sets the color of the service element.
Parameter: color - the color of the service element. It is defined with a color constant, or the new Color(<red>, <green>, <blue>) constructor.
Service with lines
Service with area
Service with a "serpentine" queue
API reference: ServiceUnit class