PedService


PedService object 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, etc.) 

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.

  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

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
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 [dynamic]
[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 [dynamic]
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 [dynamic]
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 [dynamic]
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]
Code executed when the pedestrian enters the object.
Local variables: ped - the pedestrian 
On enter queue [code]
Code executed when the pedestrian enters the queue.
Local variables: ped - the pedestrian,
             QueueUnit queue
- the queue
On at exit queue [code]
Code executed when the pedestrian is ready to leave the queue.
Local variables: ped - the pedestrian,
             QueueUnit queue
- the queue
On exit queue [code]
Code executed when the pedestrian leaves the queue.
Local variables: ped - the pedestrian,
             QueueUnit queue
- the queue
On begin service [code]
Code executed when a pedestrian begins servicing procedure.
Local variable: ped - the pedestrian
                         ServiceUnit service - the service point
On end service [code]
Code executed when a pedestrian ends servicing procedure and about to exit the service.
Local variable: ped - the pedestrian
                         ServiceUnit service - the service point
On exit [code]
Code executed when the pedestrian exits the object via out port (in the normal way).
Local variable: ped - the pedestrian 
On cancel [code]
Code executed when a pedestrian exits the block via ccl port.
Local variable: ped - the pedestrian 

Functions

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

long countPeds() - Returns total number of pedestrians passed through this block.

void cancel(Agent ped) - Causes the specified pedestrian to immediately leave the object via ccl port. "On cancel" code section is executed for the pedestrian.

void cancelAll() - Causes all pedestrians to immediately leave the object via ccl port. "On cancel" code section is executed for each pedestrian.

boolean contains(Agent ped) - Returns true if pedestrian is inside the object; returns false otherwise.

Set<Agent> getPeds() - Returns a non-modifiable collection of pedestrians currently located in this block.

int size() - Returns number of pedestrians inside the block.

Ports

in
The input port.
out
The output port for pedestrians leaving the object "normally" after the successful completion of the command.
ccl
The output port for pedestrians leaving the object because of "cancel" event (caused by a call of either cancel or cancelAll method).