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 agent – If selected, the service is also visible on the upper agent 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 starting point (if service type is Linear).
Y – Y-coordinate of the service point (if service type is Point) or the service line's starting 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 ending point.
dY – [Visible if service type is Linear] Y-coordinate of the service line's ending point.
Function |
Description |
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. |
int queuePriority(queue) |
This method should be overridden to return the queue priority in Priority queue choice policy. Parameter: |
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. |
setSuspended(boolean suspended) |
Sets the service element to suspended state if the suspended value is true; sets the service element
to active state otherwise. |
Color getColor() |
Returns the color of the service element. |
setColor(Color color) |
Sets the color of the service element. Parameter: |
Function |
Description |
double getStartX() double getStartY() double getStartZ() |
Returns the X (Y, Z) coordinate of the service line's starting point. |
double getEndX() double getEndY() double getEndZ() |
Returns the X (Y, Z) coordinate of the service line's ending point. |
double length() |
Returns the length of the service line in 2D space, measured in pixels. |
Position getForwardStartPosition Position
getReverseStartPosition |
Returns the position associated with the service line's starting (ending) point, which comprises the x, y, and z coordinates, horizontal and vertical rotation angles. Parameter: |
Position
getForwardPositionByOffset Position
getReversePositionByOffset |
Returns the position of the point that is offset
from the service line's starting (ending) point by the provided offset value (in pixels). The
position data comprises the x, y, and z coordinates, horizontal and
vertical rotation angles (in radians). Parameters: |
double getForwardOrientation() double getReverseOrientation() |
Returns the service line's horizontal rotation angle (in radians) around the starting (ending) point. |
Function |
Description |
double getX() double getY() double getZ() |
Returns the X (Y, Z) coordinate of the service point. |
Position getPosition(Position out) |
Returns the position associated with the service point, which comprises the x, y, and z coordinates, horizontal and vertical rotation angles. Parameter: |
double getOrientation() |
Returns the service's orientation angle (in radians), i.e. the rotation angle set for the 2D / 3D model of the pedestrian being serviced. |