All we need for this problem; is a simple 3 source->server->sink model.
The objective of this exercise is to use data tables. Here is an arrival time of every 10 minutes from 8am to 12pm
The datatable contains datetime objects dictating arrival time; however I still choose to create a workday schedule for our doctor, so she does not work past 1pm. (There are other ways to do this)
The results here
We see that the final patient is seen (finalGuy response) at approx 11:56:25 in the morning; meaning the doc stays past 12. Average of 21 patients seen; and a waiting time of 6 minutes per patient.
Adjusting for 2-3 patients every 20 minutes; I’ve redone the data table arrival times.
With this more condensed schedule; the doctor gets out around 11:30am every morning; seeing more total patients. However patient waiting time has increased to approx 15 minutes.