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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.