Shopping using Triggers to Change Behavior

Tutorial demonstrating how to model Occupants that respsond to Triggers to shop.

Reading Time: 8 minutes
Created with software version: 2025.1
PDF | Printable Version

Overview

In this example, we show how triggers can be used to simulate shopping. The model simulates a walkway with shops on the side. As people walk past they are attracted to enter each shop. This is modeled using triggers. This description assumes the user is familiar with basic use of Pathfinder.

In this example, we show how Triggers can simulate shopping movement. The model simulates a walkway with shops on the side. As people walk past, the Triggers attract them to enter each shop. This tutorial assumes the user is familiar with basic use of Pathfinder.

path scrn view shopping triggers results 2024 2
Figure 1. Introduction of how triggers can simulate shopping

Before Starting

Before beginning this tutorial:

Example

As shown in Figure 2, the passageway is 5 m wide and each store is 5x5 m. People enter, walk through the passageway, and exit.

passageway and stores
Figure 2. Geometry of the passageway and stores. All dimensions are in meters.

Triggers are located in the passageway. These attract Occupants to enter the adjacent stores.

passageway and stores with Triggers added
Figure 3. The geometry of the passageway and stores with Triggers added.

Example Geometry

Make the model as shown in Figure 2.

  1. Draw the geometry, including the Doors. Example Geometry
  2. Name each Room.
  3. Name the Entry and Exit Doors.
  4. The Restaurant has four 1 m2 Rooms that represent tables, see Figure 4.
pth scrn shopping triggers restaurant
Figure 4. The Restaurant.

Queues

  1. Add Queues for all stores except the restaurant as shown in Figure 2. Each Queue name should match the store name. The Service Time at all Queues (except Fast Food) is 60 seconds.
  2. The Fast Food store has a Queue, a counter, and a seating area that the Occupants move through before exiting, see Figure 5. The Fast Food Queue has a service time of 20 seconds.

Obviously, the Service Times and restaurant wait times are not realistic. You can change them to more realistic numbers.

pth scrn shopping triggers fastfood store
Figure 5. The Fast Food store with details.

Profiles

Triggers interact with Occupant Profiles and Behaviors, so we start by creating Profiles with the attributes we want. For this model, we want to change the colors of the Occupants to show what they are doing:

  • Shopping - The Occupant is walking in the passageway and may respond to a Trigger to enter a store. The color will be green.
  • Browse - The Occupant enters a store, and is browsing. They will not purchase an item. The color will be blue.
  • Buy - The Occupant enters a store and will enter the Queue to purchase something. The color will be red.

Currently, Occupants are set to switch Behaviors to browse or buy instantaneously when responding to the Trigger; nobody changes Behavior to browse, then changes Behavior to buy. This could be changed by including a second set of Triggers inside the shops, and a second Behavior change, with certain Behavior immunity settings.

To set these Profiles
  1. Double-click Profiles in the Navigation panel.
  2. Select the Default Profile and rename the Profile to Shopping.
  3. Change the Color to green.
  4. Click the Movement tab and change the Trigger Susceptibility (Seeking) to 20%. This means that if the Occupant is walking through the passageway, they have a 20% probability of responding to a Trigger. For this model, the Trigger Susceptibility (Waiting) is not used.
  5. Now click New and make a new Profile named Browse, based on the Shopping Profile.
  6. Change the color to blue.
  7. Again click New and make a new Profile named Buy, based on the Shopping Profile.
  8. Change the color to red.
  9. Click OK to close the Edit Profiles dialog.

Behaviors

When an Occupant responds to a Trigger, they can change their Behavior. In this example, the Occupants enter the store associated with the Trigger and may browse or buy an item.

Make a Shopping Behavior

The Shopping Behavior is the "normal" Behavior in this model. When shopping the Occupants are moving in the passageway from the entrance to the Exit Door.

  1. Double-click the Goto Any Exit Behavior.
  2. Change the name to Shopping.
  3. Click the Exit Action and for the allowable Exits, select the Exit Door in the model.

Make Clothing Behaviors

We make three Behaviors to control how the Occupant responds to a Clothing Trigger. We make the Buy Clothing and Browse Clothing Behaviors first, then the Clothing Behavior that reference the buy and browse Behaviors.

The Buy Clothing Behavior
  1. Double-click Behaviors in the Navigation panel.
  2. Make a new Behavior named Buy Clothing.
  3. Add a Change Profile Action and set to 100% Buy. This change in Profile changes the color of the Occupant so that we can follow this in the results.
  4. Add a Goto Queues Action and select the Clothing Queue. In this Action, the Occupant goes to the Queue Path and waits for service.
  5. Add a Change Profile Action and set to 100% Shopping. This change in Profile changes the color of the Occupant back to the shopping state.
  6. Add a Change Behavior Action. Set the Target Behaviors to 100% Shopping. The Occupant leaves the shop and continues in the Passageway Room towards the Exit Door.
The Browse Clothing Behavior
  1. Double-click Behaviors in the Navigation panel.
  2. Make a new Behavior named Browse Clothing.
  3. Add a Change Profile Action and set to 100% Browse. This change in Profile changes the color of the Occupant so that we can follow this in the results.
  4. Add a Wait Action and set the wait time to 5 seconds.
  5. Add a Change Profile Action and set to 100% Shopping. This change in Profile changes the color of the Occupant back to the shopping state.
  6. Add a Change Behavior Action. Set the Target Behaviors to 100% Shopping. The Occupant then leaves the shop and continues in the Passageway Room towards the Exit.

Now we have two specific Clothing Behaviors in the shop: some Occupants buy something and some just browse. We set up a "decision" between the two options by adding a general Clothing Behavior.

The Clothing Behavior

This is the first Behavior for all Occupants that respond to the Clothing Trigger.

  1. Double-click Behaviors in the Navigation panel.
  2. Make a new Behavior named Clothing.
  3. Add a Goto Rooms Action and select the Room as Clothing. In this Action, the Occupant enters the shop.
  4. Add a Change Behavior Action and set the Target Behaviors to 75% Browse Clothing and 25% Buy Clothing.

Figure 6 shows the three Clothing Behaviors and the default Shopping Behavior.

path scrn view shopping triggers clothing behaviors 2024 2
Figure 6. Behaviors in the tree view.

Repeat for All Other Stores Except Fast Food and Restaurant

Repeat this pattern for all shops, except Fast Food and Restaurant. When finished, your Behaviors should look as shown in Figure 7.

You can also copy Behaviors in the Navigation panel with CTRL+C and CTRL+V.

path scrn view shopping triggers behaviors all 2024 2
Figure 7. All created Behaviors in the tree view.

Behavior for Fast Food

Every Occupant who enters the Fast Food store buys something. They: go to the Fast Food Queue, enter the Fast Food counter, go the Seating Area, wait 30 seconds, and switch back to the Shopping Profile (and the Shopping Behavior).

path scrn ui shopping triggers behavior fastfood 2024 2
Figure 8. The Fast Food Behavior.

Behavior for the Restaurant

Restaurant does not have a Queue. Instead, every Occupant who enters the shop dines. They: go to one of the four tables, wait there for 120 seconds, and switch back to the Shopping Profile (and the Shopping Behavior).

path scrn ui shopping triggers behavior restaurant 2024 2
Figure 9. The Restaurant Behavior.

This approach creates situations where Occupants join eachother at Table 1. A more advanced approach is available for Circulation Movement in a Cafeteria Using Queues.

Triggers

The Triggers are located in front of each store. As an Occupant enters the Trigger region, there is a 20% probability that they respond to the Trigger (as set in the Shopping Profile).

The Clothing Trigger

  1. In the drawing toolbar, select the Add a Trigger tool.
  2. Place the Trigger in front of the clothing store.
  3. Change the Name to Clothing.
  4. Change the Behavior to Clothing. This is the Behavior that is applied to the Occupant when they respond to the Trigger.
  5. Change the Awareness Radius to 2.5 m. Leave the other properties set to default values.

The Clothing Trigger should look as shown below.

path scrn view shopping triggers clothing trigger 2024 2
Figure 10. The Clothing Trigger.

The Other Triggers

Repeat the previous steps for each Trigger for all stores. It may be useful to change the opacity of the Passageway Room to place each Trigger object using the Snap Grid.

As in Figure 3, the Toys Trigger has a radius of 3.5 m. The store sits on the outer corner of the curve and shopping Occupants walk close to the inner corner; a bigger radius compensates to ensure they are exposed to the Toys Trigger.

We want to reduce the number of Occupants that respond to the Restaurant Trigger.

  1. Select the Restaurant Trigger.
  2. In the Properties panel, select the hyperlink Influence setting to open the Edit Influence dialog.
  3. Set the Initial Value to 25%. The probability an Occupant enters the Restaurant is now 5% (20% in the Shopping Profile x 25% in the Restaurant Trigger).

Occupant Sources

  1. Right-click the Entry Door and select Add Occupant Source.
  2. Set the Flow Rate to Constant and enter 0.2 pers/s. One Occupant arrives every 5 seconds.
  3. Set the Profile to Shopping. This sets the color.
  4. Set the Behavior to Shopping. The people have the shopping Behavior, so they enter and move toward the specified exit.

Run the Simulation

  1. In the Simulation menu, click Simulation Parameters.
  2. Set the End Time to 1200 seconds.
  3. Click Run Simulation.

View Results

Edit the results visualization to show Occupant Paths
  1. In the toolbar, click the View menu
  2. Click Show Occupant Paths.
  3. Save the visualization settings.

Figure 11 shows the results at 600 seconds. The display includes the Occupant Paths with colors corresponding to the Profile types.

path scrn view shopping triggers results 2024 2
Figure 11. The results: an Occupant has entered each of the stores by this time.

Conclusion

In this tutorial, we demonstrated how to use Pathfinder to simulate movement in a sample mall with Queues, Triggers, Behaviors, and Profiles. We also used the Occupant Path coloring feature to visualize results.

To download the most recent version of Pathfinder, please visit the Pathfinder Download page If you have any questions, please contact support@thunderheadeng.com.

Related Tutorials

Evacuation using Triggers to Change Behavior Reading Time: 8 minutes

Tutorial demonstrating how to model occupants that respond to Triggers to evacuate in a small conceptual model.

Pathfinder Logo  -  triggers profiles behavior
Subway Circulation and Emergency Evacuation Using Triggers Reading Time: 13 minutes

Update to a Pathfinder subway station passenger movement, using queues and triggers to simulate standard circulation, then an emergency evacuation.

Pathfinder Logo  -  public transit venue process behavior cad queue geometry flow groups profiles triggers
Subway Station Passenger Movement Reading Time: 15 minutes

Tutorial demonstrating how to model passenger movement in a large subway station.

Pathfinder Logo  -  process venue public transit behavior cad doors geometry flow groups profiles vehicles
Triggers Reading Time: 13 minutes

This tutorial teaches the user how to create Triggers in Pathfinder models.

Pathfinder Logo  -  triggers queues
Distribute Exit Goals Reading Time: 1 minute

Video tutorial demonstarting how to assign exit goals to percentages of the occupant population.

Pathfinder Logo  -  behavior doors flow groups profile
Distributed Use of Stairs and Escalators Reading Time: 3 minutes

Tutorial demonstrating how to distribute the use of stairs and escalators in Pathfinder.

Pathfinder Logo  -  public transit behavior profiles stairs
Evacuation Using Familiar Paths Reading Time: 3 minutes

Tutorial demonstrating how to have occupants evacuate using familiar paths.

Pathfinder Logo  -  behavior doors
Circulation Movement Using Queues Reading Time: 9 minutes

This tutorial teaches the user how to create circulation movement using Queues in an example cafeteria model.

Pathfinder Logo  -  process venue behavior controls queues