Skip to content

tamsri/chinese-restaurant-simulation

Repository files navigation

Chinese Restaurant Simulation

Chinese Restaurant Simulation is a simulation based on activities in a Chinese restaurant between customer groups, cashiers, waiters, and manager. The restaurant has various types of queues such as buffet queue, restaurant queue, waiter queue, checkout queue. The simulation also depends on various distributions on generating random in time in services and types of customers.

Type of Simulation

This simulation used process interaction method based on the customer group that arrives to the restaurant interacts to the restaurant.

Model Scheme

The restaurant scheme

Objects and Attributes

Objects Class Names Descriptions Attributes
Chinese Restaurant ChineseRestaurant An object that contains all objects inside the restaurant
  1. random_generator
  2. variables
  3. manager
  4. free_restaurant_tables
  5. free_buffet_seats
  6. free_waiter_queue
  7. free_cashiers
  8. wait_waiter_queue
  9. restaurant_queue
  10. buffet_queue
  11. checkout_queue
Variabels Variables An object that contains all variables required in the restaurant simulation can be called for generating numbers in objects
  1. number_waiters
  2. number_tables
  3. probability_of_persons_in _group
  4. average_arrival_interval
  5. variance_arrival_interval
  6. time_queue_to_table
  7. average_waiter_service_time
  8. average_cashier_service_time
  9. number_cashiers
  10. number_buffet_seats
  11. probability_buffet_customer_group
  12. average_buffet_time
  13. variance_buffet_time
Seat Seat A seat is a component for both buffet and table for a customer to occupied during the services
  1. Seat()
  2. ~Seat()
  3. GetSeatId()
  4. IsEmpty()
  5. OnSit()
  6. OnLeave()
  7. seat_global_id_
  8. seat_id_
  9. occupied_customer_
Table Table A table consists of seats and actions for the customer group
  1. Table()
  2. ~ Table()
  3. GetTableId()
  4. GetSeatNumber()
  5. IsFree()
  6. OnSit()
  7. OnLeave()
  8. occupied_customer_group_
  9. table_id_
  10. table_global_id
  11. seats_
Customer Customer A person inside the customer group
  1. Customer()
  2. GetPersonId()
  3. customer_id_
  4. customer_global_id
Customer Group CustomerGroup A customer group consists of customers and actions for executing the process
  1. CustomerGroup()
  2. State
  3. IsTerminated()
  4. GetCustomerGroupId()
  5. PersonsInGroup()
  6. IsBuffetCustomer()
  7. GetCustomerMember()
  8. AssignTable()
  9. AssignState()
  10. Activate()
  11. chinese_restaurant_
  12. customer_group_global_id_
  13. customer_group_id_
  14. service_time_
  15. cashier_time_
  16. is_buffet_customer_
  17. customer_members_
  18. cashier_
  19. served_by_
  20. table_
  21. buffet_seats_
  22. process_
  23. state_
  24. terminated_
  25. log_
  26. CallManager()
  27. SitOnTable()
  28. AssignWaiter()
  29. ActivateWaiter()
  30. LeaveTable()
  31. LeaveWaiter()
  32. AssignBuffetSeats()
  33. SitOnBuffetSeats()
  34. LeaveBuffetSeats()
  35. AssignCashier()
  36. ActivateCashier()
  37. LeaveCashier()
  38. Execute()
  39. CustomerArrives()
  40. CreateNextCustomerGroup()
  41. CustomerGroupWaitsInRestaurantQueue()
  42. CustomerGroupWaitsInBuffetQueue()
  43. CustomerGroupInCheckoutQueue()
  44. CustomerGroupArrivesToTable()
  45. CustomerGroupWaitsTheWaiter()
  46. CustomerGroupInRestaurantService()
  47. CustomerGroupInBuffetService()
  48. CustomerGroupLeaveService()
  49. CustomerGroupInCashier()
  50. CustomerGroupComplete()
Waiter Waiter A waiter provides service to the customer group in restaurant service
  1. Waiter()
  2. ~Waiter()
  3. GetWaiterId()
  4. ProvideSErviceTo()
  5. CompleteService()
  6. IsAvailable()
  7. waiter_id_
  8. waiter_global_id_
  9. service_to_
  10. log_
Manager Manager A manager manages the restaurant queue to the restaurant table according to the strategy of the restaurant
  1. Manager()
  2. Manages
  3. chinese_restaurant_

Block Diagram

The restaurant diagram

Log

Log is a console log class which allowed the user to choose priorities of information from to the simulation to receive the information as the user would like to see. Log also classifies the information into three types of information. Error, Information, and Event.

  • P1 – Highest Priority Log only allows users to see only harsh error happens in the simulation
  • P2 – A Priority of Log allows users to see events where the customer groups arrive and leave the restaurant amd error.
  • P3 – A Priority of Log that allows users to observe mainly for events happening inside the restaurant
  • P4 – Lowest Priority Log that allows users to read every information happens in the restaurant including the constructing and destructing of the objects inside the restaurant.

Random Generators

Random Generators are constructed by using uniform distribution generators that were pseudo generated and saved in kernels set in the file. Each random generator is created for one purpose accordingly.

The generators were tested and the results written in “(project folder)/statistic result”.

Interval Arrival Time Generator

The interval generator

An Interval Arrival Generator is a normal distribution generator generated by using two uniform distribution generators, in this project, by rejection method.

The input parameters are an average value of 1500 and a standard deviation value of 100. After running the test, It generates an average value of 1502.

Waiter Service Time Generator

The waiter generator

A Waiter Service Time Generator is an exponential distribution generator generated by a uniform distribution generation, in this project, by inverse transformation method.

The input of this generator is an average value of 4000. After running the test, It generates the average value of 4020.

Buffet Service Time Generator

The buffet generator

A Buffet Service Time Generator is a normal distribution generator generated by using two uniform distribution generators, in this project, by rejection method.

The input parameters are an average value of 1900 and a standard deviation value of 200. After running the test, It generates an average value of 1902.

Cashier Service Time Generator

The cashier generator Cashier Service Time Generator is an exponential distribution generator generated by a uniform distribution generation, in this project, by inverse transformation method.

The input of this generator is an average value of 220. After running the test, It generates the average value of 222.

Persons in Group Generator

The persons generator

A Persons in Group Generator is a generator based on the given possibility of persons occupies in the group. The generator is based on generating a uniform distributed value to compare the range between possibility.

The possibility of this generator is { 0.11, 0.33, 0.33, 0.23 } of possibilities of persons in the group accordingly from 1 person to 4 persons. After running the test, It generates { 0.12, 0.34, 0.33, 0.22 }.

Buffet Customer Generator

The type generator

A Buffet Customer Generator is a generator based on comparing the possibility of a generated number from a uniform distribution generator comparing to the possibility of the buffet customer groups.

The possibility of this generator is 60% of the groups are buffet customer groups. After running the test, It generates 59.90% of the generated groups are buffet customer groups.

About

A Restaurant Simulation based on Process Interaction in C++.

Resources

Stars

Watchers

Forks