Simulation with AnyLogic/Pedestrian Simulation/Step 8. Adding ticket windows

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Step 8. Adding Ticket Windows[edit | edit source]

Now we will expand our model by adding ticket windows.

Modify the model animation

  1. Draw lines representing ticket windows as shown in the figure below.
  2. Add these lines to a new group. Name the group windowsGroup.
  3. Draw polylines representing queues to ticket windows as shown in the figure below.
  4. The starting point of the polyline is important since it stands for the head of the queue. Place the first point of each polyline near the corresponding service line.
  5. Add these polylines to a new group. Name the group windowsQueuesGroup.
  6. Move lineBeforeGates a little bit down:

Now we will modify the model flowchart.

Modify the flowchart

  1. Add new objects and connect them as shown below:
  2. Configure PedServices object. This object will define parameters of a service representing ticket windows. Services defined by this object can be referenced by flowchart objects PedServices.
    Set the following object properties:
    • Name this object windows.
    • Specify the group containing lines representing services. Type windowsGroup in the Services (group of lines) field.
    • Specify the group containing polylines representing queues to services. Type windowsQueuesGroup in the Queues (group of lines, polylines) field.
    • Specify the service time. Type triangular(15*second(), 25*second(), 35*second()) in the Delay field (you can use code assist). We assume that service time is triangularly distributed with minimum value of 15 seconds, average value of 25, and maximum value of 35 seconds.
    • Change the Service type to Delay. Delay service is defined by a line, which pedestrians should step on for service delay time.
  3. Configure PedSelectOutput object. We need it to route non-ticketed passengers to ticket windows while other ones – straight to the ticket control gates. PedSelectOutput object is a decision making block of Pedestrian Library. The pedestrian arrived at the PedSelectOutput object is forwarded along one of five output ports depending on ratios specified for these ports.
    Set up the following object properties:
    • Specify ratios for flows going to ticket control gates (Chance 1) and to ticket windows (Chance 2) correspondingly. In this flowchart we assume that the number of passengers that have already bought their tickets is actually significantly higher.
  4. Configure just added PedService object. This flowchart object references to PedServices object defining a service representing subway ticket windows.
    Set the following object properties:
    • Specify the PedServices object defining the service pedestrians will pass through. Type windows (the name of our PedServices object) in the Service (PedServices) field.

Run the model. Note that now some passengers first go to the ticket windows to buy a ticket and only then pass through ticket control gates.