Running the Simulation
Now that the processes available in the theater have been defined, as well as the route a moviegoer will take, it’s time to set up a function to actually run the simulation. Define a new function called
run_theater(), and with this, you’ll pass in the
env (environment) and the
num_employees (number of employees) that you have. So, the
num_cashiers (number of cashiers), the
num_servers (number of servers), and then the
num_ushers (number of ushers).
The manager also notes that when they open, there tends to be a line of moviegoers waiting and ready to go! On average, this is about three people, so if you want to start off with three moviegoers, you can do this with a
01:10 Now, to address additional moviegoers arriving on their own time, you can turn this function into a generator that will loop forever. The manager has informed you that moviegoers tend to arrive to the theater on average every 12 seconds—or one fifth of a minute.
Become a Member to join the conversation.