For my CS 201: Principles of Software Development class, we’ve been steadily building our own virtual restaurants. Customers come in when they’re hungry, order off of a menu, change their minds, work off what they can’t afford, and more! Here’s how it works.
The fundamental structure that holds the whole restaurant together is called Agent Architecture. What this means is that there are multiple objects that each process information in their own way on their own time. To picture this, think of two different people, let’s call them Bill and George. Bill is currently eating a sandwich, but George is just lounging around watching tv. Both receive an email from their teacher telling them that they have homework for 50% of their grade due the very next day. Bill reads this email and immediately puts down his sandwich to get his homework done, returning to eat only afterwards. However, George reads the email and shrugs it off. After his show finishes, he decides that food is more important and eats. This is agent architecture: both people received a message and had different reactions, each taking their own time. The agents can receive messages at any time and process them however they like.
For my restaurant, I have 7 main agents (my 6 steps!): Customer, Host, Waiter, Cook, Cashier, and Market. The customer gets hungry, eats, reorders, and pays (or washes dishes!), while the waiter seats the customer, takes his order, goes on break, brings him his food, and delivers his check. Every agent has its own job, just like in a real restaurant. In addition, multiple customers and multiple waiters can exist at the same time: so one waiter may be delivering food while another waiter is bringing a customer his check. Each agent is its own thinking organism, and their type (customer, waiter, etc.) simply determines how they process the information they receive. If you’d like to see a demonstration of my restaurant, watch the video below! (Sorry about the cashier looking like a cook, it’s not quite done yet!)
What I think is really cool about Agent architecture, is that everything runs simultaneously and each “person” can “think” on their own. It allows me as the programmer to define what they are at their core and then expand situationally, which allows much more flexibility and a more user oriented design. I can order what my program does by its importance rather than ordering by its appearance or checking every aspect of the instance.
Until next time, Fight On!