1. Learn
  2. /
  3. Courses
  4. /
  5. Discrete Event Simulation in Python

Exercise

Restaurant model: Set up, run and analyze results

In the previous exercise, you defined the generator that simulates table requests and customer decisions to wait or leave based on waiting times.

Now let's set up the model, run it, and analyze the results. Recall that the objective of building this model is to determine the appropriate number of tables and kitchen capacity to serve the maximum number of customers while minimizing initial investment and running costs.

To set up your model in a meaningful way, you decided to visit restaurants in the area and observe customer behavior.

You noticed that on average:

  • During peak hours, new customers arrived every 10 minutes
  • Customers had the patience to wait between 1 to 10 minutes for a table (MIN_PATIENCE and MAX_PATIENCE)
  • Customers left if the waiting time was longer than 10 min
  • Customers occupied the tables for 40 to 90 minutes (MIN_SEATING_TIME and MAX_SEATING_TIME)

The time in the model is in minutes.

Instructions 1/2

undefined XP
    1
    2
  • Assign the appropriate values to the model parameters.
  • Create a SimPy resource to represent the restaurant tables, starting with two tables only.
  • Run the model for a period between 11:30 am and 3:30 pm (4 hours is 240 minutes).