Unfortunately, I don't have time to read your code, but if it is any help, I have general discrete event simulation code as an example in my book. I've posted the code at http://heather.cs.ucdavis.edu/DES.R Norm Matloff