# MM2 - mm2 < function(ArriveDis ArriveShape ArriveRate...

This preview shows pages 1–2. Sign up to view the full content.

{ #ArriveDis can be 1-exp, 2-gamma. ex: mm2(1,0,1,1,0,1) if it is exp with rate 1 #DepartDis can be 1-exp, 2-gamma. ex: mm2(1,2,3,1,2,3) if it is gamma with rate 3, shape 2 inf<-100000 #set infinity num. t <-0 # currrent time T<-12 # store close time Ta <-0 # arrival time t1 <- 1000 #service completion time of customer present with server 1 t2 <- 1000 #service completion time of customer present with server 2 Na <- 0 #number of arrival Nd <- 0 # number of departure Nw <- 0 #number of person at the waiting line cond <- 1 #for stop while loop A <-0 #the arrival distribution D <-0 #the departure distribution n1 <- 0 #num of person for server 1, it can take value of 0 or 1 n2 <- 0 #num of person for server 2, it can take value of 0 or 1 n = 0 # number of units in queue #counter <- 0 #keep track of while loop output <-NULL output[1] <- 0 i<-2 arrival <-NULL departure <-NULL waiting<- NULL j <- 0 k<- 0 z<- 0 while(cond >= 1 ) { #output[i] = n if(ArriveDis == 1) { A = randome(1,ArriveRate) } if(ArriveDis == 2) { A = randomg(1,ArriveShape,ArriveRate) }

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/16/2010 for the course STAT 340 taught by Professor Xu(sunny)wang during the Spring '09 term at Waterloo.

### Page1 / 10

MM2 - mm2 < function(ArriveDis ArriveShape ArriveRate...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online