Tuesday, October 21, 2008

LunchBot

At both work places, current and previous; we mused on a program that tells us where to go for lunch. There is one Wheel of lunch; if you are looking for a quick solution to your misery. Let me explain you what this misery is. Its when you can't find a place good enough for today. Its a decision to be made, and that too, quick; because you are running out of your "lunch time". Your taste buds have gone on a vacation; they don't recommend you anything. Maybe you are not a food loving person like me, but its possible you have other constraints like time, money, <__add your constraint here__>.
So, lets get to business without any further delay.

What we need is a customized wheel of fortune. Something we all (we ~~ all lunch buddies) agree on.

The solution:

1. We need to create user accounts for our lunchbot.
2. The users will add restaurants to the lunchbot.
3. For each restaurant, you can have a simple 5 point rating. However, you can add information about the restaurant inside your application like menu, distance to the place, etc. (Probabely, somebody in your office has menus from nearby restaurants.) But, for a starting point, we can have a simple 5 point rating. However, knock yourself out by enhancing the system according to your tastes; pun intended. I recommend you do so after completing a basic lunchbot. But while designing the bot, make sure to have it future-compatible.

This means that its very easy to change the behavior and/or enhance it. I don't understand why future-compatibility is not one of the core characteristic of acceptable programming. I haven't even encountered anywhere else. It is just what other tasks can be performed by your system.

At this point, we have all the data needed to play the wheel - the players and the machine .. ahm .. the lunchbot.

Selection:
1 simple strategy is to get all restaurants we didn't go to in this cycle and select a random one.

Variants:
1. While getting the restaurants, add the ones that have 5 ratings; 5 times in your selection queue to increase their probability to be chosen. So, the ones having a rank 4 are added 4 times, ones with rank 3 are added 3 times, etc.
2. In addition to above, you can have a "repeatable" flag for favorite favorite restaurant(s). But after selected once, the rank of the restaurant has to be decreased to avoid going there everyday in the week.
3. You can also have "specialty override" flag for restaurants that have special menu on some days -or- u can have a "manual override" and go to the restaurant whatsoever.

No comments: