Waste no time in a queue!
What’s the deal?
Imagine you run a venue with a couple of stands, each having its own queue. All of them can be visited by people in any order. And there is a crowd in the front of just a single one. Each person is waiting for their turn to be served. They are getting upset and frustrated, not knowing there are other stands available. How could you change this? What possibilities would you have with an ability to spread people more evenly? And after all - what would be the impact of this on people and their general impression about the place?
Providing continuous measurement of a queue length can have significant impact on your venue. Even though it sounds like a trivial task, such monitoring delivers interesting data we can use to spot repetitive behaviours of a crowd or some regularities in a given time.
And yet, implications of having such monitoring may be more powerful than that.
Where to use it
Collecting data about queues changing over time is just the first step. Once you have it, you can react to it properly. What does “react properly” mean? It depends on your business domain and the type of activity.
The first association coming to my mind is an airport and a security check. Usually there is a person directing which gate people from a single queue should go to. And usually there is a rush, since everyone would like to go smoothly through the check and be done with it. What benefit could the monitoring of the queue lengths bring in this case? At first, better security, since we can avoid unnecessary crowd congestions. The second thing is the possibility to control the flow of people and route them to a less busy place.
There is yet another place where people really hate to waste time. When you visit a theme park, you are looking for entertainment. So spending time in line is not the thing we would like to do here (especially, if you are there with feisty kids). This can really lower our satisfaction and joy. Thus, with queue monitoring and directing people to less crowded attractions, we can not only achieve bigger throughput of the venue, but also raise the overall enjoyment of visitors. After all, this is the essential thing in such a place!
How to implement this
Ok, so far I have just presented why queue monitoring is so valuable and where it could be used. However, how can we actually monitor these queues? There are various implementations possible.
Let’s have a look at three of them:
Seems like the simplest one and easiest to implement. The accuracy of this solution depends on the number of sensors placed in a queue area
This one assumes your customers have some kind of beacons attached to them (let it be a sticker, card or a bracelet, i.e. a kind of a wearable thing) and there are devices capable of detecting the wearables around the venue area. Then the location of a given beacon device can be computed with positioning algorithms. Thanks to wearables, this solution offers exact positioning and can provide more sophisticated and personal features (for example, based on a position you could add tracking capabilities)
Based on advanced algorithms of detecting people on a captured image. It does not require any devices worn by attendees and the only thing needed is a camera streaming images of the queue area to a server processing this data. You can read about counting objects on an image or video on our blog
Utilize the data
Once the data is computed, it is worth to store it so that it is easily accessible for business logic, like generating alarms based on predefined thresholds.
It could be useful to visualise the states of the measured queues. With a carefully designed dashboard you can quickly get a good understanding of the overall state of your queues in the venue.
Our use case
In one of our projects we were capturing data from infra-red sensors. The state of the queue was computed based on average readings for a specified time window. Relying on such data, we were able to say which queue was empty, half-empty or full. The implementation was fast and its accuracy was just enough for the requirements we had. Thanks to this, we knew which places were congested and could use such information to direct the flow of people more evenly.
The processing pipeline was based on RxJava that provides a great API to handle streams of data. After project was finished we have done a small proof-of-concept computing averages with Akka Streams. With its powerful API it worked really well.
Is it worth it?
I would definitely say: YES!
Advantages of queue monitoring are two fold. For the venue attendees, spending less time in a queue increases their satisfaction and means that they will be more likely to visit the place again. On the other hand, for the host, a more efficient service means bigger throughput by reducing or even completely removing tie-ups.
Besides that, collected data can be used to visualize all the metrics in form of graphs to get a better insight of what is going on at the monitored place.
Finally, instead of simply directing visitors to the smallest queue by dedicated staff members, you could use chatbots deployed at the end of the queue or send notifications to a visitor's smartphone with guidelines on where to go to not only get to the smallest queue but also visit some other areas of the place while on the way there. This kind of smart routing opens up new business opportunities and improves the overall reception of a crowded place.