The aims of this research were (1) to develop a model to simulate a herd of cows and quarter milk flowrates for a milking and derive quarter and udder milking durations and box duration (i.e., the time a cow spends inside the robot) for a group of cows milked with an automatic milking system (AMS); (2) to validate the simulation by comparing the model outcomes with empirical data from a commercial AMS dairy farm; and (3) to apply teatcup removal settings to the simulation to predict their effect on quarter and cow milking duration and box duration in an AMS. For model development, a data set from an AMS farm with 32 robots milking over 1,500 cows was used to fit the parameters to the variables days in milk, parity, and milking interval, which were subsequently used to create a herd of cows. A second data set from 2019 from an AMS farm with 1 robot milking 60 cows that contained quarter milk flowrates (at 2-s intervals) was used to extract the parameters necessary to simulate quarter milk flowrates for a milking. We simulated a herd of cows, and each was assigned a parity, days in milk, milking interval, and milk production rate. We also simulated milk flowrates every 1 s for each quarter of each cow. We estimated quarter milking duration as the total time that flowrate was greater than 0.1 kg/min after a minimum of 1 min of milk flow. We incorporated a randomly sampled attachment time for each quarter and calculated cow milking duration as the time from the first quarter attached to the last quarter detached. We included a randomly sampled preparation time which, added to cow milking duration, represented box duration. For simulation application, we tested the effect of quarter teatcup removal settings on quarter and cow milking duration. The settings were based on absolute flowrate (0.2, 0.4, and 0.6 kg/min) or a percentage of the quarter's 30-s rolling average milk flowrate (20, 30, and 50%). We simulated over 84,000 quarter milkings and found that quarter milking duration (average 212 s) had a mean absolute percent error (MAPE) of 7.5% when compared with actual data. Simulated cow milking duration (average 415 s) had a MAPE of 8%, and box duration (average 510 s) had a MAPE of 12%. From simulation application, we determined that quarter milking duration and box duration were reduced by 19% (209 vs. 170 s) and 6.5% (512 vs. 479 s), respectively, when increasing the teatcup removal flowrate from 0.2 to 0.6 kg/min. Quarter milking duration and box duration were 7% (259 vs. 241 s) and 3% (590 vs. 573 s) longer respectively by using a teatcup removal setting of 20% of the quarter's rolling average milk flowrate, compared with 30%. Both results agree with previous research. This simulation model is useful for predicting quarter and cow milking and box duration in a group of cows and to analyze the effect of milking management practices on milking efficiency.