AnyLogic 9
Expand
Font size

PedService

The PedService block directs pedestrians flow through group of services. Services in pedestrian flow models define a group of similar physical service objects (turnstiles, ticket vending machines, security checkpoints, check-in counters, and so on).

There are two types of space markup shapes you can use to draw services in your pedestrian model:

  •  Service with Area — Used to define service(s) with electronic queue (like in bank office, information office on the railway station, etc.) Pedestrians do not stand in a queue line, but wait for their turn in the neighboring area. The area is defined by a polygonal node.
  •  Service with Lines — Used to define service(s) with queue(s) where pedestrians wait until the service becomes available in a queue line. Two types of queues are supported: usual queue lines and “serpentine” queue typically used in airport check-in areas.

You first draw service in the graphical editor, then add the Pedestrian Library block PedService into your flowchart. Finally you should specify the name of the service markup shape in the corresponding property of the block PedService.

Demo model: Service With Lines Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).

Parameters

Services
Here you should specify the name of the service markup shape, where pedestrians passing through this block, will be serviced.
Syntax: ServiceBase services
Queue choice policy
Defines whether pedestrian will choose Shortest queue, Closest queue, or user should individually choose queue for each pedestrian using the Queue parameter below (Other mode).
Name: queueChoicePolicy
Queue
[Visible if Queue choice policy is set to Other]
Queue the pedestrian will choose to wait for a service.
Value type: QueueUnit
Local variable: ped — the pedestrian
Delay time
Service delay time. Time, which pedestrian passes standing at entry point of Linear service, or at a point of Point service.
Value type: double
Local variables:
ped — the pedestrian
ServiceUnit service — the service point
Recovery delay
Recovery time of the service point after servicing a pedestrian, during which it stays “closed”.
Value type: double
Local variables:
ped — the pedestrian
ServiceUnit service — the service point
Pass through in reverse direction
If the option is selected (or the specified expression returns true), pedestrian pass through this service in reverse direction.
Value type: boolean
Local variable: ped — the pedestrian

Actions

On enter
Code executed when the pedestrian enters the block.
Local variable: ped — the pedestrian
On enter queue
Code executed when the pedestrian enters the queue.
Local variables:
ped — the pedestrian
QueueUnit queue — the queue
On at exit queue
Code executed when the pedestrian is ready to leave the queue.
Local variables:
ped — the pedestrian
QueueUnit queue — the queue
On exit queue
Code executed when the pedestrian leaves the queue.
Local variables:
ped — the pedestrian
QueueUnit queue — the queue
On begin service
Code executed when a pedestrian begins servicing procedure.
Local variables:
ped — the pedestrian
ServiceUnit service — the service point
On end service
Code executed when a pedestrian ends servicing procedure and about to exit the service.
Local variables:
ped — the pedestrian
ServiceUnit service — the service point
On exit
Code executed when the pedestrian exits the block via out port (in the normal way).
Local variable: ped — the pedestrian
On cancel
Code executed when a pedestrian exits the block via ccl port.
Local variable: ped — the pedestrian

Functions

Function Description
int queueSize(QueueUnit queueUnit) Returns the number of pedestrians waiting in the specified queue of the service.

queueUnit — the queue. It can be a queue line (queue of QueuePath class), a serpentine queue (QueueSerpentine), or a polygonal node (QueueArea) in case it is a part of a service with area.
The queue must belong to the service shape specified in the Services parameter of this PedService block.
Alternatively, you can get the number of pedestrians in a queue by using the queue’s size() function, e.g.: queueLine.size()
long countPeds() Returns the total number of pedestrians passed through this block.
void cancel(Agent ped) Causes the specified pedestrian to immediately leave the block via ccl port. “On cancel” code section is executed for the pedestrian.
void cancelAll() Causes all pedestrians to immediately leave the block via ccl port. “On cancel” code section is executed for each pedestrian.
boolean contains(Agent ped) Returns true if pedestrian is inside the block; returns false otherwise.
Set<Agent> getPeds() Returns a non-modifiable collection of pedestrians currently located in this block.
int size() Returns the number of pedestrians inside the block.

Ports

in

The input port.

out

The output port for pedestrians leaving the block “normally” after the successful completion of the command.

ccl

The output port for pedestrians leaving the block because of “cancel” event (caused by a call of either cancel or cancelAll method).

How can we improve this article?