Advertisement

Simulation: customer generation

Started by August 09, 2002 08:54 PM
12 comments, last by ares32585 22 years, 6 months ago
Ok, the game is where you run a pizza business. You hire employees, buy ingredients, tables, ovens, etc. It''s "turn-based" meaning that you do all the buying/hiring in one phase, and then you "end turn" and then a day of the restaurant is simulated. Here''s where my question comes in: how do I generate (determine the number of) customers that will visit the restaurant that day? Here''s how I currently do it. Firstly, the restaurant has a "popularity rating" which gets higher when a customer is satisfied with his experience, and lower if something dissatisfies him (slow service, not enough room, etc.) I generate a number of customers directly related to this popularity rating, plus an amount of customers visiting because of advertising. The number of customers who visit from advertising depends on the advertisement''s "quality." Now, this works fairly well, but I can''t help wondering if there''s a better way. How do games usually handle determining the number of customers that will visit in a simulation? (Yes, I realize most games of this type are real-time, but the question is still valid. How is it decided how frequently a potential customer will be generated. Is it pure randomness?) Can someone think of a better way to do this? Thanks for any help you can give. I know this might not technically be AI, but it deals with algorithms and simulation, so I figured this would be the place to ask. Dan
You seem to have a fairly decent way of modelling popularity... of course you could always incorporate the old addage:

"If a customer has a good experience, they tell a friend. If a customer has a bad experience, they tell ten friends!"

Personally I think that provided you account for the different factors you have mentioned in a realistic way, then you already have a good model. There was some research done by the Sante Fe Institute back in the late 80''s/early 90s regarding modelling customers/consumers. They found, as one would expect, that restaurants and bars have very dynamic popularity levels. They were principally looking at the decision making process of people who might be going to the bar/restaurant.

If your restaurant is popular, it''s harder to get a table and so some people go away unhappy, while others go home happier that they got a table when it was busy. Some people might be prepared to risk it being busy and go and seek a table, while others, knowing that the restaurant is popular, might seek somewhere good, but not quite so popular, believing they have a better chance of a table and good service.

I''m sure you could tune all of these factors into a good dynamic model.. just think of all of the things that influence your decision making process when you are looking for somewhere to eat out.

Sounds like a fun game!

Cheers,

Timkin
Advertisement
also realize that things like size of your smoking section as well as the proxmity of it to your non smoking section helps determine statisfaction. things like atomosphere help determine whether the eatery is good. many times ppl kids wont go to a an expensive restaurant or other "classy" joints. instead they tend to go for the faster service/nosier places. things like free bread/popcorn help in the desicion making. food preferences, sometimes ppl want one type fo food over another. alcholic beverages or if there is a bar for while you wait. having buzzers and being near some small shops vs having to stand outside when its busy. many ppl wont mind waiting 10mins to 30mins if they expect the wait. speed of service is importanta s well as how polite the waiter/waitress. physical attractivness also places a role. if you have ugly waiters and waitresses its likly that the younger crowd will choose another restaurunt. not saying you should factor such a thing in, but places like hooters use this type of thing. remember if all things are equal excpet one, that is what ppl will use to determine which eatery to go to. things like number of wrong orders taken and how they are handled (ie if the waiter/waitress gives a free dessert or takes it off the bill vs charging you and only apologizing). specials like free dessert with the meal or kids menus. prices. things like travel time would start to bring in many hassles and best left as something you are not concerned with.

you will need to actually set up a psedeo town with ppl in it. you create random families which consist of one o more adults and 0 or more children. you will also need to randomly factor in senior citizens (and their discount rate and specials). whether friends like it or not is also helpful, and you may wish to construct a tree to relate certain ppl with each other as well as how much they trust the others judgment. this simple diagram could be quite powerful when simulating behavior. you could factoring the "willingness to tell others". some ppl love to tell ppl about a great time they had somewhere, while others dont. some perfer only to discuss the bad, and neglect the good. some may have been there only a few imes and dont know of problems. maybe one person goes and consistently gets a bad waiter/waitress thus does not enjoy himself. his friend goes there often and enjoys it each time since the waiter/waitress is good. when they discuss it with ppl they will hav conflicting views. having a comments boxes in a eatery can be helpful. using the intro/extrovertness of a person and how good or bad the service was (ie extremness) could result in them dropping in the comment.=s oyou get a better idea of why needs to be changed. just having the box gives the feeling that the owner cares subconsciencesly. things like incentives (like free meals or discounts on a meal) could be given randomly to certain ppl in exchange for feeling out a survey rating things. you could even allow the player decide what he wishes the constomers to rate. then things like the length of the survey can be factored in to whether the offer is teken. since the survey is merely rating particular things on a scale and theer is limited things that would be of interest (ie service speed, food quality, food tempeture, food taste, portion size, price, etc) you could just allow the player to pick from a list the ones he wants to ask. you also may want to insert some silly ones as well for the humor or it. maybe even allow that to increase the cistomer satisfaction if teh eatery is supposed to be light hearted/kids place.

definatly do some research and really think about the little details that going into the desciion making process. yoru current scheme while somewhat basic is actually pretty good.
quote:
you will need to actually set up a psedeo town with ppl in it


How would I determine how many people would be in this town? Pure randomness? I was considering this option, but I couldn't figure out a good way to determine the number of people that should "live" in the town.

[edited by - ares32585 on August 10, 2002 11:32:49 AM]
quote:
Original post by ares32585
How would I determine how many people would be in this town? Pure randomness? I was considering this option, but I couldn''t figure out a good way to determine the number of people that should "live" in the town.

Allow the user to select what kind of town (and perhaps what kind of district) they want to start in. A small town would have cheaper property values, allowing them to spend more on store development right from the get-go and would have less competition, but would also have fewer potential patrons. A big city would have high prices, meaning the user could only afford a small store and would have less money for initial development, but would have a large number of possible customers, even in the face of stiffer competition. In the big city, however, the user might be able to maximize profits by operating a delivery service which would only require oven space, not seating.

I think there was a Theme Pizza or Pizza Tycoon game a few years ago. Why not take a look at it and see what they did right and wrong? I really like your idea, so save me a slice!
There is a book called "Programming Direct X for Visual Basic" where the author writes a sim called Swim Mall, or something to that effect, where he does a very similar simulation game. While the executable that came with the game didn't actually compile, he had ton's of good algos for some of the issues you're going to run into.<br><br>On a side note, remember the famous words of Yogi Berra, when asked a question about his favorite restaraunt. he said "Nobody goes there anymore, that place is always too crowded." <br><br> Dreddnafious Maelstrom<br><br>"If i saw farther, it was because I stood on the shoulders of giants."<br><br>Sir Isaac Newton<br><br><SPAN CLASS=editedby>[edited by - Dreddnafious Maelstrom on August 10, 2002 1:59:22 PM]</SPAN><br><br><SPAN CLASS=editedby>[edited by - Dreddnafious Maelstrom on August 10, 2002 2:00:30 PM]</SPAN>
"Let Us Now Try Liberty"-- Frederick Bastiat
Advertisement
I belive it''s also important for each customer to have his/her own charachteristics.

Charisma - They like/dislike the restaraunt, how many people are going to hear about it, and how many of those will take him/her seriously.

Age - In general, I don''t think older people like pizza, while it''s immensely popular in younger ones.

Patience - They have to wait for a table, or their food, or you make a mistake in an order. How ticked off are they going to get? This would probably raise with time, if they consistently have a good eating experience.

Size of family and the customers position in it - How many people are coming with them, by default, when he/she decides they want pizza. In addition, how much are they buying.

Income - Doesn''t apply too much to pizza, but could affect how many times a week they go out.\

Alot of this can be generated randomly, though some are related. ( ie. a 12 year old has little-no income, a 90 year old is probably not someones son, etc. )

You''ve probably considered this, but there''s another angle on it at least.



[My site|SGI STL|Bjarne FAQ|C++ FAQ Lite|MSDN|Jargon]
Ripped off from various people
[size=2]
Thanks for all the great ideas! I'm going to use some of them for sure.

Here's what I'm thinking of right now:
-The city is divided into regions, each with differing amounts of population. Building a restaurant in a more heavily populated area gives you more potential customers, but will cost more initially.

-You can build more than one restaurant in each region, but doing so will divide the pool of potential customers. For example, if there's three restaurants in one region, your potential pool of customers will be divided into thirds.

-The people will have a "hunger" variable that is decremented each "day." If that person goes and eats, he will no longer be hungry. (This doesn't really model actual hunger, because it doesn't take into account that they eat anywhere else). Also, if they're not hungry, they won't go to the restaurant to eat (this is so that there's no possibility of *everyone* in a region wanting to eat on the same day).

-Alternatively, as the last poster mentioned, I'm now thinking of having an "income" variable instead of the hunger. If the person doesn't have money, they won't eat. Which do you think is better? Or should I do both?

-Thirdly, I'll keep track of the person's good experiences vs. bad experiences at the chain of restaurants. A person with a lot more bad experiences than good will be more hesitant to eat there.

-I'm not sure If I'm going to implement families, but what I was thinking of doing was have each person have one or two or a small number of "friends" who "share" experiences. If, for example, a person has a good experience at a restaurant, his/her friends' "good experience" variable will be incremented, by some smaller amount than if the person experienced it him/her self. The same thing goes for bad experiences. This models the fact that people trust their own experiences more than those of someone else - but they still take them into account.

Any thoughts? Suggestions?

[edited by - ares32585 on August 11, 2002 3:15:14 PM]
So now your pizza shop simulation is turning into a town simulation. Is that what you really wanted in the first place? Most of the ideas put forward could be parameterised so that you didn''t need to model individuals, their incomes or their eating habits. For instance, the number of potential customers on any given day could be given as a simple function of the day of the week, the month of the year and the population of the town. More people tend to have take-out later in the week than earlier in the week; people tend to go out more in summer than in winter; and the town population obviously affects the maximum number.

Most people aren''t going to eat pizza more than once a week. Some will eat pizza once per fortnight and others only once per month. Work out what percentage of the town are pizza eaters and what percentage of all pizza eaters eta weekly, fortnightly, monthly, etc. Then for any given week you can work out how many potential customers there are. Now work out a proportion of those that are actually going to eat pizza this week, so that there is some fluctuation throughtout the cycle (maybe take a random number between 75% and 100%? Perhaps it''s 100% in summer and 75% in winter?). Divide them into days so that Thursday, Friday and Saturday get more customers than Sunday through Wednesday.

...and now you have a method for finding the number of customers on any given day without having to model individuals in the town. Of course there are many different ways you might want to use to work out the number of customers, this has just been one of them.

Cheers,

Timkin
I''m surprised that no-one has mentioned the Poisson distribution from probability which is classic method of simulating queue arrivals... it''s applicable to road traffic seperation as well as queues.
"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

This topic is closed to new replies.

Advertisement