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

Connected

Exercise

Building a car washer model with SimPy

Consider that a company purchased a commercial car washer and wants to optimize its operation to increase profitability. Building a discrete-event model can be helpful because it can help identify bottlenecks, streamline resources, and incrementally adjust processes towards reaching full capacity.

The commercial car washer takes five minutes to complete a car wash cycle.

Build a discrete-event model that mimics the behavior of this machine, and run it for eight hours (480 minutes) to predict the number of cars washed, and log the time of completion of each cycle.

Instructions

100 XP
  • Import the SimPy package.
  • Complete the print() statement to write the current simulation time in the console.
  • Build the SimPy Environment.
  • Run the model for eight hours, using minutes as the time units.