Calculating Metrics
00:00 Once the simulation completes, you’ll end up with a list of wait times that you need to do some work on. This is great, but it would be nice to report something that you can easily share with the manager.
00:11
So go ahead and define a new function called calculate_wait_times()
,
00:16
and you’ll pass in that list of wait_times
. From here, you can calculate the average_wait
by using the statistics
module and calling mean()
off of that, and passing in the wait_times
. And then to pretty-print the results, you can say that minutes
and the frac_minutes
(fraction of minutes) is going to equal the divmod()
, pass in the average_wait
and 1
, and then seconds
is going to be the frac_minutes * 60
.
00:50
All right. And once you’ve got that, you can return the rounded minutes
and the rounded seconds
, like so. Great! So now that you can see how a set of parameters will perform, we’re going to switch gears and let the user select different parameters so they can experiment with different staffing needs.
Become a Member to join the conversation.